Memory String
A one-slot memory cell that survives between runs
- input1
- flag
- *
Most nodes forget everything the moment the graph finishes executing. Memory String is one of the small handful in this pack that don't - it holds onto a value across runs, the same stateful trick this pack's Yieldable Iterator Int uses for its counter, just generalized into a plain storage cell instead of a fixed sequence.
The shape of it is a value in (input1) and a control flag (flag) that governs whether this run updates the stored value or just hands back whatever's already sitting there. That's genuinely useful anywhere you want a graph to "remember" its last state without you manually carrying it forward - the last prompt that was actually used, a running tally, a value you only want to update conditionally instead of every single execution. It pairs naturally with anything else in this pack that produces a flag or boolean, like AAndBGate or a comparison from elsewhere in your graph, to decide when the memory updates.
How it works
On each run, it looks at flag to decide whether to store the incoming input1 as the new remembered value or leave the previously stored value untouched, then outputs whichever value is now current. Because state persists across executions the same way the iterator node's counter does, it depends on ComfyUI actually re-running the node - see the caching note below.
The inputs and outputs that matter
- input1 - typed
*, default"". The candidate value to remember. - flag - typed
*, default0. The control signal that decides whether this run'sinput1gets stored or the old value is kept. - Output - typed
*, matching whatever type is currently held in memory.
How to install it
Ships with the full LogicUtils pack. Via ComfyUI Manager: search ComfyUI-LogicUtils, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils
then restart ComfyUI. Pure Python, no models, nothing to build.
Background on the source: it's written by aria1th, publicly known as AngelBottomless, the trainer behind Illustrious XL - the SDXL anime finetune that displaced Pony Diffusion v6 as the open-source default. LogicUtils is a side project of his, and it's documented exactly as much as the README admits: "Proper documentation is being prepared, however there are too many nodes." That's held since the repo's last push in early 2026, around when his public work moved off image generation entirely. It's still a real dependency in complex published workflows next to packs like rgthree-comfy - people work out nodes like this one from the class name and defaults, same as this article.
Common issues & troubleshooting
The remembered value isn't updating. Check what you're actually feeding flag - if it's landing as falsy (0, empty string, False), the node is doing exactly what a memory cell should and holding onto the old value instead of overwriting it.
The value seems to reset on its own. Stateful nodes like this live for the duration of the ComfyUI server process - a full restart wipes them, same as any in-memory Python state. If you need something that survives a restart, this node isn't built for that; it's session memory, not persistent storage.
It's not updating between queued runs even with flag set right. ComfyUI can cache and skip re-executing a node whose upstream inputs haven't changed. If nothing else in the chain forces re-execution, the node might not actually be running on every queue - make sure something in the graph varies each time (a changing seed, a counter) if you need it to fire every run.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| input1 | * | — | |
| flag | * | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |