Nodes/ComfyUI-XJNodes/SUPIR Parameters
ComfyUI Node

SUPIR Parameters

Ramp the sampling knobs across a multi-pass upscale

By alexjx·Created 10 months ago·Updated 4 months ago· 0
SUPIR Parameters
    • control_scale_start
    • control_scale_end
    • s_noise
    • EDM_s_churn
    index
    iterations
    final_control_scale_start1.00
    final_control_scale_end1.00
    control_scale_step0.01
    final_s_noise1.003
    s_noise_step0.001
    final_EDM_s_churn3
    EDM_s_churn_step1

    SUPIR - the restoration upscaler from 2024 - has a distinctive way of working: it treats upscaling as a restoration problem, repairing compression, noise, and blur while it scales, rather than just sharpening pixels. The cost is that it's demanding - the reduced-VRAM config still wants 12GB for diffusion plus 16GB for the LLaVA captioning model - and its sampling controls are fiddly. SUPIR's control_scale and s_noise are the knobs that decide how hard it leans on the generative model, and they behave differently depending on how far along a multi-pass upscale you are. XJSupirParameters exists to compute those values for you, per pass, with the whole ramp described by a few inputs.

    Here's the problem it solves. A typical SUPIR workflow runs the upscaler in a loop over iterations, and the settings you want for an early, aggressive pass are not the settings you want for the final, refined one. Rather than hand-computing "what's the control_scale for pass 3 of 5," this node takes the final values you want and the step between passes, then works backwards from the final pass: the later the pass, the closer to your final_* values; earlier passes get values further away (ramped by the step). It does this for control_scale (the strength of the restoration guidance), s_noise (sampling noise), and EDM_s_churn (the EDM scheduler's stochastic churn), clamping everything to sane bounds.

    The interface:

    • index and iterations - where you are in the loop and how many passes total; index is typically your loop counter wired in.
    • final_control_scale_start / final_control_scale_end - the control scale you want on the final pass (default 1.0 each), with control_scale_step (default 0.01) as the per-pass decrement.
    • final_s_noise (default 1.003) with s_noise_step (default 0.001) - the sampling noise you want at the end and how it ramps.
    • final_EDM_s_churn (default 3) with EDM_s_churn_step (default 1) - the EDM churn and its ramp.
    • Outputs: control_scale_start, control_scale_end, s_noise, EDM_s_churn - the computed values for the current pass, wired into your SUPIR sampler nodes.

    Where it fits: honestly, only if you're already running a multi-pass SUPIR upscale with ComfyUI-SUPIR. If you run SUPIR once per image, this node's ramping is moot - you just set the values directly. But in an iterative loop where settings want to ease off toward the end, it replaces the arithmetic you'd otherwise do by hand, and it makes the ramp reproducible and tweakable from a few dials. It's a "helper for a workflow you've already built" node, not a node that builds the workflow.

    Install is the pack-wide routine:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alexjx/ComfyUI-XJNodes
    

    Restart ComfyUI, find it under sd (it's filed with the sampler categories), or use ComfyUI Manager and search "ComfyUI-XJNodes". No models, empty requirements.txt - the heavy lifting (SUPIR itself) comes from ComfyUI-SUPIR, which you'll need separately.

    Honest take: this is a niche helper from a personal-use pack, and the defaults encode one author's preferred SUPIR schedule. If you're new to SUPIR, you won't start here - you'll start with the defaults in ComfyUI-SUPIR and reach for this only when you're tuning multi-pass behavior and want the values computed instead of hand-written.

    Categorysd

    Inputs (9)

    NameTypeDefaultDescription
    indexINT
    iterationsINT
    final_control_scale_startFLOAT1.000–2
    final_control_scale_endFLOAT1.000–2
    control_scale_stepFLOAT0.010–1
    final_s_noiseFLOAT1.0031–1.1
    s_noise_stepFLOAT0.001-0.1–0.1
    final_EDM_s_churnINT30–40
    EDM_s_churn_stepINT1-40–40

    Outputs (4)

    NameTypeDescription
    control_scale_startFLOAT
    control_scale_endFLOAT
    s_noiseFLOAT
    EDM_s_churnINT