SwD Preset Selector
This tiny node is just the numbers behind Yandex's scale-wise distillation
- img_size
- upscales
- SIGMAS
SwD - Scale-wise Distillation - is Yandex Research's take on fast few-step diffusion, published in March 2025. The headline claim: instead of distilling a model down to fewer steps at full resolution, you distill it to generate at a low latent resolution and then walk it up through intermediate scales, denoising a little at each one. You get roughly twice the speed of a full-res few-step model at comparable quality. And SwD Preset Selector is the part that hands the sampler its marching orders.
Here's the thing you should know before you get excited: this node does none of the interesting work. It's a preset dictionary with a dropdown. You pick SwD 8B, 6 steps, it returns three numbers/strings - a base image size, an upscale list, and a sigma schedule. That's it. No API, no model files, no compute. What makes it worth having is that those exact numbers are the ones the yandex-research team tuned, and if you mistype a sigma value the whole progressive schedule falls apart silently.
What it outputs and where it plugs in
The node has exactly one input - the preset dropdown - and three outputs:
img_size(INT) - the base latent resolution you start from. Wire it intoEmptySD3LatentImagefor both width and height.upscales(STRING) - a comma-separated list like"1.5, 2.0, 2.5, 3.0, 4.0". This feeds the scale-wise sampler's scale list.SIGMAS(SIGMAS) - a float tensor with the few-step timestep schedule (the list ends in0.0000because the last entry is the "denoise to nothing" step). This goes intoSamplerCustom.
In the pack's example workflow, img_size drives an EmptySD3LatentImage, upscales goes into a SamplerLCMScalewise sampler, and the SIGMAS feeds SamplerCustom. You still load the actual model yourself - the workflow uses a swd-large-6-steps.safetensors LoRA from yresearch on top of SD3.5 Large.
The one gotcha that actually matters
The preset labels are misleading in a way that will waste your time if you don't see it: the numbers don't actually differ between model sizes. "SwD 2B, 6 steps" and "SwD 8B, 6 steps" return identical values - same 256 base, same 1.5, 2.0, 2.5, 3.0, 4.0 scales, same sigmas. Same story for "SwD 8B, 4 steps" and "SwD FLUX, 4 steps", which both return 512 and 1.25, 1.5, 2.0. The 2B vs 8B vs FLUX label is a reminder of which model the schedule was tuned for (SD3.5 Medium, SD3.5 Large, or FLUX), not a different configuration. The real decision is 6 steps vs 4 steps - and that decision is made for you by which LoRA you downloaded. Use a 6-step LoRA with the 4-step preset and you'll get rough, half-cooked results.
Install
Trivial, because the node is trivial. Either grab it from ComfyUI Manager (search "SwD"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/YaroslavIv/comfyui_swd
Restart ComfyUI and it appears under the SwD category. There's no requirements.txt - it only imports torch, which you already have. The pack's README is short because there's genuinely nothing else to say.
The heavy part is the models, and the README won't warn you about that. To actually run the example workflow you need the SD3.5 Medium or Large checkpoint, the separate text-encoder files (clip_l.safetensors, clip_g.safetensors, t5xxl_fp16.safetensors), and the SwD LoRA from the yresearch HF account - the workflow has notes pinned on each loader telling you exactly which files go in which models/ folder.
When it goes wrong
Given the node is a dict lookup, if it errors, it's ComfyUI's fault, not this pack's - check your ComfyUI version. The failure you'll actually hit is a beautiful but wrong image: that's a mismatched LoRA/step preset, or a missing text-encoder file that silently degraded your prompt. If you switched between "8B" and "2B" presets and saw no change, that's not a bug - the numbers are the same; the difference lives in the LoRA you loaded.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| preset | COMBO | SwD 2B, 6 steps | 5 options: SwD 2B, 6 steps, SwD 2B, 4 steps, SwD 8B, 6 steps, SwD 8B, 4 steps, SwD FLUX, 4 steps |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| img_size | INT | — |
| upscales | STRING | — |
| SIGMAS | SIGMAS | — |