Nodes/ComfyUI-Switti/Switti Sampler
ComfyUI Node

Switti Sampler

Autoregressive, so there's no steps slider

By RyukoMatoiFan·Created 8 months ago·Updated 8 months ago· 0
Switti Sampler
  • switti_pipe
  • IMAGE
positive
negative
cls_guidance6.0
top_k_sampling400
top_p_sampling0.95
seed-1
more_smoothtrue
smooth_start_si2
turn_on_cfg_start_si0
turn_off_cfg_start_si11
last_scale_temp0.10

Here's the node where Switti actually happens - and the first thing to get your head around is that it doesn't work like any sampler you've used. There's no steps slider, no CFG in the KSampler sense, no denoising strength. Switti is an autoregressive text-to-image model: it generates an image by predicting token maps scale by scale, from a tiny 1×1 map up to the full resolution, sampling each scale's tokens with top-k/top-p. Yandex built it on the VAR/STAR line of work specifically to beat diffusion on speed - their launch claim was up to ~7x faster than SDXL - and the community's verdict at release was "incredible speed, quality a bit rough." Worth a weekend of play, not a daily driver.

The pipeline internals (worth knowing because they explain the weird inputs): for each scale stage si, the transformer produces logits over the VQVAE's 4096-token codebook. With CFG active, the prompt and null-prompt branches run in one batch and are mixed with a weight that ramps up across stages - t = cls_guidance × (si / last_stage). The sampled token ids get embedded through the codebook and fed into the next scale, and at the very end the accumulated features decode to a finished image. There are 10 stages at 512 and 14 at 1024, which is why "resolution" on the loaders matters so much.

Inputs, in the order you'll care about them:

  • switti_pipe - the SWITTI_MODEL from Build Switti Pipeline. Non-negotiable.
  • positive / negative - plain text, not CLIP-conditioned. The pipeline encodes both internally (that's what makes the CFG branches). Negative prompts are real here, unlike in some newer flow-matching models.
  • cls_guidance (default 6) - the CFG scale. Since it ramps across stages, this is a coarse dial, not a fine one.
  • top_k_sampling (400) / top_p_sampling (0.95) - the nucleus sampling controls. Lower top_k for more conservative, less chaotic outputs; raise it and things get weirder.
  • seed (default -1) - -1 means random; set a number to reproduce a result.
  • more_smooth (default on) - switches from plain nucleus sampling to gumbel-softmax smoothing. The Switti authors use this for visualization; the code comments note it's not what they use for FID/quality benchmarks. If you find outputs noisy, this is the first lever to pull.
  • smooth_start_si (2), turn_on_cfg_start_si (0), turn_off_cfg_start_si (11), last_scale_temp (0.1) - these count stages, not steps. The defaults are clearly tuned for the 14-stage 1024 config: at 512 (10 stages) turn_off_cfg_start_si of 11 is past the last stage, so CFG stays on the whole way and last_scale_temp never engages. Leave them alone until you're comfortable.

The output is IMAGE - a finished RGB tensor, not a latent. Do not add a VAEDecode node after this; there's nothing to decode, and it will fail. The sampler decodes internally and you wire straight to SaveImage or a preview. For anyone who came from SD that's the sneakiest trap in the pack: the graph ends with the sampler.

Install is the pack standard - ComfyUI Manager → search "ComfyUI-Switti", or:

cd ComfyUI/custom_nodes
git clone https://github.com/RyukoMatoiFan/ComfyUI-Switti

then restart. If imports fail, the pinned deps in the vendored switti/requirements.txt (transformers==4.45.2, diffusers==0.31.0, huggingface_hub==0.26.2, torchvision==0.19.1) are the likely culprit - newer ComfyUI environments may need pip install -r switti/requirements.txt.

Troubleshooting flow: sampler complains about switti_pipe → you forgot Build Switti Pipeline. Result comes out visually noisy → raise more_smooth (already on), or lower top_k_sampling. Generation that won't reproduce → set seed. And if you're on a 512 workflow wondering why last_scale_temp seems to do nothing - that's not a bug, that's the stage-index defaults being built for 1024.

Categorygenerators

Inputs (12)

NameTypeDefaultDescription
switti_pipeSWITTI_MODEL
positiveSTRING
negativeSTRING
cls_guidanceFLOAT6.01–30
top_k_samplingINT4001–500
top_p_samplingFLOAT0.950–1
seedINT-1-1–9223372036854776000
more_smoothBOOLEANtrue
smooth_start_siFLOAT20–100
turn_on_cfg_start_siFLOAT00–100
turn_off_cfg_start_siFLOAT110–100
last_scale_tempFLOAT0.100–1

Outputs (1)

NameTypeDescription
IMAGEIMAGE