Loop Result Extractor
Pull results out of an accumulated batch
- accumulated_results
- extracted_data
- text_output
- count
- status
Loop Result Extractor is the "now unpack it" node. Once you've run a batch in aidec's pack and accumulated a pile of results - a collection built up across all the iterations - this is what reaches in and pulls out what you want: one specific iteration's result, everything flattened to text, or just a count of how many you gathered.
It's one of the pack's experimental nodes (the README documents the queue and loader nodes properly and files the rest under test pieces), so it's a primitive for people hand-building multi-pass workflows rather than a tool a simple batch needs. If your loop just saves an image per prompt, you'll never touch this. If your loop collects things to process together at the end, this is how you get them back out.
How it works
You feed it the accumulated results (a wildcard * input, because it's deliberately agnostic about what you've been collecting) and tell it how to extract. specific_index grabs one iteration's entry; all_as_text flattens the whole collection into a single string; count just tells you how many entries there are. When you're pulling a specific entry, an output_field selector lets you say which of up to five sub-fields (input_1 through input_5) you want - so if each iteration stored several values, you can pick the one lane you care about.
The inputs that matter
- accumulated_results - the collection to extract from. Wildcard-typed, so it takes whatever your loop was building up.
- extract_mode -
specific_index(one entry),all_as_text(everything as a string), orcount(just the number). - loop_index (optional) - which iteration to pull, in
specific_indexmode. - output_field (optional) - which sub-field (
input_1…input_5) to read, when entries hold multiple values.
Outputs: extracted_data (the pulled value, wildcard type so it can be anything), text_output (the string form - what all_as_text fills), count (how many entries), and status. Wire extracted_data when you need the typed value, text_output when you just want it as text.
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
- Shape has to match what you accumulated. The wildcard input means ComfyUI won't warn you if you feed it something that isn't the collection shape it expects - and
output_fieldonly makes sense if your entries actually have those sub-fields. If the extract comes back empty, that mismatch is the usual cause. - Index past the end. In
specific_indexmode, asking for aloop_indexbeyond what you collected gets you nothing. Checkcountfirst if you're unsure how many entries landed. - Experimental, undocumented. Like the Data Temp nodes it pairs with, this is test-tier - expect to learn it by wiring and watching
status, not by reading a manual.
Niche by design: it's the end-of-loop unpacker for the pack's advanced, roll-your-own accumulation pattern. Powerful in that context, pointless outside it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| accumulated_results | * | — | |
| extract_mode | COMBO | specific_index | 3 options: specific_index, all_as_text, count |
| loop_indexopt | INT | 00–1000 | — |
| output_fieldopt | COMBO | input_1 | 5 options: input_1, input_2, input_3, input_4, input_5 |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| extracted_data | * | — |
| text_output | STRING | — |
| count | INT | — |
| status | STRING | — |