this post was submitted on 14 Aug 2024
2 points (100.0% liked)

Perchance - Create a Random Text Generator

448 readers
15 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
 

Caused by this code:

if(!data.prompt) {
d.prompt = data.evaluateItem.toString();
}

It expects the settings object itself to have an .evaluateItem property, which it normally won't have. Ideally it should handle that too instead of erroring. (I've put a failsafe into my advanced plugin for now.)

I think it should always fall back to using "" as the prompt. Which at the very least would stop this error from happening. Though it's still blocked from generating anything with a message. I also feel like it should still just generate an image, unless there's something actually bad that will happen on the server-side because of this that I'm not seeing?

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

I've changed !data.prompt to data.prompt === undefined - does that solve your issue?

which it normally won’t have

Can you explain further? If data.prompt === undefined then it's a string/number/boolean (which all have evaluateItem IIRC) or a perchance node, right?

I think it should always fall back to using “” as the prompt

This sort of thing is always a trade-off with letting people know that they've made an error. I.e. if there's something that seems really strange, then sometimes it's better to tell the dev about it so bugs are easier to fine. They can always "explicitly" do the weird thing if they want to. This does have downsides, of course - leads to some annoying extra if/thens being required for the dev in some situations. I don't have a great mental model of where the trade-off should land here, so I'm reluctant to change this without a good argument.

[–] wthit56 1 points 3 months ago (1 children)

then it’s a string/number/boolean

Or a plain old object. Which apparently doesn't have that.

They can always “explicitly” do the weird thing if they want to.

That's the thing--I couldn't, without the error. I had to dig into the code to figure out the cause of the error, and code a way of appeasing it so it wouldn't throw the error. Maybe just an "allow_missing_prompt" property or something, so then the creator is explicitly saying it's fine if the prompt is empty? Or just make it a warning and allow it to run, instead of an error. Then the creator can see it, but it will still be allowed in the final page.

I get why there's a tricky balance to be struck here. I've been wrestling with that for my advanced image plugin too honestly. Adding in errors... then taking them out again. ;p I think for a platform like this, my take is... make everything work as far as possible. Let them do things that are weird/break, and give them the tools to fix it themselves. Error when it absolutely cannot run.

This is somewhat taken from another platform I was a part of, a game/creation application called Dreams. That was a full game engine with easy-to-use but complex-under-the-hood tools, and had zero errors. It had weird behaviour when you do weird things, but it was far friendlier than errors I think. And is known for being one of the most user-friendly game creation tools out there.

[–] perchance 1 points 3 months ago* (last edited 3 months ago) (1 children)

Oh interesting that Dreams has no errors. It seems like a really cool platform - there's a Dreams tech talk (about their SDF stuff) that I think I've watched 3 times at this point, at various times when playing with 3D/VR stuff. Pity that it's stuck on playstation only (IIRC).

I think to have no errors you need to have some really solid foundations that aim for that from the start. But I think I agree that data.prompt===undefined shouldn't necessarily imply that it's not a prompt object. Since e.g. when reference images are added you may only want to add a reference image. I'm a bit too tired to be changing code right now though, since this could have backwards compat problems. And either way it's not a huge deal now that I'm checking data.prompt===undefined instead of falsy. Can use input "" as prompt and you're good. Probably a safe way to fix this is to also check .referenceImage or whatever is also undefined when that's added, idk, too tired right now

[–] wthit56 1 points 3 months ago

I think that fix is fine for now, agreed.

The talk by Alex? Great one. There's a couple I think. He's amazing... (Casey Muratori has a really solid one on SDF too by the way.)

Yeah, PS4/5 only. And live support has ended sadly, though they've put things in place so the servers can stick around for a long time. (In theory.) I was so into that community and platform for a good few years (won some community awards for "most helpful", youtube channel teaching it, the only full documentation)... I just love helping people learn how to make stuff.

It falling apart was not good for me though, and I haven't looked at it since. Properly burned me out over time.

Perchance is certainly scratching that itch though. And the runner (you) is actually quick on fixing/changing things, and likes doing things for the benefit of the community. Mm (Dreams' devs) were owned by Sony and had a lot going on behind the scenes, so not so good on that front. Also though, I'm able to straight-up code my own tools others can directly use (with more depth than was possible on Dreams), so that's also cool 👍