On the ai-text-plugin
, there is a way to get the inputs that were sent to the AI using the onStart(data)
function:
onStart(data)
- the code you put in this will run at the start of the generation process. You can access the inputs being used withdata.inputs.instruction
,data.inputs.startWith
, etc.
I am wondering if we could also get the same for the text-to-image-plugin
?
It can be either on the onStart(data)
or on the onFinish(data)
in which we can get the inputs/static values that were used for the response of the AI e.g. data.inputs.prompt
, data.inputs.negativePrompt
, etc.
With this, some features that can be implemented is a local history of past generations, in which the previous inputs were temporarily stored in the storage (or on the local storage so even if the page reloaded, the history is saved), then the users can revisit the previous generations (I have set up something similar like this on my text to image generators but they have some hacks to work).
This is not really a priority but might be good to have. Thanks!
I’ve added onStart to my “advanced” plugin–thought you might be interested 😁
🔥🔥
I didn’t know there was an onFinish() callback on the settings itself–that’s useful! Looking at the plugin itself I can see it there.
I can’t find anything about onStart though. Is that still a thing?
I don’t think it was implemented. Only the
data.inputs
on theonFinish
was added.Oooh, in the post you were saying on the text plugin there is onStart, but there isn’t an onStart for image gen, weren’t you? Sorry, I misread that. 👍
Done! But I haven’t checked if it’s working yet - let me know if there are any issues.
Any way to get the ‘seed’ of the image as well. Currently, upon using
data.inputs.seed
it would return-1
if no seed is provided, although upon hovering (and clicking the ‘i’ icon) we can see the actual seed. Thedata.inputs.seed
works fine if we actually input the seed, but on the default/randomized seed, it just returns-1
.I was thinking this too…