Nodes/ComfyUI-Batched-Meta/DJZ Batch Illustrator πŸ“‹
ComfyUI Node

DJZ Batch Illustrator πŸ“‹

Generate a whole book chapter by chapter from one JSON file

By MushroomFleetΒ·Created 7 months agoΒ·Updated 7 months agoΒ· 0
DJZ Batch Illustrator πŸ“‹
    • filename
    • prompt
    • width
    • height
    β—„json_fileexample_batch.jsonβ–Ί
    β—„seed0β–Ί

    Say you're illustrating a novel or a comic: forty scenes, each with its own prompt, its own aspect ratio, its own intended output name. Doing that by hand means editing forty CLIP Text Encode boxes and forty Empty Latents, and praying you queue them in order. This node exists so you don't. Drop your whole batch into one JSON file, wire up the workflow once, and let the seed walk you through every entry.

    DJZ Batch Illustrator πŸ“‹ (that clipboard emoji is part of the display name, don't @ me) ships in the ComfyUI-Batched-Meta pack from MushroomFleet. It's a small utility: it reads a JSON array of illustration entries and outputs one entry's filename, prompt, width, and height based on its seed input. That's the entire job. No model files, no Python dependencies, no API calls. The pack is a collection of these seed-driven JSON readers, and this is the one that's actually finished and documented.

    How it works

    The mechanism is one line of math hiding behind a nice UI: index = seed % total_entries. Seed 0 picks the first entry, seed 1 the second, and when you hit the end it wraps around - seed 5 on a five-entry file loops back to entry zero. So "process the whole batch" becomes "queue N generations with seeds 0 through N-1," and each run steps forward automatically.

    A few implementation details worth knowing because they bite:

    • The JSON is cached in memory after the first load. Edit the file mid-session and the node keeps serving the old copy until you restart ComfyUI or switch the json_file dropdown away and back.
    • The node prints the current entry index and filename to the console on every run, which doubles as a free progress tracker when you're burning through a 40-chapter queue.
    • It implements IS_CHANGED to re-evaluate whenever the seed or file changes - the plumbing-layer trick that stops ComfyUI's cache from silently skipping it. If you've read about the NaN footgun for always-rerun nodes, this one does it the clean way.

    The inputs and outputs that matter

    Only two inputs, both required:

    • json_file - a dropdown of every .json file in the pack's batch_illustrator_data/ folder. The folder is created automatically on first run, and an example_batch.json ships with the pack.
    • seed - an INT from 0 up to a very big number. It's your entry selector; the README's seed % total_entries math is exactly what the code does.

    Four outputs, and they map onto a normal generation graph like this: prompt β†’ CLIP Text Encode (positive), width and height β†’ Empty Latent Image, filename β†’ Save Image's filename prefix. Each entry in your JSON must have all four fields - filename as a stem with no extension, prompt as a string, width/height as integers. The included example_batch.json shows the shape.

    One design note: because the seed is doing double duty - picking the entry and acting as the sampler seed - you can't hold noise fixed while stepping through entries. Each illustration gets its own noise, which is usually fine when they're all distinct scenes. If you need identical sampling across the batch, you'd have to break the seed out of the KSampler and drive this node from a separate counter, which is a more awkward build than the author's intended flow.

    Install

    Through ComfyUI Manager, search for ComfyUI-Batched-Meta (or "DJZ Batch Illustrator"). Manual route:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/MushroomFleet/ComfyUI-Batched-Meta.git
    

    Restart ComfyUI. That's the whole install - requirements.txt is deliberately empty, just the standard library. The node lives under DJZ > Batch in the node menu, and example workflows are included in the repo.

    Common issues

    The real failure modes are all file-format errors, and the error messages name them plainly. An empty or non-array JSON raises a clear error, and an entry missing any of the four required keys raises a KeyError telling you exactly which entry and which keys are missing. The FileNotFoundError message tells you where to put the file. Where people actually get stuck: a JSON file you dropped in doesn't appear in the dropdown - that's the directory scan happening at frontend load, so restart ComfyUI, or live with the cache and reload. And remember the filename output is a stem; Save Image appends its own counter, so chapter_01_cover comes out as chapter_01_cover_00001_.png. If you find yourself debugging one batch entry forever, lock the seed and change one thing at a time - the same advice the whole community lives by.

    CategoryDJZ/Batch

    Inputs (2)

    NameTypeDefaultDescription
    json_fileCOMBOexample_batch.json1 options: example_batch.json
    seedINT00–18446744073709550000β€”

    Outputs (4)

    NameTypeDescription
    filenameSTRINGβ€”
    promptSTRINGβ€”
    widthINTβ€”
    heightINTβ€”