AmericanPresidentJimmyCarter / yasd-discord-bot

Yet Another Stable Diffusion Discord Bot
MIT License
112 stars 15 forks source link

[Feature Request] Button to rerun image command with new seeds #27

Closed aaronsantiago closed 2 years ago

aaronsantiago commented 2 years ago

Title. All the parameters should be the same but we should be able to run it again to see more variations.

It would be nice if the same button existed on riffs as well to create more riffs from the same base image.

AmericanPresidentJimmyCarter commented 2 years ago

I don't see why this can't be done, but it requires saving more of the parameters used to create the image in dalle-flow to be the easiest to implement. I want to start storing the conditioned latents, when I do that MR I can add the other parameters maybe?

aaronsantiago commented 2 years ago

Not sure what conditioned latents means--would that mean saving some part of the prompt to increase the speed of regenerations?

This could be related to the other request of tying the full prompt to each generation in addition to the ID. In my mind, functionally what I want is to automatically have it type in the exact same command, just with the seed changed if there is one.

I could envision getting this feature (and displaying the prompt for each run) by having a dictionary holding each run's parameters, and simply rerunning the command with the same parameters if requested.

AmericanPresidentJimmyCarter commented 2 years ago

As I understand it prompting goes prompt -> tokens -> embeddings -> conditioned latents, then the conditioned latents are used to generate the image. Interpolate just does spherical interpolation of the conditioned latents. If the conditioned latent was re-supplied on riff you could avoid computing it again, not that it's very expensive, but it is some time and memory.

In tags we could json.dumps the parameters to string so that that every Document has the parameters used to generate the image through the API in tags. Documents are stored by the bot in the docarrays folder, so you could get that information from there.

AmericanPresidentJimmyCarter commented 2 years ago

Okay, I'll probably add this to dalle-jina soon (store all parameters and latent conditioning), after that I can add a "reroll" button.

aaronsantiago commented 2 years ago

Ah doing that in dalle flow definitely seems like a better solution. I'll hold off trying to hack JSON storage into yasd 😅

AmericanPresidentJimmyCarter commented 2 years ago

Fixed on develop, waiting for dalle-flow to be synced to merge.