StackPushInt
Hand an integer to the next workflow instead of hardcoding it twice
StackPushInt writes a whole number to a stack on disk, so a later workflow can read it back with StackPopInt. It's the numeric sibling of StackPushString, and it exists for the same reason: when you split a pipeline into separate workflows to stop loading two heavy models at once, the numbers still need to travel between them.
The README's own example is the best one. Give one push node the key width, another the key height, then have the second workflow pop width and height when it builds its latent. Workflow A decides the resolution by generating; workflow B inherits it without you keeping the values in sync by hand. Same pattern works for seeds, step counts, batch sizes - any integer you want one workflow to produce and another to consume.
Two inputs, both obvious:
- numbervalue - the integer to save.
- key - the stack's name (default
"default"). The pop node must use the same key.
stackpath is optional; the default ./ComfyUI/Stack/ folder under your ComfyUI install is fine.
How it works
Boring on purpose: the node writes the number as text into a timestamped ._nu file in ComfyUI/Stack/<key>/. Timestamps give the files an order, which is what lets the pop side treat the newest as the top of the stack. The file is plain text - open it and you'll see your integer. And because it's on disk, the value survives ComfyUI restarts, which in-memory workflow data doesn't.
One subtlety: the node fires every time the queue hits it, even if the value hasn't changed. That's deliberate - the pack marks every node as changed so fresh data always flows to the other workflow.
Install
Identical to every node in the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/concarne000/ComfyUI-Stacker
then restart ComfyUI. ComfyUI Manager also works - search "ComfyUI-Stacker". There are no models to download and the only listed dependency is pickle, which ships with Python, so this installs clean.
Gotchas
- Key match matters.
"width"in,"Width"out, and you've created two stacks instead of one. Keys are case-sensitive. - The stack path is relative to where ComfyUI is launched from. Launch from a weird directory and your stacks follow.
- Pushing never deletes, but popping does by default - StackPopInt consumes the file after reading unless you use
Peekmode. For values you want around for every run, push them fresh or peek.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | default | — |
| numbervalue | INT | — | |
| stackpathopt | STRING | ./ComfyUI/Stack/ | — |
Outputs (0)
No outputs