TagFlagImage
Pick between images with boolean flags, fallback included
- default_image
- output_image1
- output_image2
- output_image3
- output_image4
- output_image1
- output_image2
- output_image3
- output_image4
- any_one
TagFlagImage is the image version of TagFlag. Where the text node switches tag strings on and off, this one switches images: up to four (image, flag) pairs, and each flag decides whether that image gets routed to its output. Everything also passes through a default_image fallback. It's the pack's answer to "show image A or image B depending on a condition," and it's the rare node in this family that lives in the image category instead of text.
The mechanism is dead simple. Four optional output_imageN / output_flagN pairs, each with a matching output_imageN output. When a flag is true and an image is actually connected, that channel outputs the image. When the flag is off - or no image is wired in - the channel outputs default_image instead. There's also a fifth output, any_one, which holds whatever the last enabled channel selected. All five outputs default to default_image, so nothing is ever None and downstream nodes always get a real tensor.
How you'd actually use it
The obvious driver: a tag condition. This pack's whole pitch is "check the tags, then do something," and TagFlagImage is the "do something" for images. Chain TagIf (or TagSelector's found output) into the flags, feed a "cat ears detected → inpainted cleanup image" into output_image1 and the untouched original into default_image, and you get automatic before/after selection - the same trick the README's TagSwitcher does, but with explicit boolean control instead of tag matching baked in. The any_one output is handy when you don't care which branch won, just that "one of them did."
Gotchas
Two behaviors to remember. First, flags default to true, so out of the box every connected image wins and any_one is the last one - if you expected "nothing selected until I say so," you're getting the opposite. Second, the fallback applies per-channel: there's no single "all channels off → default" switch, it's just what each channel falls back to individually. And if a flag is true but no image is connected to that port, you still get default_image, not an error - quiet, but often exactly what you want.
Install
Same pack, same routine: ComfyUI Manager search "comfyui_tag_filter", or
cd ComfyUI/custom_nodes
git clone https://github.com/sugarkwork/comfyui_tag_fillter
Restart, and it shows up under the image category. No dependencies, no model downloads - the pack's requirements.txt is empty and this node touches only tensor plumbing. It's the kind of node that's forgettable until you need conditional image routing, and then it's exactly the four lines of wiring you didn't want to build yourself.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| default_imageopt | IMAGE | — | |
| output_image1opt | IMAGE | — | |
| output_flag1opt | BOOLEAN | true | — |
| output_image2opt | IMAGE | — | |
| output_flag2opt | BOOLEAN | true | — |
| output_image3opt | IMAGE | — | |
| output_flag3opt | BOOLEAN | true | — |
| output_image4opt | IMAGE | — | |
| output_flag4opt | BOOLEAN | true | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| output_image1 | IMAGE | — |
| output_image2 | IMAGE | — |
| output_image3 | IMAGE | — |
| output_image4 | IMAGE | — |
| any_one | IMAGE | — |