ComfyUI Node
Step Expression
Evaluate a math expression in step context. Useful for creating step-dependent schedules or conditions.
Step Expression
- value
- condition
◄step_index1►
◄total_steps20►
◄expressionstep % 5 == 0►
Categorysampling/peek
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| step_index | INT | 11–10000 | Current step index (1-based) |
| total_steps | INT | 201–10000 | Total number of sampling steps |
| expression | STRING | step % 5 == 0 | Math expression to evaluate. Variables: step (current), n (total steps). Returns both float value and bool condition. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| value | FLOAT | Evaluated expression as a float |
| condition | BOOLEAN | Boolean truth of the expression |