Generate thousands of organized, production-ready images for any domain.
YouTube channels · Content creators · Marketing teams · AI researchers
ai-image-library-generator is a Python automation script that turns a YAML configuration file into a massive, organized image library — using your local ComfyUI instance as the engine.
Instead of clicking through a UI one image at a time, you define your content plan in a YAML file and let the batch runner do everything: pick subjects, compose prompts, generate images, upscale them, and organize the output into a clean folder structure ready for publishing.
It was originally built to power a dog training YouTube channel with 10,000+ photorealistic images. Now it's fully domain-agnostic — use it for dogs, people, food, medical illustrations, real estate, e-commerce, or anything you can describe in a prompt.
| Role | Use case |
|---|---|
| YouTube creators | Build a consistent visual library for thumbnails, shorts, and video covers |
| Content marketers | Generate on-brand product and lifestyle imagery at scale |
| AI researchers | Create structured datasets for computer vision and fine-tuning |
| Indie hackers | Automate stock photo production for niche content sites |
| Agencies | Produce client deliverables 10× faster with reproducible configs |
Set it running, come back to thousands of organized images. Automatic resume — interrupted runs pick up exactly where they left off.
Every creative decision lives in a YAML file, not in the code. Change your content strategy without touching a single line of Python.
Ships with a library-dogs.yaml example, but works for any subject matter. Define your own subjects-*.yaml lists and negatives-*.yaml prompts for any domain.
- Juggernaut XL — photorealistic, fast, default
- FLUX Schnell GGUF — maximum quality, quantized for consumer GPUs
- SDXL Turbo — ultra-fast previews
- RealVisXL — alternative photorealism
Generate video thumbnails (1920×1080), YouTube Shorts (1080×1920), and long-form thumbnails (1280×720) in a single run.
Scan your library, see exactly which scenes are complete vs. missing images, and get copy-paste batch commands to fill the gaps overnight.
Clean folder hierarchy: library/<category>/<subcategory>/<subject>/. New images get a _new suffix for review; approved images are clean. Integrates with the companion i-generator-review.py script.
# 1. Install dependencies
pip install -r requirements.txt
# 2. Configure your environment
cp defaults.yaml.example defaults.yaml
# Edit defaults.yaml with your ComfyUI path
# 3. Preview what will be generated
python i-generator-batch.py \
--config libraries/library-dogs.yaml \
--dry-run
# 4. Generate your first batch
python i-generator-batch.py \
--config libraries/library-dogs.yaml \
--categories training \
--count 2 \
--subject-count 3Full installation guide (macOS, Linux, Windows + ComfyUI setup): docs/installation.md
The script reads your YAML, resolves all combinations of topics × scenes × subjects, and submits them to ComfyUI one by one.
YAML Config
↓
Topic × Scene combinations
↓
Subject sampling (random N from your list, or full list)
↓
Prompt assembly: "{subject_template}, {topic prompt}, {scene setting}, photorealistic, 4k"
↓
ComfyUI API → Generate → Upscale → Save
↓
Organized folder structure with _new suffix
↓
i-generator-review.py → Approve (remove _new) or Delete (regenerates next run)
storage/library/
├── training/
│ ├── basic_commands/
│ │ ├── german_shepherd/
│ │ │ ├── video_hd_sit_command_sunny_park_001-a3f2c891_new.jpg ← pending review
│ │ │ ├── video_hd_sit_command_sunny_park_002-b4d1e720.jpg ← approved
│ │ └── golden_retriever/
│ └── positive_reinforcement/
└── shorts/
└── training/
└── basic_commands/
# libraries/library-dogs.yaml
meta:
label: "Dog Training Channel"
default_subjects: "subjects/subjects-dogs.yaml"
default_negative: "negatives/negative-dogs.yaml"
settings:
images_per_topic: 3
subjects_per_topic: 5
scene_library:
sunny_park: "sunny public park, green grass, warm midday light"
golden_hour: "open field, golden hour warm light, soft bokeh"
categories:
training:
label: "Dog Training"
subcategories:
basic_commands:
label: "Basic Commands"
topics:
- angle: "sit command"
prompt: >
dog sitting perfectly still, attentive expression,
ears forward, bright eyes, calm posture
scenes: [sunny_park, golden_hour]python i-generator-batch.py [OPTIONS]
Required:
--config PATH YAML library configuration file
Generation:
--subjects PATH YAML subjects file (overrides config default)
--negative PATH YAML negative prompt file (overrides config default)
--categories SLUG+ Filter by category slug(s)
--subcategories SLUG+ Filter by subcategory slug(s)
--formats FORMAT+ video_hd · thumbnail_long · video_shorts
--model MODEL juggernaut · flux · turbo · realvis
--subject-count N Subjects per topic (0 = all)
--subject-list SLUG+ Explicit subject list
--scenes SLUG+ Filter by scene slug(s)
--count N Images per topic×subject combination
Workflow:
--dry-run Preview plan without generating
--list-categories Show all categories, topics, and scenes
--audit Scan library and report coverage
--audit-shorts Same as --audit for the shorts format
--target N Target images per scene for audit (default: 40)
| Model key | Architecture | VRAM | Speed | Best for |
|---|---|---|---|---|
juggernaut |
SDXL (checkpoint) | 6 GB | ⚡⚡⚡ | Daily runs, photorealism |
flux |
FLUX Schnell GGUF | 6 GB | ⚡ | Maximum quality overnight |
turbo |
SDXL Turbo | 6 GB | ⚡⚡⚡⚡ | Quick previews, Shorts |
realvis |
SDXL (checkpoint) | 6 GB | ⚡⚡⚡ | Alternative photorealism |
- Python 3.11+
- ComfyUI running on
localhost:8188 - At least one supported model downloaded
- 6+ GB VRAM (NVIDIA GPU recommended; Apple Silicon supported; CPU fallback available)
pip install pyyaml pillow requests
- Web UI for library audit and review
- Parallel generation (multiple ComfyUI instances)
- Stable Diffusion 3 model support
- Google Drive / S3 upload integration
- Automatic subject prompt enhancement via local LLM
-
library-health.yaml,library-food.yamlexample packs
| Tier | Price | License |
|---|---|---|
| Solo | $29 one-time | 1 licensed user, personal or commercial use, unlimited image generation |
| Creator | $59 one-time | 1 licensed user, commercial use, client deliverables allowed |
| Studio | $149 one-time | Up to 5 licensed users, agencies and teams |
| Enterprise | Contact | Unlimited users, white-label rights, priority support |
All tiers include lifetime access to the version purchased and free updates within the same major version.
Redistribution, resale, and sublicensing are strictly prohibited. See LICENSE.txt.
Buy Solo License → · Buy Creator License → · Buy Studio License →
Found a bug or have a question? Open an issue and include your OS, Python version, and the error message.
Feature requests are welcome via issues and are considered for future releases.
This software is proprietary and commercially licensed. All rights reserved.
Copying, redistribution, sublicensing, and resale are strictly prohibited.
See LICENSE.txt for the full terms.
Built with ❤️ by creators, for creators.
If this saved you time, consider starring the repo ⭐