Nodes/ControlFlowUtils/πŸ”„ Cycle
ComfyUI Node

πŸ”„ Cycle

Begins a Cycle, a kind of Loop that gets iterated each time a prompt is executed. You can use Cycles to send information forwards into subsequent prompts, allowing for workflows that process data in an iterative manner. Connect the CYCLE Output of this node to a [Cycle Continue](#Cycle_Continue)'s CYCLE Input to begin the loop. The first iteration of the loop is called a 'DRY RUN', Index, Data and all Aux_Data Inputs will be set to None. Additionally the "Reset?" output will return True so you can test this with an [IF Selector](#IF_Condition_Selector) node to determine whether you are in the first execution of the loop. You can also trigger a manual reset to the fist 'DRY RUN' iteration by toggling the Manual_Reset Input. Use the 'DRY RUN' to reset any variables or the state of your workflow whenever a fresh Cycle has started. Set your Start, End and Step parameters to the values you would like to iterate from, to and by, respectively. If you'd like the loop to return automatically to the original Start value, enable the Auto_Reset Input, otherwise the cycle will continue to apply Step to Index on each iteration. HOVER OVER THE INPUTS AND OUTPUTS FOR MORE INFO.

By VykosXΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 147
πŸ”„ Cycle
    • CYCLE
    • RESET?
    β—„start0β–Ί
    β—„step1β–Ί
    β—„end10β–Ί
    β—„manual_resetβ€”β–Ί
    β—„auto_resettrueβ–Ί
    Category🐺 VykosX-ControlFlowUtils

    Inputs (5)

    NameTypeDefaultDescription
    startINT0The initial value of the loop counter
    stepINT1How much the loop counter gets increased or decreased by on each iteration
    endINT10The value at which the loop is considered to be finished
    manual_resetoptBOOLEANEnable to force a 'DRY RUN' and reset the Cycle to its first iteration
    auto_resetoptBOOLEANtrueEnable to have the loop counter automatically reset to Start once it reaches End

    Outputs (2)

    NameTypeDescription
    CYCLECYCLEConnect to the CYCLE input of a [CycleContinue] node to establish a loop
    RESET?BOOLEANSpecifies whether the Cycle is executing its 'DRY RUN' iteration