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?

  • @perchanceM
    link
    English
    13 months ago

    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.

    • @wthit56OP
      link
      English
      13 months ago

      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.

      • @perchanceM
        link
        English
        1
        edit-2
        3 months ago

        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

        • @wthit56OP
          link
          English
          13 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 👍