XB-BOX - 自定义采样器(原版优化)
XB_ROCmSamplerCustom is just ComfyUI's SamplerCustom with a cleanup switch
- model
- positive
- negative
- sampler
- sigmas
- latent_image
- output
- denoised_output
Let's get the awkward thing out of the way first: despite the "ROCm" in its name, this node has nothing AMD-specific about it. Pop the hood and it's a thin wrapper around ComfyUI's own SamplerCustom - same inputs, same outputs, same sampling math. The only real addition is a cleanup dropdown that runs a bit of VRAM housekeeping before sampling starts. That's it. The ROCm prefix is legacy branding from the pack's earlier AMD-focused days, kept alive so old workflows keep loading.
XB_ToolBox calls this family "原版优化" - "vanilla optimized" - and that's an honest description. The pack's own source says it calls the official node "verbatim, zero parameter changes," and just injects a graded memory cleanup in front of it. So if you already know SamplerCustom, you know this node. If you don't, this is the flexible "bring your own schedule" sampler: instead of picking sampler + scheduler inside one box, you feed it a SAMPLER object (from SamplerSelect) and a SIGMAS schedule (from BasicScheduler, KSamplerSelect, or a sigma node) and it runs whatever combination you've wired.
The inputs that matter
The ones you'll actually touch on a beginner workflow:
- model - the patched model from your loader.
- positive / negative - your conditioning.
- sampler and sigmas - the custom pair that's the whole reason to use this over a plain KSampler. Wire a
SamplerSelectintosamplerand aBasicSchedulerintosigmas. - latent_image - your starting latent.
- add_noise / noise_seed / cfg - same meaning as the built-in sampler.
cfgdefaults to 8, which is a DDPM-era default; on flow-matching models like Z-Image the KB's own advice is that CFG 1 is the real default (guidance baked into the weights), so don't trust the 8 blindly. - cleanup - the pack's four-level ladder: no cleanup, single cache cleanup (
soft_empty_cache+empty_cache), unload models to system RAM, or unload everything including a fullgc.collect(). Default is no cleanup.
The two outputs
output is your finished latent - wire it to a VAE Decode. denoised_output is the latent as it stood one step before the final noise removal; it's for the advanced trick of refining at the end without re-running the whole schedule. Most people never use it.
Install and gotchas
Installing XB_ToolBox: ComfyUI Manager, search XB_ToolBox, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/wjluoxiao/XB_ToolBox.git
Then restart ComfyUI. Two gotchas worth knowing. First, the README claims "no extra pip dependencies required" - that's true for this node specifically (it's pure ComfyUI core), but the pack ships a lot of other nodes that do need heavy deps like easyocr, onnxruntime, and llama-cpp-python; they fail to register on their own rather than breaking this one. Second, the node only registers when comfy_extras.nodes_custom_sampler is importable - which every modern ComfyUI has. On ancient builds you'll see it missing.
Honest verdict: if you're on a low-VRAM card and you're chaining many heavy steps, the cleanup dropdown is a genuinely handy convenience. Everyone else can treat this as "the familiar SamplerCustom, from a pack that's trying to be your one-stop shop."
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| add_noise | BOOLEAN | true | — |
| noise_seed | INT | 00–18446744073709550000 | — |
| cfg | FLOAT | 8.00–100 | — |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| sampler | SAMPLER | — | |
| sigmas | SIGMAS | — | |
| latent_image | LATENT | — | |
| cleanup | COMBO | 不做任何清理 | 4 options: 不做任何清理, 单次缓存清理, 卸载显存模型, 卸载全量模型 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output | LATENT | — |
| denoised_output | LATENT | — |