Nodes/ComfyUI-RMAutomation/RM Image Fallback
ComfyUI Node

RM Image Fallback

Pick the first image that actually exists

By Moser9815·Created 7 months ago·Updated 7 days ago· 0
RM Image Fallback
  • image_1
  • image_2
  • image_3
  • IMAGE

Sometimes a workflow has a branch that produces an image sometimes. A face-detect path that only fires when a face is found, an upscaler that gets bypassed for small images, an img2img branch that needs a reference - conditional logic in ComfyUI tends to be handled with switches and bypasses, and it gets messy fast. RMImageFallback is the simplest possible answer: it takes up to three images and hands you the first one that isn't empty. No switches, no routing nodes, no config.

How it works

You connect up to three image inputs - image_1, image_2, image_3 - and the node scans them in order. The first input that is not None and has at least one frame wins and gets passed to the output. It's the classic "fallback chain": primary source first, backup second, safety net third. The neat part is what happens if all of them are empty: instead of returning None and breaking whatever consumes the output, it returns a black 512×512 image. That's deliberate - a placeholder keeps downstream nodes alive so the rest of the graph doesn't fall over.

That placeholder behavior is also the thing to be careful about. A black 512×512 image is not a useful result, and it will flow into a sampler or a save node like it means something. This node prevents crashes, not bad output.

Inputs and outputs that matter

  • image_1, image_2, image_3 (IMAGE, optional) - connected in priority order.
  • IMAGE (output) - the first valid image, or the black placeholder.

How to install it

Ships in the RMAutomation pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Moser9815/ComfyUI-RMAutomation

Restart ComfyUI; it's under RMAutomation/Image. No extra dependencies - this is about as light as a node gets.

Common issues

The only real gotcha is the placeholder, and it's easy to miss because it's quiet. If you're seeing black 512×512 frames in your output, one of your fallback branches is empty and the node is doing its job - the fix is upstream, in whatever should have produced an image. If you genuinely want None to propagate so a downstream node can handle "no image," this node isn't that; it's a keep-the-pipeline-running utility. For a chain with more than three sources, you can cascade two fallback nodes - the output of the first feeds the image_1 slot of the second.

CategoryRMAutomation/Image

Inputs (3)

NameTypeDefaultDescription
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE