ROCm SamplerCustomAdvanced
The SamplerCustomAdvanced drop-in that actually tunes the ROCm backend
- noise
- guider
- sampler
- sigmas
- latent_image
- output
- denoised_output
ROCm SamplerCustomAdvanced is the pack's flagship, and the one node here that's more than a reskin. It's a drop-in replacement for ComfyUI's V3 SamplerCustomAdvanced - the same noise, guider, sampler, sigmas, latent_image interface - with real work happening under the hood: architecture-aware ROCm backend tuning, emergency memory cleanup for the big latent formats, an honest progress callback, and a flash-attention override that exists because "illegal memory access" is a phrase every LTX-on-AMD user has met.
It lives in ROCm Ninodes/Sampling. If you've built a custom-sampler workflow (guider + sampler + sigmas wired into SamplerCustomAdvanced), swap the node and keep every wire.
How it works
This is built on ComfyUI's new define_schema() API rather than the old class-style interface, so it speaks the same protocol as the modern stock node. The sampling call itself is stock guider.sample - same numerics, so you're not getting a different image. What it adds is everything around the call:
- It detects your GPU architecture and applies the pack's ROCm backend settings - fp16 accumulation enabled where safe, TF32 left at ROCm default after earlier versions found forcing it off made LTX DiTs ~2x slower.
- Flow-matching and high-memory models (LTX's 128-channel latents have a memory factor over 5×) trigger a pre-sample emergency cleanup.
- It checks VRAM before starting and warns you when you're under ~2 GB free, with specific suggestions (disable CacheDiT, drop
--reserve-vram, cut frames). - Video latents (5D with more than one frame) are auto-detected and skip previews; stills get a live preview.
- The flash_attention switch is the interesting one:
disable_flashforces math/efficient SDP and fixes illegal memory access crashes on some ROCm models;force_flashprefers flash with fallbacks kept alive.
Inputs and outputs
The five required inputs are the stock set - noise, guider, sampler, sigmas, latent_image. You'll only touch the two optional toggles:
- compatibility_mode - skips every ROCm optimization and behaves purely like stock. The first thing to try when you suspect the tuning, not your workflow, is the problem.
- flash_attention (auto) - reach for
disable_flashif sampling crashes on AMD.
Outputs are output (the sampled LATENT) and denoised_output (the model's predicted clean latent) - wire them like you would with stock.
Installing it
Part of ROCm Ninodes: ComfyUI Manager, search rocm-ninodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/iGavroche/rocm-ninodes.git
then restart. v1.x installs run uv run python tools/upgrade_to_v2.py first. Dependencies are light (numpy, Pillow, psutil, gguf, safetensors); the real requirement is a ROCm PyTorch build. The README notes you need ComfyUI's V3 sampler core for this node's interface.
The honest version
This is the node the pack's changelog has been fighting about for months - temporal seams, Windows access violations under ZLUDA, fp16 accumulation drift, TF32 slowdowns - and v2.3.x is where that war got mostly won. If you run LTX or WAN on an AMD box through a custom-sampler workflow, this is genuinely the one to use: the memory management and the crash workarounds are real. On a stock image workflow with euler at 20 steps, the win is mostly logging. But when a video job dies at step 47, you'll be glad the cleanup and the flash-attention escape hatch are already wired in.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| noise | NOISE | — | |
| guider | GUIDER | — | |
| sampler | SAMPLER | — | |
| sigmas | SIGMAS | — | |
| latent_image | LATENT | — | |
| compatibility_modeopt | BOOLEAN | false | Skip all ROCm optimizations, force pure stock behavior |
| flash_attentionopt | COMBO | auto | Override flash attention behavior. 'auto' = use ComfyUI defaults, 'disable_flash' = use math/efficient SDP (fixes illegal memory access on some ROCm models), 'force_flash' = prefer flash SDP with math/efficient fallback |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output | LATENT | — |
| denoised_output | LATENT | — |