ComfyUI Node

Lazy Switch (Float)

Turn a mode string into a number

By vsaan212·Created 10 months ago·Updated 9 days ago· 1
Lazy Switch (Float)
    • FLOAT
    compare
    match
    on_true1.00
    on_false0.00
    case_sensitivefalse

    Lazy Switch (Float) is a two-way valve that takes a text condition and outputs a number. You feed it a string, tell it what to match, and it hands back on_true or on_false depending on whether they match. In this pack's world, that string is almost always a workflow mode, which makes the node a compact way to do "when I'm in R2V mode, use a LoRA strength of 0.8; otherwise 0.3" without a whole conditional-graph contraption.

    It's part of a three-node family (Float, Integer, Text) that all share the same match logic, so if you've seen one you've seen the mechanism. The Float version is the one you reach for when the output feeds a strength, a scale, a CFG, or a denoise.

    How it works

    The matching is simple but forgiving. It compares the compare string against match, and by default the comparison is trimmed and case-insensitive - so "r2v " matches "R2V". You can flip case_sensitive on if your match text genuinely cares about case. And match isn't limited to one value: use commas or pipes for alternatives, so t2v,r2v matches either mode.

    The part that earns the "Lazy" in the name is evaluation. ComfyUI asks the node which inputs it actually needs, and it only marks the branch that won as needed - so if on_true is wired to an expensive node and the mode is T2V, that upstream node is never executed. Unused branches get skipped, not just ignored, which keeps reconfiguring a video workflow cheap.

    The inputs that matter:

    • compare - the upstream text to test. Wire it to a selector or mode string.
    • match - what compare must equal (or one of, with , / | alternatives).
    • on_true - the float returned when there's a match (default 1).
    • on_false - the float returned otherwise (default 0).
    • case_sensitive - off by default; turn on for exact matching.

    Output is a single FLOAT.

    Where it fits

    The canonical use is mode-conditional settings on a MiniMax or LTX video graph: different denoise or LoRA strength for image-to-video versus text-to-video, different guidance for reference mode. It's a bit of a niche node outside that stack - if you only ever want a constant, a plain PrimitiveFloat does the job with less machinery. Reach for this one when the number genuinely has to change with the mode, and you don't want to remember to change it by hand.

    Installing it

    Lazy Switch (Float) is part of vsaan212/Vsaan212-workflow-utilities (MIT). Install from ComfyUI Manager by searching Vsaan212-workflow-utilities, or clone:

    cd ComfyUI/custom_nodes
    git clone https://github.com/vsaan212/Vsaan212-workflow-utilities
    

    Restart ComfyUI and look under vsaan212/utilities. No models, no API keys, no extra Python deps for this node - the pack's heavier requirements belong to LazyPrompt's local LLM features.

    One thing to know: if your compare string is coming from the pack's automation node as a tagged blob (with [Workflow] headers), this switch won't parse that itself - feed it a bare mode string, or use the mode output from Lazy MiniMax, which already resolves the blob to T2V/I2V/FL2V/R2V.

    Categoryvsaan212/utilities

    Inputs (5)

    NameTypeDefaultDescription
    compareSTRINGUpstream text to test (e.g. selector / mode string).
    matchSTRINGWhen compare equals this, output on_true; otherwise on_false. Use commas or pipes for alternatives (e.g. t2v,r2v).
    on_trueFLOAT1.00-1000000000–1000000000Value when compare matches match.
    on_falseFLOAT0.00-1000000000–1000000000Value when compare does not match.
    case_sensitiveBOOLEANfalseWhen off, compare and match are trimmed and compared case-insensitively.

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT