Nodes/ComfyUI_to_webui/🌴Boolean Model
ComfyUI Node

🌴Boolean Model

Route between two models based on your prompt text

By kungful·Created 2 years ago·Updated 8 months ago· 25
🌴Boolean Model
  • model1
  • model2
  • MODEL
text1
text2

Modelhua (🌴Boolean Model) is the model-flavored twin of the pack's boolean image router: it inspects a text string, and based on whether keywords show up, passes through one of two MODEL inputs. The README's framing is the same as its sibling - this is the "skip the PuLID error" branch. In workflows built around PuLID (ByteDance's face-adapter) the pattern is: when the prompt actually calls for a face, keep the model with identity conditioning; when it doesn't, route to the plain model so the graph doesn't try to apply face logic to a prompt that never mentioned one.

The mechanism is word counting, pure and simple. text2 is your keyword list (split on whitespace, lowercased); text1 is the string being searched. Every word in text1 gets counted case-insensitively, and if any keyword from text2 is found at least once, model1 flows through. No keyword, model2 does. That's the whole decision tree - no fuzzy matching, no embeddings, no threshold.

Inputs, all required:

  • text1 - the full string to inspect (usually your assembled prompt).
  • text2 - keywords to match, space-separated.
  • model1 - output MODEL when a keyword matches.
  • model2 - output MODEL when none do.

Output: MODEL, straight into your sampler chain.

Install: 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. Nothing extra to download; the models themselves are whatever you already load into model1/model2.

The honest limitations are the same ones that apply to Huaword. Matching is whitespace-split literal words, so hyphenated phrases don't match, and the keyword just needs to appear anywhere - a negative prompt phrase like "no portrait" will still trigger the portrait branch. If your needs are fancier than "does this word appear," this isn't the tool. And one structural thing to know: loading two whole models into the graph to pick between them doubles your VRAM footprint compared to just not loading the unneeded branch. That's the price of the workaround - reasonable when it saves a PuLID pipeline from crashing, wasteful if you're only ever going to use one side. For the packaged-workflow use case the author built it for, it does the job.

Category❤️ 靓仔 ✨

Inputs (4)

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

Outputs (1)

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