Nodes/comfyui-sampler-peek/Peek Condition Gate
ComfyUI Node

Peek Condition Gate

A boolean switch for your float values

By Prohect·Created 3 months ago·Updated 3 months ago· 0
Peek Condition Gate
    • value
    condition
    true_value1.00
    false_value0.00

    PeekConditionGate is a conditional multiplexer: feed it a boolean and two floats, and it passes through true_value when the condition is true, false_value when it isn't. Three inputs, one output, nothing fancy. It's a two-value switch - the kind of node that seems pointless until you need it, then feels indispensable.

    Nothing about this node is sampling-specific, despite living in a sampler-peek pack. It just selects between two numbers based on a condition. Its natural partner is StepExpression, which produces exactly the boolean you need: a step-based condition. Together they give you "use this value before step 12, that value after" - or "value A during the first half of the run, value B during the second."

    The inputs and output

    • condition - a BOOLEAN. True routes to true_value, false routes to false_value.
    • true_value - float to pass when true. Default 1.
    • false_value - float to pass when false. Default 0.
    • value (output) - the chosen float.

    Because the output is a plain FLOAT, you can wire it into any numeric input on your graph: a CFG scale, a denoise amount, a strength, a multiplier feeding some downstream math. The classic pattern is condition from StepExpression's boolean output and the two values set by hand, so a single expression swap re-routes your whole schedule. You can also gate on anything else that produces a boolean - an image-analysis check, a comparison, a manual toggle.

    Why this beats doing it by hand

    You could, in principle, rebuild this with a few math nodes, but it'd be a small tangle of comparisons and switches every single time. This collapses it to one node, and its real value shows when the condition isn't static. A fixed toggle you can just type into a widget; the moment the decision depends on the current step, the batch, or a model output, a gate node like this is what keeps the graph readable. It's ComfyUI node-plumbing at its most honest: one value, one source of truth, no duplicated logic.

    Install

    Part of the comfyui-sampler-peek pack. In ComfyUI Manager, search comfyui-sampler-peek, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Prohect/comfyui-sampler-peek
    

    Restart and it's ready. No dependencies beyond ComfyUI itself, no model downloads. (Heads up: the README's clone command still names the old aria4comfyui repository, which is dead - the URL above is the live one.)

    The limits

    It's a float gate, and that's the whole scope. If you need to switch between two images, two latents, or two text prompts, this isn't the node - there are dedicated conditioning and image-switch nodes for that. It also doesn't clamp, interpolate, or remember anything; it's a pure pass-through selector. Set the two values, feed a condition, move on. For step-dependent routing in a sampling workflow, that's exactly the right amount of machinery.

    Categorysampling/peek

    Inputs (3)

    NameTypeDefaultDescription
    conditionBOOLEANGate condition
    true_valueFLOAT1.00-10000–10000Value when condition is True
    false_valueFLOAT0.00-10000–10000Value when condition is False

    Outputs (1)

    NameTypeDescription
    valueFLOAT