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
- Dispatch launches newsletter infrastructure built for AI agents, one API call to publish — RichardsonDx · 2026-10-16
- Creator shares the agent-powered system behind millions of monthly impressions — VibeMarketer_ · 2026-10-16
- Devs say LLM coding mistakes are a different class: overcomplication, inferred limits, worse at higher reasoning — Mu5_ · 2026-10-16
- How do you debug bad agent runs when you already have tracing? — Sensitive-Parsnip-12 · 2026-10-16
- Where does pre-task context live for agents? Devs debate workflows beyond handoff — shishen2026 · 2026-10-16
- No-instruction autonomous agent wakes up, sets own goals, and tries hacking by default — sethlazar · 2026-10-16