Tag Switcher [LP]
Pick which image flows through based on which tags are present
- default_image
- image1
- image2
- image3
- image4
- image
Most of this pack's Tags nodes operate on the tag string itself - filtering, replacing, merging it. Tag Switcher does something different: it uses tags to make a routing decision about a completely different piece of data, an image. Feed it the tags describing your current input and up to four candidate branches, and it hands back whichever image matches.
What it does
The shape of it, read straight off the schema: you give it input_tags - the tag string you're checking - plus up to four numbered slots (tags1/image1 through tags4/image4), each pairing a set of candidate tags with an image to output if that set matches. Each slot also carries its own any boolean flag, which reads naturally as a toggle between "match if any of this slot's tags appear in input_tags" versus requiring all of them - the exact matching semantics (substring match, comma-split exact match, etc.) aren't spelled out in the schema, so confirm on a known case before relying on it. If nothing matches, default_image is what comes out instead, so this node always resolves to something rather than erroring on a miss.
Think of it as a conditional router for a workflow that branches on content: an autotagger or LLM captioner produces tags for whatever's currently in the pipeline, and depending on which tags show up, you want a different reference image, a different style guide, or a different overlay fed downstream - without hand-wiring a chain of separate if nodes. Note it's flagged as an output node in its own schema, meaning it executes even if nothing downstream is connected to its result, which matters if you're using it for logging or preview purposes rather than feeding its output further into the graph.
Inputs and outputs that matter
input_tags(required, string) - the tags you're checking against the candidate branches.default_image(required, image) - what gets returned if none of the candidate tag sets match.tags1/image1/any1(required) - the first candidate branch: a tag set, the image to return if it matches, and the any-vs-all match toggle.tags2–tags4,image2–image4,any2–any4(optional) - up to three more candidate branches, same shape.
Output: image - whichever image the matched branch (or the default) resolves to.
Installing it
Through ComfyUI Manager, search "ComfyUI Level Pixel" or "ComfyUI-LevelPixel." Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/LevelPixel/ComfyUI-LevelPixel.git
Restart ComfyUI. No models required for the switching logic itself - whatever produces your input tags (an autotagger, an LLM node, manual entry) is a separate dependency.
Common issues & troubleshooting
It always falls through to default_image. Since the exact match logic (substring vs. exact token vs. comma-delimited comparison) isn't documented, mismatched formatting between input_tags and a slot's tagsN - extra spaces, underscores vs. spaces, different casing - is the most likely cause. Test with input_tags copied verbatim from one of your slot's tag fields to confirm a match fires at all before troubleshooting further.
More than four candidate branches needed. The node caps out at four numbered slots plus the default. For a longer list of conditions, you'd need to chain a second Tag Switcher off the first one's output (wired in as that switcher's default_image) to extend the branching.
Unsure which slot actually fired. There's no separate output telling you which branch matched - only the resulting image. If you need to debug which condition triggered, temporarily swap in visibly distinct placeholder images per slot so you can tell at a glance which one made it through.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| input_tags | STRING | — | |
| default_image | IMAGE | — | |
| tags1 | STRING | — | |
| image1 | IMAGE | — | |
| any1 | BOOLEAN | true | — |
| tags2opt | STRING | — | |
| image2opt | IMAGE | — | |
| any2opt | BOOLEAN | true | — |
| tags3opt | STRING | — | |
| image3opt | IMAGE | — | |
| any3opt | BOOLEAN | true | — |
| tags4opt | STRING | — | |
| image4opt | IMAGE | — | |
| any4opt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |