ROCMOptimizedKSampler
The sampler that reads the room (and the model)
- model
- positive
- negative
- latent_image
- LATENT
Every ComfyUI workflow's beating heart is a KSampler - the node that turns noise and conditioning into a latent. This is the ROCm Ninodes pack's version, and its pitch is "stock KSampler behavior with auto-detection." Instead of hoping you've guessed the right settings, it looks at your GPU architecture and your model type, applies backend settings that match, and logs what it found. For AMD users it's the difference between a sampler that behaves and one that quietly runs at half speed because some global flag is wrong for your chip.
The inputs
The full stock KSampler surface - model, seed, steps (20), cfg (8.0), sampler_name (44 choices), scheduler (9), positive/negative conditioning, latent_image, denoise (1.0). Same 44 samplers and 9 schedulers as stock, because it delegates to the same comfy.sample.sample call. Output is one LATENT into your VAE decode.
Three optional toggles make it ROCm-flavored:
- optimize_for_video (off) - disables previews for multi-frame latents. Turn it on for video; previewing a 5D latent every 5 steps is wasted work.
- precision_mode (auto/fp32/bf16) - an explicit no-op on CUDA/CPU, only active under ROCm. "Auto" is right for almost everyone.
- compatibility_mode (off) - forces pure stock behavior if the auto-tuning misbehaves.
What it does that stock doesn't
The auto-detection is the headline. It checks whether you're on ROCm at all, detects your GPU family, and reads the model - flagging flow-matching models (z-image, ernie, ideogram4-class), pixel-space models (z-image-turbo, where no VAE decode is needed downstream), and high-memory models that get an automatic cleanup before sampling. The source even notes this family of "aggressive" global tweaks had to be walked back over releases: forcing tf32=False and fp16 accumulation sounded good on paper and then caused illegal-memory-access crashes on some ROCm builds, so the current version is conservative - detection, logging, and gentle cleanup rather than risky global flags. That history is worth knowing: the pack has been burned by over-optimization and dialed it back.
The other visible difference is the progress reporting - per-step timing and ETA in the console, with a note on which workflow type it detected.
Install
It's the pack's entry-point sampler: ComfyUI Manager → search "ROCm Ninodes," or
cd ComfyUI/custom_nodes
git clone https://github.com/iGavroche/rocm-ninodes.git
Restart, under ROCm Ninodes → Sampling. Light deps (numpy, Pillow, psutil, gguf, safetensors), no model files. Real prerequisite: a working ROCm PyTorch stack, with the README's TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 for mature drivers.
The honest take
On NVIDIA: skip it, it's a clone. On AMD: it's a tidy KSampler that keeps your whole graph in one pack and adds visibility. The auto-detection is real but subtle - on a healthy setup you won't notice it, because the whole point is that nothing goes wrong. The one warning worth carrying: this is a "best effort" node on a niche platform, and the pack's changelog shows it has occasionally shipped regressions that got fixed a release later (the LTX slowdown from a TF32 change, the dark-banding from fp16 accumulation). If you're mid-project and a new version acts up, compatibility_mode is your instant rollback - flip it, confirm the node is innocent, then update.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The model to sample from | |
| seed | INT | 00–18446744073709550000 | Random seed for generation |
| steps | INT | 201–10000 | Number of sampling steps |
| cfg | FLOAT | 8.00–100 | Classifier-free guidance scale |
| sampler_name | COMBO | Sampling algorithm to use | |
| scheduler | COMBO | Scheduler for noise timesteps | |
| positive | CONDITIONING | Positive conditioning | |
| negative | CONDITIONING | Negative conditioning | |
| latent_image | LATENT | Latent image to sample from | |
| denoise | FLOAT | 1.000–1 | Denoising strength |
| optimize_for_videoopt | BOOLEAN | false | Disable previews/progress for multi-frame latents |
| precision_modeopt | COMBO | auto | ROCm precision hint (no-op on CUDA/CPU) |
| compatibility_modeopt | BOOLEAN | false | Force pure stock behavior |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |