Nodes/comfyui-EmptyImageYesON/Image Auto Disable Node
ComfyUI Node

Image Auto Disable Node

Your API Workflow Doesn't Need Every Reference Image — Let This Node Shut the Empty Slots Off

By zhangle0013·Created 8 months ago·Updated 8 months ago· 1
Image Auto Disable Node
  • image
  • output_image

Ever built a workflow with four reference-image slots, then tried to serve it through ComfyUI's API and had the whole run die because a caller only sent three images? That's the exact itch this node scratches. ImageAutoDisableNode (the README's Chinese sums it up as "auto-disable Load Image nodes that have no image") is a pass-through gate: it hands a valid image straight through untouched, and when there's no image it outputs nothing instead of blowing up. It's a tiny single-file utility from a small pack, and it does precisely one job - which is why it's worth knowing about if you're automating workflows at all.

How it actually works

The mechanism is dumber and more elegant than the name suggests. The node has exactly one optional input (image, IMAGE type) and one output (output_image). When you feed it a valid tensor it just returns it - no resizing, no format conversion, no math. When the input is missing or garbage, it returns None instead.

Here's the part that makes it work: that None travels downstream. ComfyUI lets a None output propagate into the next node, and any node written to tolerate it (the if image is None: return (None,) pattern, which most community packs follow) simply skips its work. So the whole reference-image branch goes inert instead of killing your queue. The author also added IS_CHANGED, which is the subtle detail that keeps this honest: with a valid image it returns float("inf"), forcing re-execution every run so a fresh image you push through the API never gets served from cache. With no image it returns None, telling ComfyUI "this branch does nothing, cache it and move on."

The validity check is conservative: it rejects anything that isn't a non-empty torch tensor with at least three dimensions and nonzero width/height. That means an empty batch or a 0×0 image also counts as "no image" and gets dropped.

The one input you actually set

There's really only one thing to do here: drop the node between your image source (usually a Load Image node, or whichever node pulls your API-supplied image) and the part of the graph that consumes it. image in, output_image out, wire output_image to wherever the raw image used to go. No settings, no model files, no toggles. If the upstream image is there, the downstream graph never notices the node existed.

Install

The pack ships no requirements.txt - nothing beyond the torch, numpy, and PIL that ComfyUI already loads, so there's no dependency hell to fight through. The README gives you the direct route:

cd ComfyUI/custom_nodes
git clone https://github.com/zhangle0013/comfyui-EmptyImageYesON.git

Restart ComfyUI and the node shows up as "Image Auto Disable Node" under image/utils. ComfyUI Manager can usually find the pack if you search "comfyui-EmptyImageYesON", but given how small this one is, the git clone is the guaranteed path.

Where it bites

Be honest about what this node is not. It doesn't literally disable the Load Image node upstream - that node still executes, and if it hard-errors on a missing file, this gate can't rescue you. The disable happens downstream, by feeding None to nodes that tolerate it. So it only helps if the rest of your chain is already None-tolerant. A core node that chokes on None will still choke. It also only guards the IMAGE input - no masks, no latents, no conditioning, no strength knob. For that you'd want the bigger graph-muting packs like rgthree or Impact Pack, which are a different tool for a different job.

The real use case is a served API workflow with optional reference images - think img2img or a multi-IPAdapter setup where callers may or may not pass every slot. That's a niche, but if you're in it, this is the smallest thing that fixes the failure mode.

Categoryimage/utils

Inputs (1)

NameTypeDefaultDescription
imageoptIMAGE

Outputs (1)

NameTypeDescription
output_imageIMAGE