Memorize Int
Stash a number between Cyclist iterations so a loop can count
A loop that can't remember a number isn't much of a loop. Memorize Int is the write half of Cyclist's in-memory variable system - it stashes one integer so the next run of your workflow can read it back. That's how you build a counter, a step index, or a "best score so far" that survives from one Queue Prompt to the next, even though ComfyUI throws away all node state between runs.
Why you'd reach for it
ComfyUI has no loops, so Cyclist fakes them by re-queuing the workflow - each queue is one iteration. The problem with that trick is that nothing carries over: every run starts from a blank slate. Memorize Int (with its partner Recall Int) is the carry-over. You compute a number at the end of a run, memorize it, and at the top of the next run Recall Int pulls it back out. Classic use: increment an iteration counter, Recall Int → Int Math (add 1) → Memorize Int, so you know which pass you're on and can stop after N.
It's a sibling of Memorize Float, Memorize String and Memorize Conditioning - same mechanic, different type. One important detail from the author: for any given loop_id you get exactly one stored Int, one Float, one String and one Conditioning. They don't collide with each other (different types), but if you memorize a second Int under the same id, it overwrites the first. Want to keep two separate integers? Give them separate loop ids.
The inputs that matter
loop_id(STRING, defaultForLoop_1) - the variable name. This is the slot. Match it to theloop_idon the Recall Int that reads it back.to_memory(INT) - the number you're storing. Wire in whatever integer you want to persist.
There's no output - it's a terminal (output) node, so it sits at the end of a branch. Think of it as "commit this value," not "pass it along."
Install
- ComfyUI Manager: search comfyui-cyclist, install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/Pos13/comfyui-cyclist, restart.
No models or dependencies - it's pure Python.
What to watch out for
The big one, stated flatly by the author: memory is lost when you restart ComfyUI. This is RAM, not disk. If you need a value to survive a restart, you want the disk-based Override/Reload nodes instead, not Memorize/Recall. For an in-session loop, memory is perfect and fast; for anything you want to keep, it's the wrong tool.
Second: because storage is keyed on loop_id, be deliberate about that string. Two loops sharing an id will read and overwrite each other's Int. If you're running parallel loops, or you press "New Cycle" to start fresh, make sure each loop's id is distinct - and remember that "New Cycle" only rewrites loop_id widgets and connected Primitives, not ids coming from a String Const or Recall String node.
It's an unglamorous node, but it's load-bearing. Nearly every non-trivial Cyclist workflow has a Memorize Int somewhere doing the counting. And a fair warning that applies to the whole pack: it's archived and unmaintained. It still works, but there's nobody shipping fixes if a ComfyUI update breaks it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| loop_id | STRING | ForLoop_1 | — |
| to_memory | INT | — |
Outputs (0)
No outputs