Automating ComfyUI Bulk Generation with Python and Free Gemini API
Excellent_Scene7402 · reddit · 2026-08-14
The author shares an automated workflow for generating digital assets (like game textures and UI kits) in bulk using Python, the free tier of the Gemini API, and ComfyUI.
Core Pipeline:
- Input: Enter product ideas and quantities into a Google Sheet.
- Vocabulary Generation: A single Gemini API call generates a structured JSON "style vocabulary" (subjects, styles, colors), cleverly bypassing rate limits.
- Local Assembly & Rendering: Python's itertools cross-combines the vocabulary to create massive unique prompts locally, which are then pushed to local GPUs via ComfyUI's REST API.
Key Techniques:
- ComfyUI REST API: Submit workflows and modify node parameters via HTTP requests in JSON format, bypassing the browser UI.
- Single API Vocabulary: Fetches prompt "building blocks" in one call instead of per-image, saving massive API costs.
- Combinatorics: Uses algorithms to cross-combine a few subjects and compositions to effortlessly generate hundreds of unique images.
More from coding & agent
- OpenAI Engineer: Month-Long AI Agents Will Fundamentally Change Computing — jxnlco · 2026-08-14
- Solving Agent Memory Loss: KL-Divergence Compaction for Continual Learning — kalomaze · 2026-08-14
- Claude for iOS to Support Custom MCP Configuration — testingcatalog · 2026-08-14
- Pain Points of Agent Context Compaction and a Potential Solution — kalomaze · 2026-08-14
- Open-Sourcing 'Shadow Negative': Enabling Negative Prompting for MiniMax H3 — JackKerawock · 2026-08-14
- W&B to Demo World Action Models, Enabling Robots to Adapt to Unseen Tasks — wandb · 2026-08-14