-
Notifications
You must be signed in to change notification settings - Fork 424
Add Custom Scheduler #694
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
Add Custom Scheduler #694
Conversation
stable-diffusion.cpp
Outdated
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.
Could extract this block into a method and share it between txt2img
, img2img
and img2vid
. txt2img seems to have additional logging the other two are missing.
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.
@idostyle thanks for the review. I’ve extracted the sigma preparation into a shared helper, you're right, it's better for maintainability
Uh oh!
There was an error while loading. Please reload this page.
Inspired by https://github.com/BlakeOne/ComfyUI-CustomScheduler
318997896-c5c258ec-49ba-4062-a3aa-9d019d693bfd
This PR adds a custom scheduler that allows users to manually specify the sigma values for each step.
This is especially useful for debugging when integrating new models that don't work with existing schedulers, or for inference with distilled models such as SID, SIDA or SwD
The number of sigma values must match the number of steps. If n_sigmas < steps, the missing values will currently be filled with zeros. I'm considering whether to keep this behavior or instead repeat the last sigma value to fill the vector.
Example command:
./build/bin/sd -m SiDA_SD15_4.54.54.5_1_lsd100_lsggan0.001_NoEMA_SNR_025634_checkpoint.safetensors -v -p "A photograph of a cat in winter wonderland. 8k resolution" --cfg-scale 1 --steps 1 --sigmas "2.5" --seed 2025
For multi-steps, use for example
--sigmas "sigma_0,sigma_1,sigma_2,sigma_3....."
I've uploaded a SiDA model checkpoint if someone want to test : SIDA 1.5