Nodes/ComfyUI_to_webui/🌵Boolean Image
ComfyUI Node

🌵Boolean Image

Route between two images based on whether your prompt mentions a keyword

By kungful·Created 2 years ago·Updated 8 months ago· 25
🌵Boolean Image
  • image1
  • image2
  • IMAGE
text1
text2

Huaword (🌵Boolean Image) is a plain-text router with an odd name and a very specific job: it looks at a prompt, checks whether certain keywords appear in it, and passes through one of two input images based on the answer. The README describes the reasoning in one line - it exists to dodge a PuLID error. If your workflow chains PuLID (ByteDance's face-identity adapter) and the prompt doesn't call for a face, feeding it a conditioning it doesn't expect can throw; this node is the "do I actually need the face branch?" check.

The mechanism is simple string matching. text2 is treated as your keyword list (split on whitespace); text1 is the full prompt to search. Every word in text1 is extracted case-insensitively and counted, and if any keyword from text2 appears at least once, the node outputs image1. No match, it outputs image2. That's the entire decision - no embeddings, no fuzzy matching, just word presence. The node's own tooltip says it plainly: if the word you mentioned appears, you get image1; otherwise image2.

Inputs, all required:

  • text1 - the full string to search (e.g. your assembled prompt).
  • text2 - the keywords to look for, space-separated.
  • image1 - output when a keyword matches.
  • image2 - output when none do.

Output: IMAGE - whichever branch won. You can chain these or route into a conditional pipeline where a PuLID-free path swaps in when the prompt has no identity to preserve.

Install: it's part of ComfyUI_to_webui - ComfyUI Manager → "ComfyUI_to_webui", or

cd ComfyUI/custom_nodes
git clone https://github.com/kungful/ComfyUI_to_webui.git

then restart. No models beyond what your workflow already loads; the pack itself downloads nothing.

Honest caveats. The matching is literal word-splitting on whitespace: "red-haired" in text2 won't match "red-haired" in text1 (the hyphen breaks the token), and it matches words anywhere in the prompt, so a negative like "no face" still trips the face branch. If you want anything cleverer - regex, AND/OR logic, or a real conditional - this isn't it. But for its stated purpose, keeping a PuLID workflow from choking when the prompt doesn't mention a face, it's a pragmatic band-aid. The Modelhua node is the same idea for routing between two models instead of two images; if you're wiring PuLID, you'll likely want both.

Category❤️ 靓仔 ✨

Inputs (4)

NameTypeDefaultDescription
text1STRING我是靓仔1全量字符串
text2STRING我是靓仔2指定字符串
image1IMAGE
image2IMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE在字符串中出现了你提到的词则会选在image1,如果没有就image2输出