ListContains (Yogurt Nodes)
One Boolean that decides your whole workflow
- list_data
- element
- contains
The whole node is in the name
ListContains (Yogurt Nodes) asks one question: is this element in this list? It answers with a single Boolean, and that Boolean is the entire point. ComfyUI doesn't "decide" things the way a script does - but once you've got a True/False wire, you can route, gate, or branch anything, and a lot of that routing starts with a membership test.
Say you globbed a folder of images and you want to run the batch only if a specific file is in it, or you split a prompt into tokens and want to do something when a trigger word shows up. That's this node. It lives in the pack's 41-node logic suite, right next to DictContainsKey, StringSplit, and Switch, so it's built to feed a decision rather than stand alone.
How it works
The mechanism is gloriously simple, because it's literally Python:
return (element in list_data,)
That's the entire execute() - the in operator. Two consequences worth internalizing:
- It's exact equality, not substring.
"portrait" in ["portrait", "landscape"]is True, but"portrait" in ["portrait-2", ...]is False. For partial matching, reach for ListFilter and a regex instead. - Types must match.
2 in [1, 2, 3]is True but"2" in [1, 2, 3]is False. A number string and a number are different things.
list_data is typed "any list-like object," so it also takes tuples and sets. There's a subtle bonus: because it's just in, passing a plain string as list_data turns it into substring search ("ell" in "hello" → True). Handy when you remember it, confusing when you don't.
The two inputs and one output
list_data- any list-like object. Wire it from GlobFiles, StringSplit, ToList, or a list literal.element- what you're searching for. Anything, but the type must match exactly.- Output:
contains(BOOLEAN). Feed it into a Switch, a conditional, or any node that takes a Boolean.
That's the entire surface. No hidden settings, no API key, nothing to tune.
Installing it
This is one node inside a 152-node grab-bag called ComfyUI-YogurtNodes, so you get all of them whether you want them or not. The easy way is ComfyUI Manager - search for "ComfyUI-YogurtNodes" and hit install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
Restart ComfyUI and look under "Yogurt Nodes" - the node shows up as "ListContains (Yogurt Nodes)". This node itself is pure Python stdlib: no numpy, no model files, no keys. The pack's requirements.txt (numpy, pillow, openai, google-genai, requests) is only there for the image and LLM nodes you're not using. The README also lists opencv-python for Poisson Blend, but it isn't actually in requirements.txt - don't go hunting for it because of these list nodes.
You can also ignore every API-key section in the README; that's all Gemini/OpenAI/OpenRouter stuff.
Where people get burned
The membership check is exact, so the number-one beginner stumble is a string/int mismatch, and the second is expecting substring matching. When your workflow "doesn't do the thing," check what type is actually sitting in that list first. It's also a linear scan (O(n)) - irrelevant at any list size you'll realistically feed it, but don't expect magic on a thousand-item list.
Honest verdict: nothing here you couldn't do with a "list contains" node from Impact Pack or a dozen other logic packs. What this one adds is consistency - if you're already living in the YogurtNodes suite, it's the natural member to grab when you need a membership test.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| list_data | * | Any list-like object | |
| element | * | Element to search for |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| contains | BOOLEAN | — |