Z-Sampling Settings
The four knobs that make the zigzag zigzag
- z_settings
This node does nothing on its own, and that's the point. It's a config bundle: four numbers in, one z_settings object out, meant to be wired into the optional z_settings input on Z-Sampler (Zigzag) from the same pack. If you never add this node, Z-Sampler still works - it just runs with defaults. You only reach for the Settings node when you want to actually tune the zigzag, which you will once you see how much time it costs.
The four knobs
gamma_1(default 5.5) - the CFG scale used on the forward denoise legs. This is your "strong guidance" dial, roughly what you'd normally type into a KSampler's CFG.gamma_2(default 0.0) - the CFG scale for the inversion legs, the part where the sampler walks back up the noise ladder. The default of 0 (no guidance) is the sane one; this is where you're deliberately letting the model drift so the next denoise pass has something to correct.lambda_step(default -1) - how many of the leading steps get the full zigzag treatment.-1means auto, which resolves tosteps - 1, i.e. every step except the last. Lower it to apply the loop only to the early, high-noise steps.t_max(default 1) - zigzag rounds per step. This is the real quality/speed dial. Each round is two extra model evaluations, sot_max = 2roughly triples per-step compute on the zigzag steps. The tooltip's honest about it: more rounds, slower but better.
The only output is z_settings, a ZSETTINGS bundle you plug into Z-Sampler's z_settings socket.
How it interacts with Z-Sampler
Two things worth knowing so you don't fight the node:
- When you wire a settings bundle in,
gamma_1takes over the Z-Sampler'scfginput for the denoise legs. Whatever you left in the sampler's own CFG box stops mattering. lambda_stepandt_maxdefine where the extra compute goes. At defaults (auto lambda, t_max 1) a 30-step sample is already doing ~three model passes per step. Pusht_maxto 2 and you're paying for it.
Tuning without rage-quitting
Start from the defaults. Change one thing at a time: raise t_max to 2 if you want to feel the quality bump and you're not GPU-constrained. Leave gamma_2 at 0 until you understand the mechanism - cranking it re-injects real noise into the inversion legs, and on most models that just costs you quality for a sampler that's already slow. If you're on Anima (the pack's home turf, Cosmos-based with 16-channel latents), the author's one piece of workflow advice applies: feed Z-Sampler an Empty Cosmos Latent Video of length 1.
Install
Same pack as Z-Sampler, so if you have that node you already have this one. Otherwise: ComfyUI Manager → search "Comfy_z-sampling" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/sal063/Comfy_z-sampling
Restart, and look under sampling → z-sampling in the node menu. No extra dependencies, no model files, nothing to download. Given the whole pack is one Python file, there isn't much to break - and if this settings node misbehaves, remember you can just delete it and let Z-Sampler fall back to its defaults.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| gamma_1 | FLOAT | 5.51–30 | CFG scale for denoising steps (strong guidance) |
| gamma_2 | FLOAT | 0.00–15 | CFG scale for inversion steps (weak/no guidance) |
| lambda_step | INT | -1-1–500 | Steps with zigzag optimization. -1 = auto (steps-1) |
| t_max | INT | 11–10 | Zigzag rounds per step. More = slower but better quality |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| z_settings | ZSETTINGS | — |