promptOptions.context Send in a JS object or a list as a context the prompt has access to. Perhaps options to overload the window (falls through to the window if a name isn’t found within the context), or completely contained (only things within the context can be accessed: avoids any name clashing issues).

image({ plain_object }) Allow a normal JS object to be used. Currently the plugin relies on list properties here and there, which means it breaks when a simple JS object is sent even if it has the same exact used properties.

As JS is used to create these images in a lot of generators, this would cut out the need for the engine to get involved and generate the promptOptions object at all. And the creator doesn’t have to worry about how the lists work to be able to use the image generator.

promptOptions.select() When a button is clicked to “select” a particular generated image’s settings… if there’s a .select() function available, call it with everything to do with that generation: prompt object, etc. Maybe if there is no such function, don’t show that button.

This could be used to set up the generator’s textarea and other options in whatever way the creator sees fit. Or even to use this function for any other thing.

We can sort of half do this by giving each generation an id, and adding our own button next to it. And I think we can get some sort of info about a generation from its iframe? Maybe? Not sure.

But anyway, this would be a simple way of reaching in and out of the generation iframes.

Show prompt while loading: and just an idea to show the text prompt/negative prompt while the image is loading. It’s useful as a creator/user to see what the prompt is that’s actually generated–and nip it in the bud if we can see it’s malformed or bugged in some way. Just an idea.

  • @wthit56OP
    link
    English
    1
    edit-2
    2 months ago

    Yes, exactly. I’ve actually been able to do this with just createPerchanceTree. They can probably mess with the window–that’s up to them. But at least they cannot access the main generator’s properties and such. And this also means you can give people full perchance coding abilities, without the requirement of only all-caps property names and polluting the window namespace and such.

    I’ve integrated it into my advanced text to image plugin :)

    • @perchanceM
      link
      English
      12 months ago

      Oh, nice! I might steal some of these ideas eventually ^^’