Data Temp Get
Read back a session variable during a batch loop
- text
- image
- any
- array_size
- all_elements
- status
Data Temp Get is the read half of aidec's little session-variable system - the other half is Data Temp Set, which stashes things. Get pulls them back out. Together they exist because the pack's "loops" are really the same workflow run once per item, so there's no natural way to carry data between iterations. Set writes into ComfyUI's session memory on one run; Get reads it on a later one.
Like its partner, this is one of the pack's experimental "test nodes" - the README covers the queue and loader nodes properly and waves at the rest. So it's a primitive for building your own multi-pass logic, not a plug-and-play tool. Worth knowing exists; not something a straightforward batch needs.
How it works
You give it a variable name and it looks that up in the session store, returning whatever Data Temp Set put there. It handles both plain variables and arrays: with read_mode you can grab a specific index, the first or last element, or everything at once. That last-and-array behavior is what makes it useful at the end of a loop - after you've been pushing results into an array all batch, one Data Temp Get with read_mode set to all hands you the whole collection.
The inputs that matter
- var_name - the name to read, and it must match exactly what Data Temp Set wrote under.
my_varis the placeholder. - data_type -
text,image, orany, matching what you stored. - read_mode -
index,first,last, orall. Pickindexfor a specific slot,allto pull the whole array. - array_index (optional) - the slot, when in index mode.
- default_text (optional) - a fallback returned when the variable doesn't exist yet, so a first-iteration read doesn't just break.
Outputs cover every type it might return: text, image, any, plus array_size, all_elements (the whole array in one go), and status. Wire the output that matches your data_type.
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
- Name mismatch = empty read. The single most common failure. Get reads by exact name; one typo against what Set wrote and you get nothing (or your
default_text) with no error. Keep the names identical. - Reading before writing. On the first loop iteration the variable may not exist yet. Set
default_textso that first read has something sane to return instead of blowing up downstream. - Type has to line up. Store an image, read as
text, and you'll get garbage or nothing. Matchdata_typebetween Set and Get. - It's session state. Values vanish on ComfyUI restart, and they persist between batches until cleared - so a stale read can be last run's leftover. It's experimental scaffolding; verify what you're reading is what you think.
If you're accumulating results across a batch and need to fish them back out at the end, this is the node. Otherwise, leave it in the drawer.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| var_name | STRING | my_var | — |
| data_type | COMBO | text | 3 options: text, image, any |
| read_mode | COMBO | index | 4 options: index, first, last, all |
| array_indexopt | INT | 00–10000 | — |
| default_textopt | STRING | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| image | IMAGE | — |
| any | * | — |
| array_size | INT | — |
| all_elements | * | — |
| status | STRING | — |