create LIST from JSON string
The missing step between a JSON array and an actual loop
- list
Almost every "how do I make ComfyUI do this 40 times" question ends up in the same place: you need a list of things, and the list arrives as JSON. Forty prompts in a file, twelve LoRA filenames from a CivitAI export, a set of settings an LLM just wrote for you - all arrays, all sitting outside the graph. This node walks them in. json_string in, a real LIST out, no Python and no scripting node.
The mechanism, and the distinction that matters
Parsing is json.loads plus one check: if the result isn't a list, you get The JSON string must be a JSON array (enclosed in square brackets), not <type>, and invalid JSON gives you the decoder's own complaint. Simple.
The part worth reading twice is what kind of list you get. The pack's README lays out three collection types, and beginners conflate the first two constantly:
- LIST - a Python list held as a single variable. Ordered, duplicates preserved, and you work on it as a unit:
get item,slice,length,sort,reverse,contains,index. - Data list - ComfyUI's native list, where items are processed individually. Wire one into a node and that node runs once per item, in that parallel-mapping way ComfyUI does.
This node produces the first one. If what you actually want is "run the sampler once per prompt", you are one node away: the pack's convert to Data List turns your LIST into a data list, and the same downstream graph suddenly executes per item instead of once. Skip that step and you have a perfectly good list that nothing loops over - which is the single most common "why does my workflow only make one image" moment with this pack.
So: LIST when you want to index, sort, slice or pass the collection around; converted to a data list when you want ComfyUI to chew through it.
Inputs and output
json_string (required, STRING) is the only input - a text widget defaulting to [], describing itself as a JSON array like [1, 2, 3]. It's connectable, so the natural pattern is a file: the pack's load STRING from file reads a .json off disk, and its output feeds straight in here. Edit the array, re-run. Save changes back out with save STRING to file if you're round-tripping a preset.
The single output, list, is the parsed LIST.
An array of plain strings gives you a list of strings; an array of objects gives you a LIST whose entries are DICTs, and get item hands you one of them to feed into the pack's get node. Nested arrays nest as you'd expect.
Standing it up in a real workflow
Once a week someone on r/comfyui asks how to do the same thing forty times with one variable changed, and the thread usually ends with someone iterating a JSON array - that pattern is exactly what this node is for, and it's why the pack shows up in those threads more than its 49 stars would suggest. The chain is short:
load STRING from file → create LIST from JSON string → convert to Data List → (your per-item graph)
Everything downstream - prompt encode, sampler, filename - runs once per entry. An empty result is the other half of that story: a filter that matches nothing is what the pack's continue if not empty node exists to catch.
Where it goes wrong
- Not valid JSON. Single quotes instead of double, a trailing comma after the last element, a stray comment. The error names the problem and the position, so read it rather than re-pasting blindly. This bites hardest when a text file was written by hand or by a model.
- Wrong bracket type. If the error says the string must be an array "not dict", you've got an object on your hands - use
create DICT from JSON stringand pull fields out instead. Genuinely different data, genuinely different node. - Whitespace-only or empty widget. Clearing the text box makes it default to an empty string, which is not valid JSON. Use
[]if you mean empty. (An empty array parses fine - it's just a list with nothing in it, and everything downstream then maps over zero items, which is wherecontinue if not emptyearns its keep.) - No loop. Covered above, and it's the one people lose an evening to.
Installing it
Part of Basic data handling by StableLlama - GPL-3.0, zero runtime dependencies (the package declares none), nothing to download, so the install is instant. Manager: search "Basic data handling", install, restart ComfyUI. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
# restart ComfyUI
The display name is lowercase - create LIST from JSON string - and it lives under Basic/LIST. It landed in 2.0.0 (September 2026) together with create DICT from JSON string and continue if not empty, so if your pack predates that, update it first. The author is active in r/comfyui and updates the pack often, which for a purely-local, dependency-free utility pack is most of what you want from it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| json_string | STRING | [] | STRING containing a JSON array to parse, e.g. [1, 2, 3]. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| list | LIST | The LIST parsed from the JSON array string. |