Image list from JSON
Generating a batch of placeholder canvases sized to your JSON
- json_input
- ui_widget
- image
- image_list
- keys
- nr
- width
- height
The name suggests this loads actual images referenced somewhere in a JSON blob - it doesn't. Worth saying plainly upfront so you don't go looking for a file_path field that isn't there: LF_ImageListFromJSON generates a batch of blank or noise canvases, and the number of them comes from how many keys your json_input object has. It's a scaffolding node, not an image loader.
The mechanism: pass in a JSON object, and the node counts its top-level keys to decide batch size. Each canvas it produces is width by height pixels (both default 1024), optionally filled with random noise instead of a flat blank if add_noise is on (default true), seeded by seed (default 42) so the noise pattern is reproducible run to run. Six outputs come back: image, a single canvas; image_list, the full batch as a list; keys, the JSON object's key names passed through as a string list (so you know which canvas corresponds to which key, by position); nr, the count that decided your batch size; and width/height, echoed back so downstream nodes that need those dimensions don't have to have them retyped separately.
Where this is genuinely useful: pairing it with something like LF_StringTemplate, which takes a JSON list of replacement dictionaries and produces one string per entry. If you want a matching batch of placeholder images - one per template variation - sized correctly before something else paints real content into them, this node gives you that batch without manually counting how many entries you have.
It's worth thinking of this less as an "image" node and more as a JSON-to-batch adapter that happens to output images. The pixel content it produces - blank or noise, depending on add_noise - is intentionally throwaway; nothing here is meant to survive to a final render. What matters is the batch size and shape matching some other JSON-driven step in your graph, and the keys output existing so you can still identify which slot in the batch corresponds to which original entry once you're several nodes downstream and the JSON itself is out of view.
Installing it. ComfyUI Manager: search "LF Nodes," install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/lucafoscili/lf-nodes, then restart. Use that repo - comfy.icu links comfyui-lf, the pack's archived original home; the author's active development is at lf-nodes now. No models, no heavy dependencies.
Where people get tripped up. The name is genuinely misleading if you're expecting it to fetch real image content by key - it won't, and there's no schema field for image paths or URLs, so don't spend time hunting for one. Second, batch size is driven purely by key count, not key values - a JSON object with five keys produces five canvases regardless of what those keys' values actually contain, so this is really about matching a batch size to another JSON-driven node, not about the JSON's content mattering directly here.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| json_input | JSON | Input JSON containing keys to determine batch size. | |
| add_noise | BOOLEAN | true | Add noise to the images. |
| width | INT | 1024 | Width of the images. |
| height | INT | 1024 | Height of the images. |
| seed | INT | 42 | Seed for generating random noise. |
| ui_widgetopt | KUL_MASONRY | [object Object] | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image_list | IMAGE | — |
| keys | STRING | — |
| nr | INT | — |
| width | INT | — |
| height | INT | — |