Nodes/AsyncOutput/BatchIterator GlobalCache Clear
ComfyUI Node

BatchIterator GlobalCache Clear

The BatchIterator 'forget everything' node — and yes, it nags you on purpose

By teddy1565·Created 5 months ago·Updated 5 months ago· 0
BatchIterator GlobalCache Clear
    • void
    silent_modefalse
    force_cleartrue

    BatchIterator GlobalCache Clear (class BatchIteratorGlobalCacheClear) wipes every piece of state the BatchIterator family holds - the multiline-iterator positions, the string-collection storage, and the emitter counters - all at once. It's the "reset the whole BatchIterator brain" node, and it is the most honest node in this pack about its own danger.

    The author's warning is right in the tooltip: if you set silent_mode to true, the node "Never raise Error... but not recommend, because you forget it. will be disaster." Translation: this thing deletes state aggressively, and if you let it do so silently you will forget it's there and wonder why your iterator always starts over or your collection keeps coming up empty. So by default, it does the opposite of silent - with force_clear on, it clears the caches and then raises an exception to force you to acknowledge that it ran. The deliberate error isn't a bug; it's the author's idea of a seatbelt.

    How it works

    force_clear true → deletes every key from the three BatchIterator dicts (ASYNC_OUTPUT_BATCH_ITERATOR_MULTILINE_TEXT_ITERATOR_DICT, ASYNC_OUTPUT_BATCH_ITERATOR_STORAGE_DATA_DICT, ASYNC_OUTPUT_BATCH_ITERATOR_STORAGE_DATA_COUNTER_DICT), then either raises a warning exception (default) or, with silent_mode, prints the same warning and returns an ExecutionBlocker instead. force_clear false → blocks without clearing, so the node becomes a no-op gate. Output: void (BOOLEAN), and it's marked as an output node.

    The inputs that matter

    • force_clear (BOOLEAN, default true) - whether the wipe actually happens.
    • silent_mode (BOOLEAN, default false) - false = raise an error after clearing so you notice; true = clear quietly. The tooltip's stance: keep it false.

    Installing it

    No dependencies, no model files. ComfyUI Manager → search "AsyncOutput" → install and restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/teddy1565/ComfyUI-AsyncOutput
    

    It's under AsyncOutput/BatchIterator/SystemTools.

    Where people get burned

    Two ways to shoot yourself. Leave force_clear on and connected in a workflow you actually run, and every execution raises an error - that's "working as intended," but it's still an error blocking your batch, so the node is really meant for one-shot cleanup or debug passes, not permanent residency. Flip silent_mode on to dodge that, and you've traded a loud annoyance for silent state loss - if a later run depends on iterator position that just got wiped, you'll be debugging a ghost. Treat it as a manual cleanup tool: run it when you want a clean slate, then disconnect it. If you want programmatic, controlled resets per node, the force_reset input on BatchIteratorMultiLine is the less nuclear option.

    CategoryAsyncOutput/BatchIterator/SystemTools

    Inputs (2)

    NameTypeDefaultDescription
    silent_modeBOOLEANfalseIf True, Node Never raise Error, inturrept thread. but not recommend, because you forget it. will be disaster.
    force_clearBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    voidBOOLEAN