-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
provide an option so hires fix uses the final step (sort of) of the prompt schedule #12350
provide an option so hires fix uses the final step (sort of) of the prompt schedule #12350
Conversation
…edule, instead of repeating the whole schedule But actually it special cases [foo|bar] style prompt editing; if you have one of those active at the final prompt step, it will be preserved for hires fix as well, so hires fix will alternate
This comment was marked as outdated.
This comment was marked as outdated.
I think they made this PR so it interops with wildcard extensions. They mentioned the separate hires prompt already.
|
didn't understand that first time reading I guess it's makes sense |
In fact, #9281 was the discussion I mentioned in the PR that I could no longer find; I've updated the PR correspondingly, thanks. |
ya lol, I think the reply was literally the first thing I did when I woke |
Would a more flexible solution be to assume that hires fix's steps start at 1.0 and end at 2.0 for prompt editing? |
That definitely sounds more flexible to target from a dynamic generator, for example, and as far as I can see should absolutely address all the issues in this PR. It already will save/restore to pnginfo correctly, and doesn't need any config. And I've seen people posting issues or discussions where it seemed like this is the behavior they expected. But it will totally change the reproducibility of hires fix images unless it's on a toggleable option. And I think it will change output for some non-hires fix prompts as well, unless I'm missing something. The current code is:
I see two options for changing the
Of course of necessity both of those methods will break old prompts using say |
The old compatibility mode will work just like before, the new will interpret <2 as ratio always and >=2 as abs number of steps. |
|
By old compatibility mode I mean a checkbox in settings. |
That's my preference, but it's your project, it's absolutely your choice, I'm happy to implement whatever you like. |
No, no , let's do it your way, with integers/floats distinction. The only thing is there should be compatibility mode for reproducing old pics. |
Status update: I have a patch that does the "1.0 - 2.0" thing but I want to use it in the wild for a little, when I make a PR for it, I will close this PR. |
Can you elaborate what happens with hires fix now? if 1.0-2.0 is the hires step range, does that mean [cat:frog :0.5] swaps in the middle of the initial gen while hires stays at frog? So, to emulate the old behaviour you would need to do something like [[cat:frog :0.5]:[cat:frog :1.5]:1.0]? |
Yes. There's a compatibility switch to emulate the old behavior if you need to make old images work, but if you don't want to leave it switched on, yes, you'd have to do something like that to get the same effect as before. (I'd suggested we could make it so copying the prompt into the hires prompt would have the old effect, but Auto1111 preferred that the hires fix range in the hires prompt still be 1.0-2.0, so that's no help.) I'd be interested to know what kind of workflows or scenarios you have where you'd prefer that behavior, just so I can keep it in mind. |
Initially I was a bit against it since it's a bit unintuitive behaviour, but I like it since I can use a prompt preprocessor extension to do kinda like
This would be the case for styles/embeddings for example. If I found that [style1:style2:0.6] results in a nice combined style, I would want the hires fix to replicate it as close as possible, and it would be the expected behaviour since hires is basically "do that again but more resolution". Doing just style2 in the hires part will most often than not remove the look of style1 especially on higher denoise. Another thing that crossed my mind was about the disparity of percentage and steps in this pull request. Percentage is being set as 0.0-2.0, but as I understood it, setting 10 steps still works as an edit at 10 in both base and hires. It would make sense to do the same "overflow" with steps as with percentage to remain consistent: With 50 steps in base and hires, setting 10 only edits base, while 60 edits hires at step 10. |
Thanks for explaining the scenario. And yes, it does the same overflow in the sense that, if you have 50 steps in base and 20 steps in hires, |
It would make sense to make it available as PR for people who want to test it out and tell you about if it works or not. |
Ok! Superseded by #12457. |
Description
The UI option for this is not in the right place, please tell me where to put it.
when using prompt editing, sometimes you don't want the hires fix to apply the full prompt editing schedule, you just want to continue refining the final result using the final editing state of the prompt
[something that sets up the composition:something that produces the real result:0.35]
, then during the hires fix pass, you really only want the hires fix to usesomething that produces the real result
, you don't want it to go back temporarily and applysomething that sets up the composition
for a while[foo|bar]
so it still happens during highres fix, but only if it was active at the final step. so[[foo|bar]::0.5]
is treated as[[foo|bar]:0.5]
is treated as[foo|bar]
a summary of changes in code
get_learned_conditioning_prompt_schedule
takes a new "use final state" boolean parameter that causes it to produce a "final state" schedule by only ever generating the "after" of ascheduled
expressionget_conds_with_caching
takes an optional "use final state" parameter and includes it as part of the cache keyAddresses A patch to stop prompt editing in hires fix, so that it uses the prompt as it is at the final step of the initial render #9281, but in a more sophisticated way
Things that maybe should get changed before this is merged
get_learned_conditioning_prompt_schedule
defaults toFalse
so extensions calling it won't break. But I didn't do that forget_conds_with_caching
, should I?Screenshots/videos:
The effect is not easily discernable in normal use, so I just made some exaggerated examples with the hires fix denoising set to 0.8, scale=1, so that the hires fix pass basically recomputes the whole image, just so you can see the effect happening.
The prompt is
[man on a street:woman in a forest:0.99] with a [cat|cow|sheep|horse]
. The expected behavior is that the old code will produce a man on a street, and the new code will produce a woman in a forest, and that we get a cat-cow-sheep-horse regardless, and not just a horse (which would happen if we naively just used the final prompt schedule step).before hires fix:

hires fix before this change:

hires fix with the option provided by this PR enabled:

I put the UI option to control it here with the other hires fix options, but this is actually the User Interface options panel, and this option is not User Interface, so this doesn't seem like the right choice. (None of the options panels really seemed like a good fit, and at least here it's next to some related choices.)
Checklist: