Extensions/ComfyUI-SelfRefiningSamplerPlus
ComfyUI Extension

ComfyUI-SelfRefiningSamplerPlus

Enhanced Self-Refining Video/Image Sampler (arXiv:2601.18577) with interactive per-step substeps and perturbation strength editors plus pluggable base sampler.

By Alex240z·Created a day ago·Updated a day ago· 22
Alex240z/ComfyUI-SelfRefiningSamplerPlus
Nodes—
On cloudLocal install
Stars22
Updateda day ago
Readme

ComfyUI-SelfRefiningSamplerPlus

Enhanced Self-Refining Video/Image Sampler for ComfyUI based on Self-Refining Video Sampling (arXiv:2601.18577) and KJNodes' SamplerSelfRefineVideo.

Improvements

  1. Interactive 2D Per-Step Curve Editors

    • steps input: sets the X-axis step grid (0 .. steps-1) and discrete per-step bar/dot previews on both curves (runtime automatically adapts to the actual sigmas length).
    • Substeps Ratio Curve (0.0 to 1.0 ratio of max_substeps): visually shape how many Predict-and-Perturb (P&P) iterations run at each step, with shaded integer bars per step. Includes Paper, Early, Mid, and Flat presets.
    • Perturb Strength Curve (0.0 to perturb_strength_scale, up to 3.0):
      • 0.0: identity (skips refinement).
      • 0.0 – 1.0: variance-preserving noise mixing at fixed $\sigma$ ($\sqrt{1 - p^2},\epsilon_{\text{cur}} + p,\epsilon_{\text{rand}}$).
      • 1.0: exact paper full noise resampling at $\sigma$.
      • > 1.0: Restart-style sigma boost — resamples at $\sigma_{\text{eff}} = \min(\sigma_{\max}, \sigma \cdot p)$, denoises at $\sigma_{\text{eff}}$, and deterministically re-projects back to $\sigma$ along the ODE path.
      • Includes Full, Decay, Bell, and Ramp presets and a dashed 1.0 reference line when scale > 1.0.
  2. Pluggable Base SAMPLER Input (Defaults to Euler)

    • Connect any ComfyUI KSAMPLER (e.g. euler, heun, euler_ancestral, dpmpp_2m, dpmpp_2m_sde, res_multistep, er_sde) to the optional sampler input.
    • Zero wasted NFEs: the first model evaluation of the base sampler on a refined step reuses the already-computed refined denoised prediction.
    • Multistep history preservation: contiguous unrefined spans (where substeps = 0 or perturb strength = 0) are executed as a single call to the base sampler so multistep solvers keep their full derivative history.
  3. Paper-Faithful Uncertainty Masking & Broad Model Compatibility

    • Supports both l1_mean (Paper Eq. 10) and l2_norm (KJNodes) uncertainty metrics.
    • Auto-detects Flow Matching (CONST) vs standard diffusion (EPS/V_PREDICTION/EDM) noise scaling.
    • Supports NestedTensor latents as well as flat 3D joint audio/video latents (via optional latent input).