Perchance - Create a Random Text Generator
⚄︎ 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.
- The full rules are posted here: (https://legal.lemmy.world/)
- User Rules: (https://legal.lemmy.world/fair-use/)
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
andai-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.
view the rest of the comments
Can you try again now? I wasn't able to replicate it, but I did find another extremely strange issue that seems to be related to a recent windows update, where basically on (some?) windows machines the iframe wouldn't update the rendering when the "processing..." was removed and replaced with the image, so it'd just be stuck on "processing" until you mouse over the iframe which for whatever reason triggers the rendering to update.
So it's possible your issue was related to that. If so (and either way, actually), thanks for reporting this! I was so confused about the reports/feedback saying that generation was so much slower recently, and I'm 90% sure this was the issue. Quite a relief.
If your issue is still there, can you try running in guest mode if you aren't already? I.e. click the avatar thing next to the three vertical dots menu, and click the guest option. I tried to replicate in Chrome 126, and Firefox on Ubuntu, and Chrome v126 on Windows 11 and Windows 10. Though I wasn't able to test OS-level dark mode on BrowserStack, so if you could test light mode to see if the issue is gone, that would be good too.
Still happening for me. I'm using a Chromebook, so it's using Chrome OS. So not a windows update thing.
Something I did notice when stepping through the code was, there's a canvas which is drawn to and then used to get a data url--which can be a little slow at least (though for smaller images like this should be fine). I'm not sure why it does this, as the api gives a data url for the image anyway. So there's multiple copies of the same image in the device's memory for every single image generation.
(And many more for the referenceImage stuff, though I know no-one uses that.)
I don't know if any of that is related to the issue you're seeing, or I'm seeing, but could be.
Ah okay solved it, thanks! It was due to some sort of update which changed the result of a touch screen detection heuristic. I'm now using
window.matchMedia("(pointer: coarse)").matches
which seems to work correctly. So the buttons should only show up (without hover) for phones, ipads, chromebooks in tablet mode (not in trackpad mode), etc.Yeah it's just a convenience trade-off - it's sometimes handy to have the canvas already ready to go, since that's the first step in manipulating the image. Should be extremely minor in terms of performance unless you're drawing dozens of images per second (I'd guess that even a few dozen per second on a mid-range mobile device would be fine, but I could be wrong).
Oh interesting! Didn't know that was a media query! 👍
Are people manipulating AI-generated images a lot then? I don't think I've seen any generators that do that, but I guess I'm new here. And also, the people creating such generators already know how to do that pretty easily, so probably won't have any problem doing it themselves anyhow.
The other concern is memory use though. Phones might be fine with the processing cost, but a lot of phones still have low graphics RAM (if any). One idea would be to generate that through a getter, and cache the resulting canvas. That way there's zero performance or memory usage unless the generator actually uses it. (Which as I say could be a very small percentage of image generators, potentially.) And those that do use it won't be any the wiser, it being lazily created when needed.
Personally I thought converting to data urls is pretty slow. Maybe for images at this comparatively small size it's less of an issue.