V-Sampler
A KSampler Advanced that does its math in Rust (and why you mostly don't need it)
- model
- positive
- negative
- latent_image
- latent
Here's the honest pitch before the marketing: V-Sampler (VatesAdvancedSampler) is a drop-in replacement for the built-in KSampler Advanced whose gimmick is that the boring-but-cheap parts of sampling - the sigma schedule, the noise, a poke at your GPU's memory - are written in Rust and compiled into a native extension. It looks, wires, and behaves like the sampler you already know. Whether it's better is unverified - it shipped in May 2026 with no community track record.
If you're a beginner who googled this because a workflow demanded it, relax: it takes the exact same inputs as KSampler Advanced and produces the same kind of output, so swapping it in changes nothing about how your graph thinks. It comes from the Vates family of packs (same author as the batch-loader), and its real niche is smoothing memory pressure in big multi-batch runs.
How it actually works
The node ships two halves. The Python half is a thin wrapper around Comfy's own comfy.sample.sample_custom - the same sampling loop the built-in SamplerCustom uses, with a callback injected at every step. The Rust half, vates_sampler_core, is a PyO3 extension you compile yourself with Cargo. It handles three things:
- Sigma schedules. It reimplements karras, exponential, and polyexponential schedules in Rust, mirroring Comfy's
k_diffusionmath and appending the zero-sigma tail likeBasicSchedulerdoes. Any other scheduler silently falls back tocomfy.samplers.calculate_sigmas. - Noise. It generates the initial latent noise with a PCG64 RNG in Rust, maps it to the GPU via NumPy →
torch.from_numpy- zero-copy and deterministic, decoupled from torch's RNG state. - The memory vacuum. Each step callback runs a
memory_monitor_tick(if you compiled NVML support) plusgc.collect()andtorch.cuda.empty_cache(). In a long run with a big batch, repeatedly clearing cached allocations smooths fragmentation and keeps high-batch workflows from OOMing.
What does this buy a normal user? Almost nothing you can see - the sampling math runs on the GPU regardless. The defensible wins are deterministic noise and the per-step cache cleanup in batch-heavy graphs.
The inputs that matter
Everything here matches KSampler Advanced, so a basic txt2img graph already looks familiar:
model,positive,negative,latent_image- wire them exactly like you would into any sampler.seed(0 to 2^64, default 0),steps(default 20),cfg(default 8.0) - the usual dials.sampler_nameandscheduler- 44 samplers and 9 schedulers, pulled straight from Comfy's ownSAMPLER_NAMES/SCHEDULER_NAMES.denoise(default 1.0) - for img2img / latent-restore work, same semantics as anywhere else.
The single output, latent (LATENT), plugs into VAE Decode like any sampler's.
Installing it (the part everyone misses)
ComfyUI Manager can find the pack, but Manager alone only gets you halfway. The real install is two steps:
- Get the Rust toolchain - the README points you at rustup.rs.
- Open a terminal in
ComfyUI/custom_nodes/ComfyUI-Vates-Sampler/dct-core/and runpython install.py. That shells out tocargo build --release, then copies the compiled.so/.pydnext to the node. Optional NVML monitoring:export VATES_SAMPLER_BUILD_NVML=1first.
Run install.py with the same Python interpreter ComfyUI uses - the script's own docstring stresses this, and it's the classic way to end up with a binary your ComfyUI venv can't import. Then restart ComfyUI; the first cargo build takes a while.
Gotchas and troubleshooting
- Missing Rust core = silently pointless. If
vates_sampler_coreisn't importable, the node doesn't crash - it logs a warning and falls back to Comfy's owncalculate_sigmasandprepare_noise. Net result: a KSampler Advanced clone with a cache flush. Not broken, but you installed a Rust toolchain for nothing. Check the console for the warning. - Nested tensors are rejected. A
NestedTensorlatent (from some video/tiled workflows) is refused with a clear error pointing you back to the built-in sampler node. denoisemust be positive. Setting it to 0 errors out, mirroring Comfy's ownBasicSchedulerrefusing an empty sigma sequence.- Batch over 9 logs a soft warning - aligned to the 9-slot Vates batch loader, not a hard limit.
- It needs a full ComfyUI tree. It imports
comfy.sample,latent_preview, andsampler_objectdirectly, so no stripped-down or rehosted ComfyUI.
My take: keep it in your pocket if you're running the Vates batch-loading stack and hitting VRAM walls at high batch counts - that memory vacuum is real. For everyone else, the built-in KSampler Advanced does the same job with fewer moving parts and zero compile time. Niche optimization tool, not a quality upgrade.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 8.00–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| latent_image | LATENT | — | |
| denoise | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |