This ComfyUI tutorial workflow automates running a list of text prompts one-by-one and saving an image for each entry. It uses the custom FL_PromptSelectorBasic node to read a multiline prompt list and select a single line based on an index provided by a PrimitiveInt node. That selected prompt is then fed into the generation chain powered by the Z-Image-Turbo model, and the resulting image is written to disk by SaveImage. A MarkdownNote in the graph documents the intent and wiring so you can quickly see how the pieces fit together.

Under the hood, FL_PromptSelectorBasic exposes a text field where you paste prompts (one per line). The PrimitiveInt node supplies an index that determines which line is currently active. In a batch run, the index advances one step per batch iteration (when driven by your generation/driver node; listed here as ca7506c4-0f1a-4a77-9d2e-b9077eaf58d5), so each iteration consumes the next prompt from the list. This pattern is ideal for prompt A/B testing, producing sets of assets, or iterating through a campaign brief without manually editing the graph between runs.

API

Use this workflow from code

Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.

GET https://comfy.org/workflows/download/2da831d21d09.json
Fetching workflow JSON…

Run it from Python or TypeScript with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.

# Install (beta)
pip install comfy-sdk        # Python
npm i @comfyorg/sdk          # TypeScript

# Run "Batch Process Text Prompts From List" (Python)
from comfy_sdk import Comfy

client = Comfy(api_key="comfyui-...")

# This workflow, exported in API format (see note below)
wf = client.workflows.from_file("utility_text_lists_select_prompt_api.json")

job = client.run(wf)
for output in job.get_outputs("36"):  # SaveImage
    output.to_file(output.name)

The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API). API access requires a Comfy Cloud plan with an API key. SDK docs · Get an API key

FAQ

Frequently Asked Questions

View all workflows
Character
Cinematic
Image to Video
Lip Sync
Multiple Angles
Portrait
Style Reference
Style Transfer
Text to Video
Video Generation
Video
Showing 30 of 30 templates