Nodes/ComfyUI-Stacker/StackPopFloat
ComfyUI Node

StackPopFloat

Pop the last saved float — with a peek mode so you don't burn your settings

By concarne000·Created about a year ago·Updated about a year ago· 10
StackPopFloat
    • FLOAT
    keydefault
    fallback_enabledfalse
    override_enabledfalse
    stackmodeNormal
    stackpath./ComfyUI/Stack/
    fallback_item
    override_item

    StackPopFloat reads a decimal back off a stack that StackPushFloat filled and outputs it as a FLOAT. In the two-workflow pattern this pack is built for - render in one, process in another, never load two heavy models at once - this is how the second workflow picks up the CFG scale, denoise strength, or LoRA weight the first one settled on. Push cfg on the A side, pop cfg on the B side, done.

    The input set is the standard pop layout, and the two you'll actually touch are key (the stack name, must match the push side) and stackmode:

    • Normal - newest float, deleted after reading (default; consumes exactly one value per pop)
    • Peek - newest float, left in place
    • Pop Bottom - oldest float, deleted
    • Peek Bottom - oldest float, kept

    The other four inputs are the safety nets: fallback_enabled + fallback_item return a default float when the stack is empty instead of crashing (turn it on for your first run), and override_enabled + override_item bypass the stack entirely - the author's example is changing one value for a generation without re-pushing a stack. Output is a single FLOAT.

    How it works

    Identical machinery to the other pop nodes: timestamped ._fl files in ComfyUI/Stack/<key>/, sorted so the newest is the top of the stack. The node reads the newest (or oldest, in Bottom modes), converts it back to a float, and deletes the file unless you're in a Peek mode.

    Which brings up the pack's defining gotcha, worth repeating here because floats are the values you least want to lose: Normal mode deletes after reading. If the workflow errors after the pop, that float is consumed and gone - the README notes pops before an exception stay popped. For settings you want around on every run, push fresh each time or pop with Peek. And with fallback_enabled off, an empty stack throws and stops the generation; enable it once and the first-run failure mode disappears.

    Install

    Standard for the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/concarne000/ComfyUI-Stacker
    

    then restart ComfyUI, or search "ComfyUI-Stacker" in ComfyUI Manager. No models, and the only listed dependency is pickle from Python's standard library. Cleanest install in the ecosystem, frankly.

    The short version: match your keys, enable the fallback on first run, and decide deliberately whether each pop should consume. Everything else is a knob you can safely ignore.

    CategoryConCarne

    Inputs (7)

    NameTypeDefaultDescription
    keySTRINGdefault
    fallback_enabledBOOLEANfalse
    override_enabledBOOLEANfalse
    stackmodeCOMBONormal4 options: Normal, Peek, Pop Bottom, Peek Bottom
    stackpathoptSTRING./ComfyUI/Stack/
    fallback_itemoptFLOAT
    override_itemoptFLOAT

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT