this post was submitted on 02 Aug 2024
1 points (100.0% liked)

Perchance - Create a Random Text Generator

448 readers
17 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 1 year ago
MODERATORS
 

Seems when they load, all buttons are shown regardless of if the user is hovering over them or not. Then when hovering, they're shown of course. Then moving the mouse away hides the buttons and it all works as normal. Seems unintended that it thinks the user is hovering onload when they're not. Not sure why that's happening.

(Also I don't think it was happening until very recently. So possibly a breaking change.)

you are viewing a single comment's thread
view the rest of the comments
[–] perchance 1 points 3 months ago* (last edited 3 months ago) (1 children)

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.

as the api gives a data url for the image anyway

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).

[–] wthit56 1 points 3 months ago

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.