Nodes/ComfyUI-Zero2JSON/πŸ“¦ Z2J Batch Generator
ComfyUI Node

πŸ“¦ Z2J Batch Generator

Farm prompt space without touching the seed β€” Z2J Batch Generator

By MushroomFleetΒ·Created 7 months agoΒ·Updated 5 months agoΒ· 1
πŸ“¦ Z2J Batch Generator
    • batch_text
    • prompts_list
    β—„seed0β–Ί
    β—„start_index0β–Ί
    β—„count4β–Ί
    β—„profilebackground_default.jsonβ–Ί
    β—„separator --- β–Ί

    The single node that makes ComfyUI-Zero2JSON feel like a system rather than a toy is the batch generator. Everything else gives you one sentence; this one gives you up to a hundred, walked through prompt space in order, all from one seed. Z2J Batch Generator is the pack's answer to "I don't know what I want - show me the neighborhood."

    It's the second utility node, and the pitch is simple: instead of bumping prompt_index by hand one node at a time, you tell it a starting index and a count, and it generates a run of consecutive prompts from whatever profile you pick. Because generation is a pure function of (seed, prompt_index), the run is gapless - index 0, 1, 2, 3… - so you're methodically exploring prompt space, not rolling dice.

    The inputs that matter

    • seed - world seed, shared across the batch.
    • start_index - where in prompt space to begin.
    • count - how many prompts, 1 to 100 (default 4).
    • profile - which vocabulary profile to use; the dropdown lists all 14 shipped profiles, so you can batch-generate camera angles or lighting setups or anything else.
    • separator - text between prompts in the combined output (default \n---\n).

    Two outputs, and they matter differently: batch_text is the whole run joined by the separator, useful for dropping into a text file or a prompt cycler; prompts_list is the same run as one prompt per line, prefixed with [0], [1]… - that's the one you want when you need to know which index produced which text so you can lock the keepers.

    How it works

    The same xxhash32 position-as-seed core as every node, just looped: it calls the generator count times with indices start_index through start_index + count - 1. No state, no cache, no randomness - run it twice and you get byte-identical batches.

    Install

    One repo, all seventeen nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MushroomFleet/ComfyUI-Zero2JSON
    cd ComfyUI-Zero2JSON
    pip install -r requirements.txt
    

    Restart ComfyUI. Only dependency: xxhash>=3.0.0. Manager users: search "ComfyUI-Zero2JSON".

    Where people get burned

    The common confusion is expecting a batch of images. This generates a batch of text - feeding all 100 prompts into a single KSampler doesn't give you 100 images, it gives you one image with a mashed-up prompt. The intended loop is: batch-generate the text, find the keepers by index, then run the good ones individually. And watch the separator - the default works, but if you're feeding output into a prompt parser, changing the separator changes where it splits. That's a feature, but it's a footgun if you forget you changed it.

    CategoryZero2JSON/Utility

    Inputs (5)

    NameTypeDefaultDescription
    seedINT00–4294967295β€”
    start_indexINT00–4294967295β€”
    countINT41–100Number of prompts to generate
    profileoptCOMBObackground_default.json14 options: background_default.json, camera_angle_default.json, camera_distance_default.json, camera_dof_default.json, camera_focus_default.json, composition_default.json, +8
    separatoroptSTRING --- Separator between prompts

    Outputs (2)

    NameTypeDescription
    batch_textSTRINGβ€”
    prompts_listSTRINGβ€”