WP Var → Bool
Making a Wildcard Flip a Switch in Your Graph
- context
- wp_var_name
- value
Of the three conversion nodes in Wildcard Pipeline, WP Var → Bool is the one people reach for when they realize a wildcard can do more than fill text - it can decide structure. Its output is a real BOOLEAN socket, so a rolled variable can enable or disable a node, flip a bypass, pick between two branches of a workflow. Where the Int and Float nodes control how much of something, this one controls whether.
How it works
Same shape as its numeric siblings, four required inputs:
- context - the PIPELINE_CONTEXT to read from.
- wp_var_name - a picker menu of the variables your context defines.
- index - which boolean token to extract when the value has several (0 = first).
- default - the BOOLEAN fallback when the variable is missing or no boolean token is found.
The parsing rule is what makes this node behave differently from the numeric pair, and it's worth reading twice: the value is tokenized on whitespace, commas, semicolons, pipes and slashes, then each token is matched case-insensitively against true/yes/on/1 (→ True) or false/no/off/0 (→ False). Non-boolean tokens - like numbers - are skipped without consuming an index slot. So a variable holding 1.5 is invisible to the bool parser entirely (it skips 1.5, finds nothing, returns default). That's deliberate: a $var like enable 4 yields True because the parser finds the enable token and ignores 4 - tokens that don't parse as booleans don't steal index positions.
The default is the safety net, same as the other converters: missing variable or no boolean token anywhere, and you get the default rather than an error. The one consequence to remember is the same trap across the whole family - a silently-applied default looks identical to a correct parse, so when a switch stays stuck, check WP Debug's warnings before you assume the variable was read.
Where it shines
The classic pattern: a wildcard $quality with options like high quality and draft doesn't map cleanly to a boolean, but a variable $post_upscale with options yes / no does. Roll yes, and this node's True output can toggle a bypass on an upscale stage or drive a conditional switch that routes the latent through a second pass. Fold it into a loop and some iterations get the expensive post-processing while others skip it - which is a shockingly useful way to explore whether a stage is even helping, batch over batch.
It pairs naturally with the Bool output of any conditional node. ComfyUI's switch/reroute nodes accept wired booleans, and WP Context Injector can feed an external value in as a $var that this node then converts - so the source of truth (a wildcard roll, a user widget, an external node) stays in the context, and the graph just consumes a clean boolean.
Install
One-time pack setup: ComfyUI Manager → search Wildcard Pipeline → install, or the git clone + pip install -e . + pnpm build path from the README. Needs ComfyUI ≥ 0.3.36, no model downloads. GPL-3.0.
If your variable's value is 1.5, don't reach for this node expecting True - it's explicitly not a "is there a number" test. For that, compare against a numeric parse with WP Var → Int and a comparison node. The bool node reads words, which is exactly right for wildcard options written as words.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| context | PIPELINE_CONTEXT | The resolved $variable context from any upstream WP Context / Loop / Injector chain. Required — without it the node has no variables to read. | |
| wp_var_name | WP_VAR_PICKER | — | |
| index | INT | 00–999 | Which boolean token in the value to extract when multiple are present (0 = first). Non-boolean tokens (e.g. numbers) are skipped without consuming an index slot. |
| default | BOOLEAN | false | Value to use when the variable is missing or no matching boolean token is found. The node never errors — it falls back to this. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | BOOLEAN | — |