Search To Boolean
Turn 'does this text contain X?' into a yes/no your workflow can branch on
- contains
A lot of ComfyUI "logic" is just string matching dressed up. Search To Boolean is the plainest version of that: it checks whether one string contains another and hands you a real BOOLEAN you can branch on. No APIs, no models, no keys - it's two inputs and a in check under the hood.
How it works
Give it a string, a substring, and it outputs a single boolean named contains. There's one optional input, case_sensitive, which defaults to true. Flip it off and both sides get lowercased before the check, so "SDXL" will match "sdxl".
The mechanism is exactly Python's substring test - substring in string - so "contains" means anywhere in the middle, not just a prefix or suffix. "cat" is found in "education" and "concatenate", which surprises people exactly once.
What you do with the output
The boolean is the whole point, because it lets the rest of the graph decide what happens next. Feed it into a switch node or a conditional router to pick between two branches: does this filename contain the _done_ marker? Does this generated prompt mention the subject we're batching for? Different answers, different path through the workflow. It's the kind of node that makes sense once you're building anything that processes batches of prompts or files instead of one-off generations.
It's also the natural sibling to Search and Replace from the same pack: check with this one, act with that one.
Two details worth knowing
An empty substring always matches - "" in anything is True in Python, and the node faithfully inherits that. If your substring input is ever blank, every string will test as a hit. That's a footgun if you're driving the node from a field that can be empty.
And the case sensitivity is a true toggle, not the three-way dropdown Search and Replace uses. If you need "match case" style behavior where the match is loose but the replacement adapts, you're in the wrong node - this one just answers yes or no.
Install
Part of the ComfyUI-TinyBee pack. Via ComfyUI Manager, search ComfyUI-TinyBee and install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
Restart and you'll find it under 🐝TinyBee/Strings. Zero extra dependencies for this node - it's pure stdlib. The pack's pillow and jsonata requirements only matter for its image and JSON parsing nodes.
Gotchas
Beyond the empty-substring trap: remember the check is case-sensitive by default, and remember it's a substring check. If you want "starts with" or "ends with" semantics, you're looking at the wrong tool - this node only answers "is it in there, somewhere."
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| string | STRING | — | |
| substring | STRING | — | |
| case_sensitiveopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| contains | BOOLEAN | — |