invoke-ai / InvokeAI

Invoke is a leading creative engine for Stable Diffusion models, empowering professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry leading WebUI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
23.44k stars 2.41k forks source link

Prompt Matrix / X/Y Plots #464

Closed RobertBolender closed 2 years ago

RobertBolender commented 2 years ago

Is your feature request related to a problem? Please describe. I'm disappointed when I want to iterate quickly on a prompt but I have to wait for the current generation to finish before I can edit the prompt just to change a few words or tweak a numeric setting.

Describe the solution you'd like I would love to be able to define a matrix of prompts in a single command in order to compare the results of different combinations of words and settings.

There is another project that built a web UI for stable diffusion with these features, with demos here:

https://github.com/AUTOMATIC1111/stable-diffusion-webui-feature-showcase#prompt-matrix Example prompt matrix: a busy city street in a modern city|illustration|cinematic lighting Becomes:

https://github.com/AUTOMATIC1111/stable-diffusion-webui-feature-showcase#xy-plot Example used:

Describe alternatives you've considered It might be possible to point that other repo at the scripts from this one, but I haven't looked to far into it. I ran through the initial setup instructions in the other repo and found that it is not set up for Apple Silicon yet.

Additional context I've been thrilled at the support for Apple Silicon in this repo. Thank you for sharing it with us.

smirnov-mv commented 2 years ago

You can create prompt matrix in file (https://github.com/lstein/stable-diffusion#reading-prompts-from-a-file): prompts.txt

"a busy city street in a modern city" -s50 -C7.5
"a busy city street in a modern city, illustration" -s40 -C11
"a busy city street in a modern city, cinematic lighting" -H768 -s100 -C13
etc

and run it: python scripts/dream.py --from_file=../prompts.txt

It's not ui feature, but i use this for large generations (about 100-200 images).

RobertBolender commented 2 years ago

reading-prompts-from-a-file

Nice! I can work with that. I might create a little TUI to help create that file for scripting.

wbecher commented 2 years ago

You can create prompt matrix in file (https://github.com/lstein/stable-diffusion#reading-prompts-from-a-file): prompts.txt

"a busy city street in a modern city" -s50 -C7.5
"a busy city street in a modern city, illustration" -s40 -C11
"a busy city street in a modern city, cinematic lighting" -H768 -s100 -C13
etc

and run it: python scripts/dream.py --from_file=../prompts.txt

It's not ui feature, but i use this for large generations (about 100-200 images).

As this is a really good solution, having the option to do the same thing on the webui would be great. I like the solution of using | to separate the differente options.

softyoda commented 2 years ago

I might create a little TUI to help create that file for scripting

If you implement your idea of| additive text|, sentence Please don't hesitate to share in this repo :)

lstein commented 2 years ago

I think the right thing to do is to write an external python script that will generate the prompt combos using the syntax you suggest. You could either write a prompts file with it, or pipe it to dream.py like so:

> python generate_prompts.py "a busy city street in a modern city|illustration|cinematic lighting" | \
    python scripts/dream.py --from_file -

I think this will work on Windows systems. Certainly would work on Mac and Linux.

Moving this idea over to Discussion.