ComfyUI Node

k/x scheduler

The inverse curve for front-loaded denoising

By mfg637·Created 2 years ago·Updated about a year ago· 11
k/x scheduler
    • SIGMAS
    steps20
    sigma_max1.00
    sigma_min0.00
    k1
    a0.0
    b1.0
    x_abs_min_limit0.00
    y_abs_max_limit0

    The k/x scheduler generates sigma values from the function σ = k / x - a simple inverse (hyperbolic) curve, swept across a range you pick. Its personality is front-loading: as x approaches zero the curve blows up, which means the generated schedule packs its biggest jumps into one end of the run and then flattens out dramatically. If you've ever wanted "hit the structure hard early, then taper off to fine detail," this is the shape that does it natively.

    The display name is honest about the math - "k over x" - and the node is really just that formula plus the safety rails and rescaling that make it usable as a sigma schedule.

    How it works

    It walks x from a to b, computes k/x at each point, and rescales the result to land between sigma_min and sigma_max. Because 1/x diverges near zero, the node ships two guard rails to stop the math from doing something dumb:

    • x_abs_min_limit (1e-9) - the floor for |x|. If your x-window crosses near zero, x values get clamped to this magnitude instead of the curve exploding toward infinity (which would produce nonsense sigma values).
    • y_abs_max_limit (0.0) - an upper bound on the sigma output, and when it's above 0 it also back-calculates a corresponding minimum x so k/x can't exceed it. At the default 0 it's off.

    The k input scales the curve's steepness - higher k, taller and more aggressive inverse curve before rescaling.

    The inputs that matter

    • steps (20) - number of sigma values.
    • sigma_max (1.0) / sigma_min (0.0)` - endpoints. The 0–1 defaults again.
    • k (1.0) - curve steepness.
    • **a (0.0) / b (1.0)** - the x-window. Swapped if a > b`; error if equal.
    • x_abs_min_limit / y_abs_max_limit - the guard rails; only touch them if you're pushing x through or near zero.

    Output is a SIGMAS array.

    Install

    Part of ComfyUI-ScheduledGuider-Ext. ComfyUI Manager - search ComfyUI-ScheduledGuider-Ext - or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mfg637/ComfyUI-ScheduledGuider-Ext
    

    Restart ComfyUI. No models, no extra dependencies.

    Common issues

    The guard rails are there for a reason: if you set your x-window to straddle zero (say a = -1 and b = 1) with the limits at defaults, you're asking 1/x to pass through a singularity. The node clamps it rather than crashing, but the resulting curve is not what you want - keep the window away from zero, or raise x_abs_min_limit, unless you specifically want that pathological shape.

    And the standard pack caveat: 0–1 output is a fine CFG curve for a guider and a wrong-shaped schedule for a KSampler until you ScaleToRange it. Given how aggressively this curve front-loads, it's also a prime candidate for the "great on SD 1.5/SDXL, dicey on flow-matching" rule - flow-matching models prefer balanced schedules, and this one is about as unbalanced as they come.

    Categorysampling/custom_sampling/CFG-schedulers

    Inputs (8)

    NameTypeDefaultDescription
    stepsINT201–10000
    sigma_maxFLOAT1.000–5000
    sigma_minFLOAT0.000–5000
    kFLOAT10.5–5000
    aFLOAT0.0-5000–5000
    bFLOAT1.0-5000–5000
    x_abs_min_limitFLOAT0.001e-256–2
    y_abs_max_limitFLOAT00–5000

    Outputs (1)

    NameTypeDescription
    SIGMASSIGMAS