Nodes/ComfyUI-LogicUtils/Manual Choice Float
ComfyUI Node

Manual Choice Float

A poor man's dropdown for a handful of preset values

By aria1th·Created 3 years ago·Updated 7 months ago· 122
Manual Choice Float
    • FLOAT
    input_string1.0$2.0$3.0
    separator$
    index0

    This one's less a "logic gate" in the traditional sense and more a workaround for something ComfyUI doesn't give you out of the box: a quick way to expose a small menu of preset float values you can flip between by changing a single number, without wiring up a proper dropdown node or rebuilding part of your graph every time.

    What it does

    Three required inputs. input_string (STRING, default "1.0$2.0$3.0") is your list of candidate values, written out as one string, separated by whatever's in separator (STRING, default "$"). index (INT, default 0, with essentially no upper bound - the schema's max is the largest number a 64-bit integer can hold, so in practice you're limited only by how many values you actually typed) picks which entry to return. The node splits input_string on separator, converts the piece at position index to a float, and that's your output.

    So with the defaults, index=0 gives you 1.0, index=1 gives you 2.0, index=2 gives you 3.0. Change the string to whatever candidate values you actually want - say a handful of CFG scales or denoise strengths you're trying to compare, like "4.5$6.0$7.5$9.0" - and now that single index input is your entire preset selector. Wire index from somewhere upstream (another logic node, a counter, whatever) and you've effectively built a menu of float values you can switch through with one integer, without a native ComfyUI combo widget for arbitrary float lists.

    The inputs and outputs that matter

    • input_string (required STRING, default "1.0$2.0$3.0") - your candidate values, delimited.
    • separator (required STRING, default "$") - what splits them apart. Has to match exactly what's actually in input_string.
    • index (required INT, default 0, min 0) - which value to return. Zero-based.
    • Output: FLOAT - the parsed value at that position.

    Installing it

    ComfyUI Manager: search ComfyUI-LogicUtils, install, restart. Or by hand: cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart ComfyUI. No models, essentially no dependencies - this is the same pack a Reddit thread recommended specifically for having none, when comparing options for basic logic operations against heavier alternatives. There's an opt-in install hook (COMFYUI_LOGICUTILS_AUTO_INSTALL=1) with an off switch (COMFYUI_LOGICUTILS_SKIP_INSTALL=1); nothing heavy here means you're unlikely to need either.

    Where people get burned

    The separator mismatch is the one that'll actually confuse you. If you edit input_string to use commas instead of dollar signs but forget to update separator to match, the split doesn't happen at all - you get your entire string back as a single piece, which then fails to convert to a float and errors instead of silently doing something wrong. Keep the two in sync whenever you change your value list.

    The other real friction, and it's honest to call it a friction rather than a bug: there's no dropdown UI here. You're maintaining a mental map of "index 2 means the 7.5 CFG option" yourself, since the node doesn't label anything - just a number in, a number out. For two or three values that's manageable; past that, it starts to feel like the wrong tool, and you might be better served by a proper combo/dropdown node from elsewhere in your node collection if one's available. This node earns its keep specifically in the small-preset case where a full dropdown feels like overkill for three or four options.

    CategoryLogic Gates

    Inputs (3)

    NameTypeDefaultDescription
    input_stringSTRING1.0$2.0$3.0
    separatorSTRING$
    indexINT00–9223372036854776000

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT