ComfyUI Node

Data Temp Set

Stash data in a session variable across loop runs

By aidec·Created 2 years ago·Updated 9 months ago· 19
Data Temp Set
  • image_data
  • any_data
  • status
  • preview
  • array_size
  • info
var_namemy_var
operationset_variable
data_typetext
text_data
array_index0

Here's the problem Data Temp Set is trying to solve. In aidec's batch pack, a "loop" is really the same workflow run over and over, once per item, driven by a queue counter. Each run is independent - which is great for isolation, but it means there's nowhere to accumulate anything. Generate a caption on iteration 3 and it's gone by iteration 4. Data Temp Set gives you a place to stash things that survives from one run to the next: a named variable (or an array) living in ComfyUI's session memory.

Fair warning up front: this is one of the pack's experimental nodes. The README documents the queue processors and loaders in detail and lumps the rest under "test nodes." So think of Data Temp Set as a build-your-own-loop primitive - genuinely handy if you're assembling something the polished nodes don't cover, but rough around the edges and light on documentation. If you just want to run a prompt list, you don't need this.

How it works

It writes into a session-wide store keyed by a variable name. You choose what kind of write with operation: set a value outright, push onto an array (the interesting one - call it each iteration and you build up a list across the whole batch), set a specific array slot, or clear things out. Because the store lives in the running ComfyUI process, whatever you set stays readable by Data Temp Get on later runs, until you clear it or restart.

The inputs that matter

  • var_name - the name you'll read it back by. my_var is the placeholder; give it something meaningful.
  • operation - set_variable, array_push, array_set_index, clear_all, or clear_index. For accumulating results across a loop, array_push is the one.
  • data_type - text, image, or any. Match it to what you're storing.
  • text_data / image_data / any_data (optional) - the actual payload, whichever type applies.
  • array_index (optional) - the slot, for the index-specific operations.

Outputs: status, array_size (how many items are in the array now - useful for tracking a growing accumulation), info, and a preview image. Data Temp Set is an output node, so it can sit at the end of a branch and do its write without needing a consumer.

Installing it

cd ComfyUI/custom_nodes && git clone https://github.com/aidec/Comfyui_TextBatch_aidec, then restart ComfyUI (or ComfyUI Manager → Install via Git URL). No models, no heavy dependencies. Category: TextBatch.

Where people get burned

  • State outlives your run. That's the feature and the footgun. Values persist in the session, so if you start a fresh batch without clearing, you're appending to last batch's leftovers. Use a clear_all at the start of a run, or a fresh var_name, so you're not accumulating on top of stale data.
  • Name typos are silent. Set under results and read from result and you'll just get nothing - no error, no hint. Keep the variable name identical between Set and Get.
  • It's experimental. Thin error handling, no real docs. Prototype small, confirm the array is growing the way you expect (watch array_size), then build on it.
  • Restart wipes it. This is session memory, not disk. Restart ComfyUI and it's gone - don't treat it as durable storage.

Powerful in the "I'm hand-building a loop that collects results" sense. Skip it entirely for a plain prompt-list batch.

CategoryTextBatch

Inputs (7)

NameTypeDefaultDescription
var_nameSTRINGmy_var
operationCOMBOset_variable5 options: set_variable, array_push, array_set_index, clear_all, clear_index
data_typeCOMBOtext3 options: text, image, any
text_dataoptSTRING
image_dataoptIMAGE
any_dataopt*
array_indexoptINT00–10000

Outputs (4)

NameTypeDescription
statusSTRING
previewIMAGE
array_sizeINT
infoSTRING