Skip to content

aoleg/ComfyUI-SPEED

 
 

Repository files navigation

ComfyUI-SPEED

ComfyUI custom node, Forge Neo (sd-webui-forge-classic) extension, and SwarmUI extension for SPEED — Spectral Progressive Diffusion for faster sampling. Progressively expands the latent resolution during denoising, reducing computation while preserving visual quality.

Official code: https://github.com/howardhx/speed

Key references:

Workflow:

Workflow

Speed comparison (FLUX preset, default parameters)

SPEED sampler (this node) Baseline (euler sampler)
mode=delta_optimal model_preset=flux scales=0.5,1.0 delta=0.01 transform=dct base_sampler=euler

SPEED

20s
1.33x faster
Original

26.5s
1.00x

Usage (ComfyUI)

  1. Place this folder under your ComfyUI custom_nodes directory, then restart ComfyUI.
  2. Connect the Sampler SPEED (Spectral Progressive Diffusion) output to SamplerCustomAdvanced.

Usage (Forge Neo / sd-webui-forge-classic)

The same repo doubles as a webui extension — the shared math lives in speed_core.py, the webui integration in scripts/speed_forge.py.

  1. Place (or git clone) this folder under the webui extensions/ directory and restart the webui.
  2. Open the SPEED (Spectral Progressive Diffusion) accordion under the generation parameters and enable it.
  3. Generate. The sampler selected in the main Sampling method dropdown is used as the base solver; SPEED segments its sigma schedule and expands the latent at each transition.

Notes for the webui version:

  • Designed for flow-matching models (Flux, Wan, …) whose sigmas are in (0, 1]. eps-prediction models (SD1.x/SDXL) run but are unvalidated; in manual mode thresholds above 1.0 are accepted for such schedules.
  • Inpainting is automatically skipped (masks and inpaint image conditioning are tied to the full latent resolution).
  • The hires-fix pass is untouched unless "Apply to hires-fix pass" is checked.
  • Brownian-noise samplers (DPM++ SDE family) work, but their pre-built noise sampler is only used on the full-resolution segment; coarse segments fall back to the sampler's default noise.
  • The dwt transform needs the optional PyWavelets package (pip install PyWavelets into the webui venv); dct (default) and fft have no extra dependencies.
  • If a transition threshold is never reached (too few steps / too small delta), the console warns and the output stays at the coarse resolution — increase steps or delta.
  • Settings are recorded in the image infotext under the SPEED: key.

Usage (SwarmUI)

The same repo also works as a SwarmUI extension — the C# integration lives in SPEEDSamplerExtension.cs, and SwarmUI's portable ComfyUI backend runs the SamplerSPEED node from this repo.

  1. git clone this repo into SwarmUI's src/Extensions/ directory (e.g. src/Extensions/ComfyUI-SPEED/), then run SwarmUI's update script (or launch with launch-dev) so the extension compiles.
  2. In the Generate tab, enable Display Advanced Options, find the SPEED parameter group, and toggle it on. If the ComfyUI-SPEED node pack isn't installed on the backend yet, click the Install SPEED button inside the group (this clones this same repo into the backend's custom_nodes and restarts it).
  3. Generate. The main Sampler parameter is used as the base solver.

Notes for the SwarmUI version:

  • When SPEED is enabled, the main sampling node is rebuilt as a SamplerCustomAdvanced + SamplerSPEED graph. Swarm-specific sampler features — Variation Seed and tiled sampling — do not apply while SPEED is on, and live previews may behave differently.
  • Swarm-custom schedulers (align_your_steps, flux2, ltxv, ideogram4, ...) can't be rebuilt from stock Comfy nodes; SPEED falls back to simple for those (with a log warning). turbo, karras, and all standard Comfy schedulers are reproduced faithfully.
  • Masked generations (inpainting / regional masks) are automatically skipped, and the Refiner stage is untouched.
  • The base Sampler must be a k-diffusion sampler (Euler, DPM++ 2M, etc.). Exotic non-k-diffusion samplers (ddim, uni_pc, res_multistep) are rejected by the node with a clear error — pick another sampler.
  • The SPEED parameters are recorded in the image metadata like all Swarm params.

Inputs

Input Type Default Description
base_sampler combo euler Underlying ODE solver. Any comfy.k_diffusion.sampling sampler supported.
transform combo dct Spectral basis for expansion: dct (any ratio), dwt (2× only), fft (any ratio).
mode combo delta_optimal delta_optimal computes transitions from the power-spectrum preset. manual uses user-specified sigma thresholds.
model_preset combo flux Power-spectrum preset: flux, wan21, or custom (use spectrum_A / spectrum_beta).
scales string 0.5,1.0 Comma-separated resolution fractions ending at 1.0. e.g. 0.25,0.5,1.0.
delta float 0.01 Noise-dominated tolerance (Eq. 9). Smaller values delay transitions.
manual_sigmas string 0.85 Comma-separated sigma thresholds (one per transition). Used in manual mode.
spectrum_A float 203.615 Power-law amplitude (used when model_preset=custom).
spectrum_beta float 1.915 Power-law decay exponent (used when model_preset=custom).
seed int 0 Seed for spectral-noise padding at each transition.

delta_optimal mode (recommended)

Set model_preset to flux or wan21 and adjust scales and delta. Transition timing is computed automatically from the VAE power spectrum using Eq. 9 and Eq. 10 of the paper.

manual mode

Set mode=manual and supply comma-separated sigma thresholds in manual_sigmas (one per transition between adjacent scales). Sigma decreases as denoising progresses, so the first threshold should be larger than the last (e.g. 0.95,0.85 for three scales).

Credits & license

This implementation is based on and derived from the official SPEED repository by Howard Xiao et al.:

  • Official code: https://github.com/howardhx/speed (BSD 3-Clause)
  • Paper: Xiao, H., Chao, B., Yariv, L., & Wetzstein, G. (2026). Spectral Progressive Diffusion for Efficient Image and Video Generation.

Please see the original project page and repository for full authorship, details, and license information.

BibTeX

@article{xiao2026spectral,
  author    = {Xiao, Howard and Chao, Brian and Yariv, Lior and Wetzstein, Gordon},
  title     = {Spectral Progressive Diffusion for Efficient Image and Video Generation},
  year      = {2026},
}

About

ComfyUI Unnofficial Implementation of Spectral Progressive Diffusion for Efficient Image and Video Generation for Anima

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 80.7%
  • C# 19.1%
  • JavaScript 0.2%