Nodes/ComfyUI-AI2Go-Utils/AI2Go Prompt Batch
ComfyUI Node

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.

By Little-God1983·Created 2 months ago·Updated 26 days ago· 1
AI2Go Prompt Batch
    • positive
    • negative
    • index
    prompts_json[ { "positive": "a red fox in the snow, highly detailed, 8k", "negative": "blurry, watermark" }, { "positive": "a neon-lit city street at night, cinematic", "negative": "" } ]
    index0
    reset_index_at_batch_starttrue
    delete_empty_promptstrue
    json_in
    CategoryAI2Go/text

    Inputs (5)

    NameTypeDefaultDescription
    prompts_jsonSTRING[ { "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.
    indexINT00–1000000Which 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_startBOOLEANtrueWhen 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_promptsBOOLEANtrueWhen 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_inoptSTRINGOptional 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)

    NameTypeDescription
    positiveSTRING
    negativeSTRING
    indexINT