String Value Switch (VantageV2)
Turn a mode name into whatever the graph needs
- value
This is a translator. You tell it photoreal, it hands back an integer, a float, a boolean or a whole prompt string - whichever you asked for.
The mechanism
A STRING arrives on value. An ordered list of named conditions sits inside the node, each with an operator (=, !=, contains, not contains, starts with, ends with) and a comparison constant. The first rule that matches returns the value you typed into that condition's field. No match returns None.
The output type is a choice, not an inference: BOOLEAN, INT, FLOAT or STRING, set in the title-bar configuration dialog alongside the rules. Then a result field appears on the node for each condition and you fill it in. The backend converts every result through that type, which is either convenient or mildly surprising, depending on whether you remembered you'd left it on BOOLEAN.
Matching is case-sensitive and preserves whitespace, exactly like its socket-based sibling String Switch, and empty strings are fair game as constants. So Mode ≠ mode, and "portrait " ≠ "portrait". If the string is coming from something you don't control - a filename, a pasted prompt - prefer contains and save yourself the debugging.
What people use it for
The clean pattern is a mode selector at the top of the workflow that changes three unrelated settings at once. One string node says cinematic. Three String Value Switches read it: one emits the CFG, one emits the sampler name as a STRING (wire it into a sampler-name input after converting that widget), one emits a look prompt fragment to concatenate downstream. Change one word, three settings move together. That's the closest thing to a preset system you get out of stock nodes without reaching for a whole pack.
The second use is the inverse mapping - turning a human label into the literal a widget wants. Widgets that take text (sampler names, scheduler names, filenames, LoRA trigger words) are all fair targets. Wire the switch's value output into the converted widget and the label you type at the top decides what the widget sees.
If you need the branch to change rather than a value, that's String Switch - this node has no data sockets and cannot route an image. Choosing between the two is one question: do you want a different wire, or a different number?
Install
cd ComfyUI/custom_nodes
git clone https://github.com/vantagewithai/Vantage-NodesV2.git
Restart ComfyUI, hard-refresh the browser, look under Vantage/Utils or search the node name. ComfyUI Manager should also list the pack as Vantage-NodesV2; the clone above is the documented route.
No dependency install: no requirements file, no packages declared, all imports come from ComfyUI already. What it needs is a recent ComfyUI - the conditions editor is a title-bar dialog built on the current frontend APIs, and on an older install you'll get a node you can't configure.
Common issues
None when you swear the string matches. Case, whitespace, or rule order - in that order of likelihood. contains is the forgiving operator if you're feeding it anything machine-generated.
Numbers arriving as text or booleans. Check output_type. It's one click to fix and it will happily persist across runs while you debug the wrong thing.
Links dropped after switching output type. Expected: the fields reset to that type's defaults and incompatible connections are removed. Restoring an unchanged saved workflow preserves links; changing the type mid-session does not.
Node looks out of date after a pack update. Add a fresh instance - existing nodes keep the input schema they were created with, so new fields won't appear on them.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| value | STRING | — | |
| output_type | COMBO | 4 options: BOOLEAN, INT, FLOAT, STRING | |
| conditions | STRING | [{"name":"Condition 1","operator":"=","value":"","output":false}] | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | * | — |