-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Fix Karras scheduler doesn't start from the actual max to min #4373
Conversation
I am looking into various of the new samplers and try it in my https://github.com/liuliu/swift-diffusion There is this magical sigma_min / sigma_max for Karras scheduler seems a bit abrupt. Looking deeper into it, I believe that it is best to match the actual sigma max / sigma min used when training the model. That means for Stable Diffusion, it is the sigma at step 999 and at step 1. I switched to that value, and both DPM++ 2S Karras and DPM++ 2M Karras looks much more consistent between step 10, step 20, step 30 and step 40. I believe this is a good improvement and don't want to keep it secret only in my repo. I renounce all the copyright of this PR. Just merge it and fix it for everyone if people verified this is indeed a good fix.
Any info on the values of these for NovelAI leaked model? |
considering this will change existing seeds there should be some more demonstration/feedback from users over whether this really is better. |
I happened to be doing some image studies already when I saw this so I dove in to work out some prompts to try to stratify the difference a bit for inspection, keeping Euler and DDIM as a control. Subjectively it looks like you can still get fine results without the change but after the change the step differences could bit more linear as stated, which makes sense (if it aligns with the vanilla settings, taking OP's word for it). Dreambooth models seem to be exacerbated a bit more (last links below). I think even if you roll with this change, it seems like the stability/volatility these changes introduce probably make them a candidate for tweakable settings down the line, as per the house example, leaving the current settings in place can make the ancestral+Karras samplers extra wild, which is a feature to many. Before ChangeAfter ChangeCropped to Side-By-Side Karras OnlySettings
More ExamplesHouseHouse Painting 3847627383 NO CHANGE
DreamboothArcane v3 34854 NO CHANGE
|
@AUTOMATIC1111 I had posted this in my original PR that added Karras scheduler variants - its 'improvement' is a matter of preference TBH. Enabling quantization should alleviate the non-compliant sigma range (aka anything other than 0.03-14.6). If we insist on changing this, the range should be set as IMO minute tweaks like this are unnecessary (especially since it would break seeds) considering dfaker already has a script for this sort of experimenting. |
this is more a matter of taste then anything else, i prefer as it is right now. some of the other samplers already give the type of image, lets leave this one as is, diversity is good. |
Thanks for the feedback. My original motivation is to arrive at a stable diffusion result with lower step counts, and this sigma choice seems to do that (With this choice, I am consistently arriving at same results for DPM++ 2M Karras with 30 steps). But agreed with other concerns. |
Per the Thor test images I posted, I'd be interested to see examples of convergence being worse, I'd echo the OP's point that anecdotally results have been equivalent or better.
When I tested this quantization didn't have any effect (assuming you're talking about the toggleable option), other than the micro effects it has always had (a tree leaf goes appears or disappears etc, nothing structural or about the convergence) |
Is it possible to add some settings for sigma_min or sigma_max? |
@kjerk Here's a example: #1560 (comment) Now, I don't know if it's worse, but it is certainly very different from the SD scheduler version. |
I think this is a very solid point, more significant settings, the merrier |
I am looking into various of the new samplers and try it in my https://github.com/liuliu/swift-diffusion
There is this magical sigma_min / sigma_max for Karras scheduler seems a bit abrupt. Looking deeper into it, I believe that it is best to match the actual sigma max / sigma min used when training the model. That means for Stable Diffusion, it is the sigma at step 999 and at step 1.
I switched to that value, and both DPM++ 2S Karras and DPM++ 2M Karras looks much more consistent between step 10, step 20, step 30 and step 40. I believe this is a good improvement and don't want to keep it secret only in my repo.
I renounce all the copyright of this PR. Just merge it and fix it for everyone if people verified this is indeed a good fix.