ZML_高级K采样器
The advanced sampler that also decodes and previews
- 模型
- 正面条件
- 负面条件
- Latent
- VAE
- 脚本
- LATENT
- 图像
- 生成信息
ZML_KSampler_Advanced (ZML_高级K采样器) is the "give me the full controls" version of the pack's sampler family. Where the plain ZML_KSampler covers the everyday seed/steps/CFG path, this one adds the levers people reach for when they're doing partial sampling - inpainting, two-pass refinement, denoise tricks - plus the same built-in live preview and A1111-style metadata that make the family worth using at all.
It's from ComfyUI-ZML-Image, zml-w's 160+ node pack, and it's the sibling of ZML_KSampler in the "sampler related" subcategory. Same ancestry, same borrowings (efficiency nodes for seed/preview, smZNodes for GPU noise, VideoHelperSuite for video preview).
How it works
It wraps the core sampling path with the four controls that define "advanced":
- 开始步数 / 结束步数 (start/end steps) - sample only part of the denoising schedule. Start at 0, end at 10000 (the default) and it runs the full range; set start > 0 to skip the early steps, or set a lower end to stop early. This is the lever for inpainting (where you only want the later, finer steps) and for "sample to 60%, then switch samplers" tricks.
- 添加噪波 (add noise) - enable/disable noise injection. Set to disable when the latent already carries the noise you want (e.g., a noised img2img latent from a prior step) so the sampler doesn't double-noise it.
- 返回剩余噪波 (return leftover noise) - when disabled, the sampler forces full denoise and returns a finished latent; when enabled, it stops mid-schedule and hands back a partially-noised latent for the next stage to continue. That's the "chain two samplers" mechanism.
- 随机种子 - same as the family's seed,
-1for random.
Then the family extras: 预览方式 (auto/latent2rgb/taesd/none) for live sampling preview, 噪波模式 (cpu/gpu) for GPU-side noise, 视频预览 + frame rate for watching frames accumulate, and the 脚本 input for the pack's ZML_SCRIPT nodes (dynamic CFG, extra noise, brightness/contrast, sharpen/blur applied mid-sampling).
The outputs that matter
- LATENT - the sampled latent (or the partially-noised one if you returned leftover noise).
- 图像 - a real decoded image only if a VAE is connected; otherwise a 1×1 placeholder. Connect a VAE to skip the separate VAEDecode.
- 生成信息 - the A1111-style parameter string the pack's save node reads for metadata. Same story as the plain sampler: your settings travel with the PNG.
Installing it
Pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-ZML-Image
restart ComfyUI, or ComfyUI Manager → search "ComfyUI-ZML-Image". No model downloads beyond the optional TAESD decoder for the taesd preview path.
Where people get caught
The start/end step defaults (0 and 10000) are designed to behave like the stock Advanced sampler's "full range," but the exact end cap matters: if you set 结束步数 below your actual step count, the sampler stops there and the output is deliberately unfinished. And the 图像 output's VAE dependency catches everyone once - no VAE, no image, no error. Finally, GPU noise mode changes the noise source, so a locked seed behaves differently between cpu and gpu - same as the plain sampler, worth remembering when you're trying to reproduce a result.
When you'd actually reach for it
When your workflow needs partial schedules - inpainting passes, sampler hand-offs mid-denoise, controlled img2img. If all you do is straight txt2img, the plain ZML_KSampler (or the stock one) is simpler and identical in results. This one earns its "advanced" name exactly when you're sampling in pieces.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| 模型 | MODEL | — | |
| 添加噪波 | COMBO | 2 options: enable, disable | |
| 随机种子 | INT | -1 | — |
| 步数 | INT | 20 | — |
| CFG | FLOAT | 8.00 | — |
| 采样器 | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| 调度器 | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| 正面条件 | CONDITIONING | — | |
| 负面条件 | CONDITIONING | — | |
| Latent | LATENT | — | |
| 开始步数 | INT | 0 | — |
| 结束步数 | INT | 10000 | — |
| 返回剩余噪波 | COMBO | 2 options: enable, disable | |
| 预览方式 | COMBO | auto | 4 options: auto, latent2rgb, taesd, none |
| 噪波模式 | COMBO | cpu | 2 options: cpu, gpu |
| 视频预览 | COMBO | disable | 2 options: enable, disable |
| VAEopt | VAE | — | |
| 视频预览帧率opt | INT | 81–30 | — |
| 脚本opt | ZML_SCRIPT | 添加额外噪波 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |
| 图像 | IMAGE | — |
| 生成信息 | STRING | — |