Nodes/comfyui-sampler-peek/Step Expression
ComfyUI Node

Step Expression

Evaluate a math expression in step context. Useful for creating step-dependent schedules or conditions.

By Prohect·Created 2 months ago·Updated 2 months ago· 0
Step Expression
    • value
    • condition
    step_index1
    total_steps20
    expressionstep % 5 == 0
    Categorysampling/peek

    Inputs (3)

    NameTypeDefaultDescription
    step_indexINT11–10000Current step index (1-based)
    total_stepsINT201–10000Total number of sampling steps
    expressionSTRINGstep % 5 == 0Math expression to evaluate. Variables: step (current), n (total steps). Returns both float value and bool condition.

    Outputs (2)

    NameTypeDescription
    valueFLOATEvaluated expression as a float
    conditionBOOLEANBoolean truth of the expression