Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
rmatif wants to merge 3 commits into leejet:master
base: master
Choose a base branch
Loading
from rmatif:sigmas
Open

Add Custom Scheduler #694

rmatif wants to merge 3 commits into leejet:master from rmatif:sigmas

Conversation

Copy link
Contributor

@rmatif rmatif commented May 27, 2025
edited
Loading

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....."

Step sigma_0 = 2.5 Default Scheduler
Step 1 sigma_on sigma_off

I've uploaded a SiDA model checkpoint if someone want to test : SIDA 1.5

stduhpf, Green-Sky, daniandtheweb, and vmobilis reacted with thumbs up emoji

std::vector<float> sigmas = sd_ctx->sd->denoiser->get_sigmas(sample_steps);
std::vector<float> sigmas_for_generation;
if (custom_sigmas_count > 0 && custom_sigmas != nullptr) {
Copy link
Contributor

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.

Copy link
Contributor Author

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

@rmatif rmatif requested a review from idostyle May 27, 2025 16:26
Copy link
Contributor

vmobilis commented Jun 1, 2025
edited
Loading

@rmatif, hello, maybe add very basic expressions support?
Like in rmatif#1?

(Sorry for making dummy PR, I couldn't find a better way to explain the changes). 😅

And thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@idostyle idostyle Awaiting requested review from idostyle

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /