Nodes/ComfyUI-Apt_Preset/scheduler_manual_sigmas
ComfyUI Node

scheduler_manual_sigmas

Write your own sigma schedule as a math formula

By cardenluo·Created 2 years ago·Updated 22 days ago· 309
scheduler_manual_sigmas
  • model
  • SIGMAS
custom_sigmas((1 - cos(2 * pi * (1-y**0.5) * 0.5)) / 2)*sigmax+((1 - cos(2 * pi * y**0.5 * 0.5)) / 2)*sigmin
steps20
sgmfalse

Every named scheduler in ComfyUI's stock dropdown - karras, normal, beta, sgm_uniform - is just a formula that maps a step index to a noise level. This node exposes that formula directly: instead of picking a name, you write the math yourself. It ships with a real default rather than a placeholder, so you can see the shape immediately: ((1 - cos(2 * pi * (1-y**0.5) * 0.5)) / 2)*sigmax+((1 - cos(2 * pi * y**0.5 * 0.5)) / 2)*sigmin - a cosine-based blend between your model's max and min sigma, parameterized by y, which runs from 0 to 1 across the schedule.

This is a genuinely power-user node. If "the model card's recommended scheduler" already covers your needs, you don't need this - the value here is specifically for the cases the named list doesn't cover: replicating a schedule you saw described in a paper or a community post, blending two known shapes by hand, or just understanding what a schedule actually is by building one from scratch instead of trusting a name.

The inputs and outputs that matter

  • model (required, MODEL) - the formula needs your model's actual sigmax/sigmin bounds to evaluate against, so this node needs the model wired in directly rather than just its sigma range.
  • custom_sigmas (required, STRING) - your formula, using y as the normalized step position (0 to 1), plus sigmax/sigmin from the model. Edit the default expression or replace it entirely with your own.
  • steps (required, default 20, range 1–100000) - how many discrete sigma values to generate by evaluating the formula across the step range.
  • sgm (required, default false) - toggles sgm_uniform-style step indexing. This spacing convention matters specifically for distilled checkpoints: models trained against sgm_uniform (SDXL Lightning is the best-documented example) expect that exact indexing, and running them against a differently-spaced schedule produces the oversaturated, off look distilled models get when fed the wrong noise levels. Only flip this on if you know your model was trained expecting it.
  • Output: SIGMAS - feed straight into your sampler like any other scheduler node's output.

How to install it

Search ComfyUI-Apt_Preset in ComfyUI Manager, or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

install.bat covers Windows dependencies; on Linux or Mac, open it, read the pip installs, and run them yourself, or let ComfyUI Manager resolve anything missing on first load. No model downloads needed for the node itself - it operates on whatever model you already have loaded.

Common issues & troubleshooting

Formula errors or the node refuses to run. Check your expression only references the variables it actually has available (y, sigmax, sigmin, and standard math functions like cos/pi) - a typo or an undefined variable will fail rather than silently substitute a default.

Output looks wildly wrong compared to a named scheduler. Before assuming the formula is broken, visualize it - wire the output into scheduler_sigmas2Graph (also in this pack) and look at the actual curve. A lot of "this is broken" turns out to be "this is exactly what I wrote, and what I wrote wasn't what I meant."

Distilled model looks oversaturated or artifacted. That's the classic symptom of the wrong step-spacing convention for a distilled checkpoint. If the model card specifies sgm_uniform, make sure sgm is on here - writing a custom formula doesn't exempt you from matching the spacing convention the model was actually trained against.

Not sure where to even start writing a formula. Don't start from blank - start from this node's own default expression and change one term at a time, checking the graph after each change. Reverse-engineering a known scheduler's formula (Karras, beta) from its published definition and reproducing it here is a solid way to build intuition before inventing your own.

CategoryApt_Preset/chx_ksample/Scheduler

Inputs (4)

NameTypeDefaultDescription
modelMODEL
custom_sigmasSTRING((1 - cos(2 * pi * (1-y**0.5) * 0.5)) / 2)*sigmax+((1 - cos(2 * pi * y**0.5 * 0.5)) / 2)*sigmin
stepsINT201–100000
sgmBOOLEANfalse

Outputs (1)

NameTypeDescription
SIGMASSIGMAS