this post was submitted on 25 Mar 2024
7 points (100.0% liked)

Perchance - Create a Random Text Generator

554 readers
14 users here now

⚄︎ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.

See this post for the Complete Guide to Posting Here on the Community!

Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

5. Refrain from requesting Prompts for the AI Tools.

  • We would like to ask to refrain from posting here needing help specifically with prompting/achieving certain results with the AI plugins (text-to-image-plugin and ai-text-plugin) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"
  • See Perchance AI FAQ for FAQ about the AI tools.
  • You can ask for help with prompting at the 'sister' community Casual Perchance, which is for more casual discussions.
  • We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

6. Search through the Community Before Posting.

  • Please Search through the Community Posts here (and on Reddit) before posting to see if what you will post has similar post/already been posted.

founded 2 years ago
MODERATORS
 

I have a image generator which samples a few fairly large datasets (around 10K words per category).

The user selects a dataset , from which a word is randomly selected.

As such , I only need to load the dataset which is currently selected.

I'd like for the other datasets to be un-loaded until the user selects them.

Is there a way to do this?

Or , can this problem be resolved by other means?

top 17 comments
sorted by: hot top controversial new old
[–] perchance 5 points 10 months ago* (last edited 10 months ago) (4 children)

Great to see you're pushing the limits of Perchance in practical/real usage! I just made this plugin which is hopefully helpful: https://perchance.org/dynamic-import-plugin

I probably should have created something like this quite a while ago, since there have been similar requests before.

Pinging @[email protected]

(Aside: Heads up that your fusion-text-to-image-plugin may break in the future if I update the internals/server-side stuff of text-to-image-plugin. The plugin has backwards-compat guarantees on the existing features that it exposes, of course, but there won't be any notice for internal changes that I make to that plugin, including server-side stuff. You might have forked it before I put the warning there. I'd recommend posting to this forum with feature requests for anything you want rather than forking. Note that it's fine to import text-to-image-plugin into fusion-text-to-image-plugin just to add a 'wrapper' around it if you are fine with its current feature-set and just want to create your own 'interface' to those features. But yeah, changing the internals of the text-to-image-plugin is a recipe for trouble - it basically means that you have to constantly watch text-to-image-plugin, and e.g. 2 years from now all your generators suddenly break due to an internal change I made, and maybe you don't notice for several weeks, during which time all the people that were regular users have moved on. All of that said, it's okay to edit the internals if you understand the above risks :)

[–] VioneT 3 points 10 months ago

Nice! I'll start playing around with it. @[email protected], also pinging the OP.

[–] VioneT 3 points 10 months ago (1 children)

Just some clarification, currently it gives the whole generator i.e. not only the specified output at the $output. I'm not saying that it is bad, but I would guess that it is counter-intuitive with how the regular imports work. Possibly an option?

[–] perchance 3 points 10 months ago (1 children)

Good catch! That was definitely a bug. Fixed now: https://perchance.org/dfrgpyo9gi#edit Thanks!! 🙏

[–] Alllo 2 points 10 months ago

only thing out of place catches my eye is this sentence: Due to the above points, you should only use this plugin if the loading speed of your generator significantly impacted by the large number of imports that you have.

like how mine was missing a word, yours is missing a word :) 10 points if you automatically caught that mine was missing a word. another 10 points if u automatically caught where the target sentence was missing a word.

[–] AdComfortable1514 2 points 10 months ago* (last edited 10 months ago) (1 children)

Wow! Thank you so much ❤️! I'll make great use of this.

The best datasets are usually very large. I've already split the datasets I'm using into smaller generators.

In total , I have 38 generators prepared with 10K unique words in each, a generator with 29K unique names , a 15K word generator for prepositions , plus the 5 separate generators for 47K CLIP tokens.

I've had to prioritize which ones to load before , but this feature open up a bunch of new options.

I'm looking forward to testing it out ( ; v ;)b!

EDIT : Here's the first generator I made with the dynamic-imports plugin : https://perchance.org/fusion-t2i-names

[–] perchance 3 points 10 months ago (1 children)

Great to hear! Also please see the note that I edited into the above comment.

[–] AdComfortable1514 2 points 10 months ago* (last edited 10 months ago)

Duly noted. And I totally agree.

I will use the original text-to-image plugin for the public version , to avoid future troubles.

EDIT : Done

[–] [email protected] 1 points 10 months ago* (last edited 10 months ago)

Interesting plugin! I might as well use this for my generator hub page, and also its preview version, because it needs to import the base source of the generator manager (power-generator-manager) to be able to retrieve and sync the generator lists and the "news & updates" from that, so I don't have to change it in case I needed to change anything in the gen list (e.g., the description or, if I had released a new generator, I'd need to add that generator to the list). And that's to reduce some loading time.

[–] VioneT 4 points 10 months ago

@[email protected] - pinging Dev, might be useful to have an 'on demand' import :D .

[–] Alllo 2 points 10 months ago (1 children)

i tried to make some images on your generator today and felt weird lag, i guess from this, and may see your problem

[–] [email protected] 3 points 10 months ago

@Alllo @AdComfortable1514 Even just clicking on the dropdown menus also showed some delay there.

[–] [email protected] 2 points 10 months ago* (last edited 10 months ago) (1 children)

@AdComfortable1514 Kind of a bug report to your generator, but on the base, main and negative prompt inputs the hide button initially showed no text and sitting next to the input labels. Let me know if this was a bug!

https://user-uploads.perchance.org/file/261b77d86fe9133ea7fab4813a269aa8.jpeg

[–] AdComfortable1514 1 points 10 months ago (1 children)

Yeah , It's a bug.

I'm going to change the entire HTML in the near future (likely a month or so from now) so I haven't bothered with it.

[–] [email protected] 2 points 10 months ago

@AdComfortable1514 Okay, thanks for acknowledging!

[–] edwardthefma99 -1 points 10 months ago (1 children)

Can you make a check box so if checked then load dataset you would need a box for every dataset tho

[–] VioneT 3 points 10 months ago

The way the imports work, Perchance first checks the code for the imports, and then imports them before loading the page to avoid errors.

Currently, we don't know a way to load an import only if they are to be used, which is the purpose of the post.