AI2Go Prompt Batch
Walk a pasted JSON list of prompts, one per queued run — the text analog of the Batch Upscale example's "Load Image Batch + increment index" trick. - prompts_json: a JSON array of prompts. Each entry is an object with a required 'positive' and an optional 'negative' (a plain string entry is treated as positive-only). Example: [{"positive": "a red fox, 8k", "negative": "blurry"}, {"positive": "a neon city"}]. - Rows editor (front-end): edit prompts as positive/negative text boxes; "➕ Add Prompt" / "🗑 Clear All" manage the list. The rows are kept in sync with the hidden prompts_json field, which is what actually runs. - json_in: optional STRING socket. "📥 Read from JSON" imports a connected node's JSON list into the rows. Ignored at run time — the rows are authoritative. - index: which prompt to emit this run (0-based). The front-end advances it by 1 after each queued run, so it walks 0,1,2… across a queued batch. - reset_index_at_batch_start: (front-end) zero the index when a new batch is queued so every batch starts from the first prompt. Click "Check for prompts" to validate the JSON, count the prompts, and reset the index to 0 — then set the ComfyUI queue count to that number. Outputs the current prompt's positive and negative strings and the 0-based index used this run (handy as a SaveImage filename suffix); if the index overshoots the list it clamps to the last prompt.
- positive
- negative
- index
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| prompts_json | STRING | [ { "positive": "a red fox in the snow, highly detailed, 8k", "negative": "blurry, watermark" }, { "positive": "a neon-lit city street at night, cinematic", "negative": "" } ] | Authoritative prompt list as JSON. Hidden in the UI and kept in sync with the row editor by the front-end — edit the rows, not this. |
| index | INT | 00–1000000 | Which prompt to emit this run (0-based). The front-end advances it by 1 after each queued run so the batch walks the list. "Check for prompts" resets it to 0. |
| reset_index_at_batch_start | BOOLEAN | true | When on, the index is reset to 0 at the start of every queued batch, so each batch starts from the first prompt. Off = the index keeps its value between batches. |
| delete_empty_prompts | BOOLEAN | true | When on, prompts with an empty 'positive' are dropped when you press "Check for prompts" and just before a batch is queued, so blank rows never break a run or throw off the count. |
| json_inopt | STRING | Optional STRING socket. Wire a text/primitive node holding a JSON prompt list here, then press "Read from JSON" to import it into the rows. Ignored at run time — the rows you edit are what actually run. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| positive | STRING | — |
| negative | STRING | — |
| index | INT | — |