ROCm KSampler:
ROCmKSampler runs ComfyUI’s standard sampling process while adding ROCm-oriented setup and monitoring. It detects the GPU architecture and model sampling type, applies backend settings when compatibility mode is off, and performs extra memory cleanup for models identified as high-memory. During sampling, it reports progress and may show latent previews. Its main purpose is to give you familiar KSampler behavior with additional support for demanding ROCm workflows; the actual sampling is performed by ComfyUI’s sampling function.
ROCm KSampler Input Parameters:
model
The model used to generate the result. Connect a compatible MODEL, such as the output of a model loader. The node checks the model type to decide whether to apply high-memory cleanup and to report certain model characteristics, then passes the model to ComfyUI for sampling. No default, minimum, or maximum is specified; this required input must be connected.
seed
The number used to prepare the starting noise. Keeping the seed and other settings the same helps you repeat a result, while changing it gives you a different starting pattern. The default is 0; the allowed range is 0 to 18446744073709551615.
steps
The requested number of sampling steps. This controls how many steps the sampler takes and affects processing time; more steps mean more work, but do not guarantee a better image. The default is 20; the allowed range is 1 to 10000.
cfg
The classifier-free guidance scale, which controls the strength of guidance from the supplied conditioning during sampling. Changing it can alter how closely the result follows your prompts; a higher value is not automatically better. The default is 8.0; the allowed range is 0.0 to 100.0, with a UI step of 0.1.
sampler_name
The sampling algorithm passed to ComfyUI. Different choices can produce different results from the same model, seed, and conditioning. The available options come directly from comfy.samplers.KSampler.SAMPLERS, so this node does not define a fixed list or a default in its source.
scheduler
The schedule used for the sampling noise levels. It works alongside the selected sampler and can affect the character of the result. The available options come directly from comfy.samplers.KSampler.SCHEDULERS; this node does not define a fixed list or a default in its source.
positive
The CONDITIONING that guides sampling toward what you want to create. Connect conditioning prepared for the selected model, typically from your positive prompt workflow. This is required and has no specified default, minimum, or maximum.
negative
The CONDITIONING supplied as negative guidance during sampling. It lets your workflow describe what to steer away from, according to the model and conditioning setup you use. This is required and has no specified default, minimum, or maximum.
latent_image
The starting LATENT to sample from. Its samples contain the data the sampler processes; the node also uses a batch index or noise mask if present. This input determines the starting latent and, for a multi-frame latent, whether video optimization can activate. It is required and has no specified default, minimum, or maximum.
denoise
The denoising strength passed to ComfyUI’s sampler. Use it to control how strongly sampling changes the starting latent: a value of 1.0 requests full denoising, while lower values request less. The default is 1.0; the allowed range is 0.0 to 1.0, with a UI step of 0.01.
optimize_for_video
An optional switch for multi-frame video latents. When True, with compatibility mode off, it activates the node’s video-specific progress and preview behavior only if the latent has five dimensions and more than one frame. In that case, it disables the sampling progress bar and skips preview-image generation; the node still prints step information. It does not activate for a single-frame or non-video-shaped latent. The default is False; the options are True and False.
compatibility_mode
An optional switch that skips ROCm backend-setting changes and the video-specific optimization path when set to True. This can help you compare behavior with the node’s optional optimizations disabled. It does not bypass the node’s own callback, model detection, or high-memory cleanup, so it should not be interpreted as making every operation identical to stock KSampler. The default is False; the options are True and False.
ROCm KSampler Output Parameters:
LATENT
The sampled latent produced by ComfyUI. Connect it to an appropriate downstream step, such as a compatible decoder when your workflow needs an image. The node returns a copy of the input latent data with samples replaced by the newly sampled values. It retains other input-latent entries except downscale_ratio_spacial and downscale_ratio_temporal, which it removes from the returned latent. The output is latent data, not a finished image file.
ROCm KSampler Usage Tips:
- Start with the defaults of
20steps,8.0CFG, and1.0denoise, then change one setting at a time so you can tell what affected the result. - Keep the seed fixed while comparing samplers, schedulers, CFG values, or denoise strengths. Change the seed when you want to explore a different starting noise pattern.
- For a multi-frame latent, try
optimize_for_video=Trueif you do not need previews during sampling. This setting applies only to a five-dimensional latent with more than one frame and whencompatibility_mode=False. - Try
compatibility_mode=Truewhen investigating whether the optional ROCm backend settings or video-specific behavior contribute to a problem. It is a diagnostic setting, not a guarantee that all node behavior becomes identical to stock KSampler. - For a model identified as high-memory, leave room in GPU memory for sampling and other workflow stages. The node performs extra cleanup for such models, but that does not guarantee an out-of-memory run will succeed.
- If you are modifying an existing latent, adjust
denoisebelow1.0and compare results. The amount of visible change also depends on your model, conditioning, and other sampling settings.
ROCm KSampler Common Errors and Solutions:
KeyError: 'samples'
- Explanation: The connected latent does not contain the
samplesdata this node expects. - Solution: Connect a valid
LATENToutput from a compatible latent-producing node, and check any custom node that constructs or modifies the latent.
RuntimeError: ... out of memory ...
- Explanation: Sampling or a preview may exceed the memory available to the model and the rest of your workflow. The exact error text depends on the backend.
- Solution: Reduce image dimensions, batch size, or video frame count; close competing GPU workloads; then retry. The node’s high-memory cleanup cannot always make an oversized job fit.
⚠ ROCm sampler preview failed (will retry next step): ...
- Explanation: The node caught an error while creating a preview. The message includes the underlying exception type and details. A preview failure alone does not stop sampling; the node continues without that preview.
- Solution: Check whether sampling completes before changing the workflow. If the warning repeats, inspect the exception details and confirm that the model’s latent format and preview setup are compatible. For a qualifying multi-frame latent,
optimize_for_video=Trueskips these previews.
KeyError: 'has_high_memory', KeyError: 'model_type', or another model-info key
- Explanation: The model-detection helper did not return a field the node expects. Setting compatibility mode does not prevent the node from reading model-detection information.
- Solution: Check that the extension’s architecture utilities are installed together and match this node version. Update or reinstall the extension as a complete set rather than replacing only this node file.
Error during apply_rocm_backend_settings(...)
- Explanation: The optional backend-setting stage failed before sampling began. The precise message depends on the helper and your environment.
- Solution: Retry with
compatibility_mode=Trueto skip that stage. If this resolves the error, check the extension’s ROCm setup and version compatibility before turning the setting back off.
ValueError or RuntimeError while preparing noise or sampling
- Explanation: ComfyUI rejected part of the model, latent, conditioning, sampler, or scheduler combination. The exact message comes from the underlying ComfyUI operation, not from a custom validation message in this node.
- Solution: Check that the model and conditioning belong to the same workflow, the latent has an appropriate shape for the model, and the selected sampler and scheduler are available. Test a simpler workflow to isolate the incompatible connection.
