-
Notifications
You must be signed in to change notification settings - Fork 402
Add Timestep shift, SGM Uniform and Simple scheduler and support for NitroFusion #675
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
base: master
Are you sure you want to change the base?
Conversation
Tested simple in isolation, and it works 👍 |
|
||
result_sigmas.reserve(n + 1); | ||
|
||
int model_sigmas_len = TIMESTEPS; |
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.
trailing space
Please rebase and update this pr on master. It is not nice to test right now. I am currently trying to get sgm to work. :) |
fixes #198 |
I'll try to do it next week. I think the changes are small enough to be integrated into a single PR, but if that's not preferred, I can make a separate PR for the new schedulers and the timestep shift |
This PR adds support for the timestep-shift technique required for inference with NitroFusion models and Diff-Instruct* and other one-step models. It also adds support for two schedulers: SGM Uniform and Simple, because the existing scheduler, for a mysterious reason, fails at step 2 calculation and produces an output similar to step 1.
NitroFusion is one of the best models for single-step inference, making it useful for inference on compute-constrained devices like mobile phones or CPUs.
Example command:
./bin/sd -m nitrosd-realism_f16.gguf -v -p "cute cat" --cfg-scale 1 --steps 1 --timestep-shift 250 -H 1024 -W 1024 --seed 2024 --schedule sgm_uniform
The recommended timestep-shift values by the authors are 250 for NitroSD-Realism and 500 for NitroSD-Vibrant and 400 for Diff-Instruct*.
I created GGUF versions of NitroFusion that already include the fixed SDXL VAE, available for download here.
The authors mentioned it's possible to extract LoRA weights from these models and apply them to other checkpoints. I’ll try to do that in the future.
EDIT : Just add Diff-Instruct* GGUF
References:
Timestep-shift implementation: node.py
SGM Uniform: sd_schedulers
Simple: samplers.py