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?
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 @VioneT@lemmy.world
(Aside: Heads up that your
fusion-text-to-image-plugin
may break in the future if I update the internals/server-side stuff oftext-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 importtext-to-image-plugin
intofusion-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 thetext-to-image-plugin
is a recipe for trouble - it basically means that you have to constantly watchtext-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 :)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?Good catch! That was definitely a bug. Fixed now: https://perchance.org/dfrgpyo9gi#edit Thanks!! 🙏
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.
Nice! I’ll start playing around with it. @AdComfortable1514@lemmy.world, also pinging the OP.
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
Great to hear! Also please see the note that I edited into the above comment.
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
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.
@perchance@lemmy.world - pinging Dev, might be useful to have an ‘on demand’ import :D .
@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!
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.
@AdComfortable1514 Okay, thanks for acknowledging!
i tried to make some images on your generator today and felt weird lag, i guess from this, and may see your problem
@Alllo @AdComfortable1514 Even just clicking on the dropdown menus also showed some delay there.
Can you make a check box so if checked then load dataset you would need a box for every dataset tho
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.