Nodes/Vantage-NodesV2/Int Value Switch (VantageV2)
ComfyUI Node

Int Value Switch (VantageV2)

Turn a number into a setting you named yourself

By vantagewithai·Created 15 days ago·Updated 11 days ago· 3
Int Value Switch (VantageV2)
    • value
    ◄value0►
    ◄output_type▾►
    ◄conditions[{"name":"Condition 1","operator":"=","value":0,"output":false}]►

    There's a family of four nodes in this pack called "value switches", and the distinction from the plain switches is worth getting straight once: the plain switches hand back a connection, the value switches hand back a literal you typed on the node. No sockets on the data side at all.

    How it works

    An INT goes in, a value you entered comes out. You choose the output type from the title-bar dialog - BOOLEAN, INT, FLOAT or STRING - then define named conditions with an operator (=, !=, <, <=, >, >=) and a comparison constant. Save, and a field appears on the node body for each condition's result. First matching condition returns its field's value; no match returns None.

    Under the hood it's the same rule engine as the branch switches: conditions is a JSON string, the first match wins, and the winners' values get converted to whatever output_type you picked. The conversion is why the output type selector matters - the same rules can emit an integer step count or a string prompt, and you decide which.

    Names are for you, not the graph. Calling them "Low steps" and "High steps" makes the node readable six weeks later; the machine only cares about order, operator, and constant.

    What it's actually for

    Mapping a range onto a setting. Sampling steps is the obvious one: below a threshold, return 20; at or above it, return 30. Now your step count follows whatever drives the input - a quality tier, a per-image value from a batch, a slider you keep fiddling with - without you remembering to change two things at once.

    The other honest use is building a small lookup table. Three ranges, three CFGs. It reads like a switch statement because it is one, and ComfyUI doesn't otherwise give you one outside a custom node.

    What it isn't: a branch selector. It has no data inputs, so it can't route an IMAGE down two different paths. For that, use Int Switch, which does have lazy wildcard sockets and only runs the winning branch. Pick by whether you need to choose a wire or produce a value.

    The comparison value is a widget by default and can be converted to an input if the number arrives on a wire. The output socket is a single value, typed to match your chosen output type.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/vantagewithai/Vantage-NodesV2.git
    

    Restart ComfyUI and hard-refresh the browser, then look under Vantage/Utils or search "Int Value Switch". ComfyUI Manager should also list it under Vantage-NodesV2; the clone is the README's documented path.

    No packages to install - no requirements file, no declared dependencies in pyproject.toml, all imports come from ComfyUI. The real requirement is a current ComfyUI, because the condition editor is a title-bar button built on the newer frontend widget APIs. Old installs get a node with no way to configure it.

    Common issues

    Nothing comes out. No condition matched. Ranges with holes are the usual culprit - check the value you're feeding against the list in order.

    The output type changed and my links are gone. That's specified behaviour: switching output type resets the result fields to that type's defaults and disconnects links that no longer fit. Saved workflows that are restored unchanged keep their links.

    My numbers come out as booleans. output_type is still BOOLEAN - the converter is applied to every result field, so int(True) gives you 1. Check the selector before you start debugging arithmetic.

    Rules, names and entered values all save with the workflow, so a shared graph carries its logic along. If a pack update changes the schema, though, create a new instance rather than reusing an old node - saved instances keep the shape they had.

    CategoryVantage/Utils

    Inputs (3)

    NameTypeDefaultDescription
    valueINT0—
    output_typeCOMBO4 options: BOOLEAN, INT, FLOAT, STRING
    conditionsSTRING[{"name":"Condition 1","operator":"=","value":0,"output":false}]—

    Outputs (1)

    NameTypeDescription
    value*—