-
Notifications
You must be signed in to change notification settings - Fork 2.8k
support generating variations #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
How the prompt must look to create a variation of the variation? This way? If yes - then it's much more complex to use than in my version of code (where a tensor file is saved next to image). If creating variations is indeed so complex (from end users POV) in this PR I propose to automatically read metadata from PNG file to free the users from typing unnecessary details. |
Yes, that's what it looks like. You don't need to type it out by hand, though; the log message will print exactly the command you need to run to recreate the image, so you just copy-paste that and add I agree it would be nice to also support reading metadata from an existing image to create variations, but that can happen in a followup. |
4171b9f to
3acb859
Compare
Co-authored-by: xra <mail@xra.dev>
|
@lstein I've rebased this and changed it to target the |
|
I'm testing this out now. Is there any reason that the syntax for --with_variations can't be seed:weight,seed:weight, rather than seed,weight;seed,weight? The former would be more consistent with how we do weighting in the prompt. I care more about the colon than the semicolon. |
Nope, that should work fine. I was thinking of these as lists-of-lists and I reach for semicolons in that case, but you're right that colons would be better to match prompt weighting. I can fix that up if you'd like, or you can do it as you merge. |
|
I'm about to knock off for the day. In a couple minutes I'll commit the PR to development, along with a little walkthrough/cheat-sheet that I wrote as I was testing. If you don't mind doing a new PR off of dev which swaps the commas for colons and the semicolons for commas, that would be great. There also need to be corresponding changes to the normalized prompt generator and probably the accompanying help text. I'm a little uncertain about the extended syntax for -V when you combine variation weighting with variation strength and don't want to meddle with that. This is a truly wonderful feature! I could play with it all day. I bet we could do something amazing with the web interface too, like dragging and dropping one image on top of another. |
lstein
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very happy to see this go in.
|
How does this feature work? Are there examples? |
|
@magnusviri There's a helpful readme written by @lstein. You can find some more examples of its outputs here or here (second link is a different repo but it works the same way). |
|
I have note tested this feature yet, just wanted to confirm another use case.
This prompt in unreal to construct. Why not store next to each image a |
Yes.
You aren't expected construct it; you just copy-paste it from the log message or the image metadata.
Well, to each their own, but personally I would find having to keep track of an additional file much, much more annoying than simply copy-pasting the log output, especially when trying to share things. |
This is a continuation of #184 (and replaces that PR). I've credited @xraxra in the commit.
It adds two new flags:
-v 0.1, which generates variations with a specific strength (as in the above PR)-V 1437160019,0.1;873874780,0.05, which takes a list of seed,weight pairs used to apply variations (and must be combined with--seed)You use the first flag to generate variations, and the second to reproduce them - including as input for further variations; this supports creating variations of variations, so you can wander around the space in multiple steps.
Also, I've extended it to support img2img mode, so that you can use the same flow as with txt2img: run with
prompt --init_image=whatever.png -n 10to generate ten initial candidates, pick the one you like best, then generate ten variations of that one by doingprompt --init_image=whatever.png --seed=NNNNN -v 0.1 -n 10(and, since you can do variations-of-variations, iterate as many times as you like).Variations contain in their metadata (and stdout/dream_log.txt) the full command necessary to reproduce them precisely (assuming you use the same model/embeddings/init_img/etc, of course).
This doesn't support the web UI. Something to work on in a later PR. Also, the logic for generating metadata in dream.py is getting a bit convoluted, but that's something I'd like to work on anyway, again in a later PR.
To reproduce the
--target_seedfunctionality from the original PR, you can use the-Vswitch:-v 0.1 -V NNNNNfrom the original PR is equivalent to-V NNNNN,0.1in this PR.