Nodes/RocM Ninodes/ROCMOptimizedKSampler
ComfyUI Node

ROCMOptimizedKSampler

The sampler that reads the room (and the model)

By iGavroche·Created 11 months ago·Updated 4 days ago· 43
ROCMOptimizedKSampler
  • model
  • positive
  • negative
  • latent_image
  • LATENT
seed0
steps20
cfg8.0
sampler_name
scheduler
denoise1.00
optimize_for_videofalse
precision_modeauto
compatibility_modefalse

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.

CategoryROCm Ninodes/Sampling

Inputs (13)

NameTypeDefaultDescription
modelMODELThe model to sample from
seedINT00–18446744073709550000Random seed for generation
stepsINT201–10000Number of sampling steps
cfgFLOAT8.00–100Classifier-free guidance scale
sampler_nameCOMBOSampling algorithm to use
schedulerCOMBOScheduler for noise timesteps
positiveCONDITIONINGPositive conditioning
negativeCONDITIONINGNegative conditioning
latent_imageLATENTLatent image to sample from
denoiseFLOAT1.000–1Denoising strength
optimize_for_videooptBOOLEANfalseDisable previews/progress for multi-frame latents
precision_modeoptCOMBOautoROCm precision hint (no-op on CUDA/CPU)
compatibility_modeoptBOOLEANfalseForce pure stock behavior

Outputs (1)

NameTypeDescription
LATENTLATENT