π¦ Z2J Batch Generator
Farm prompt space without touching the seed β Z2J Batch Generator
- batch_text
- prompts_list
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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00β4294967295 | β |
| start_index | INT | 00β4294967295 | β |
| count | INT | 41β100 | Number of prompts to generate |
| profileopt | COMBO | background_default.json | 14 options: background_default.json, camera_angle_default.json, camera_distance_default.json, camera_dof_default.json, camera_focus_default.json, composition_default.json, +8 |
| separatoropt | STRING | --- | Separator between prompts |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| batch_text | STRING | β |
| prompts_list | STRING | β |