Image Generation Workflow Engine
Build production image generation pipelines with FLUX, Stable Diffusion 3.5, ControlNet, LoRA, and ComfyUI for automated creative workflows.
Activation Triggers
Activate on : "image generation pipeline", "ComfyUI workflow", "ControlNet conditioning", "LoRA training", "FLUX generation", "Stable Diffusion pipeline", "batch image generation", "img2img workflow", "inpainting pipeline"
NOT for : Video generation from images (ai-video-production-master), image classification or object detection (computer-vision-pipeline), or multimodal search embeddings (multimodal-embedding-generator)
Quick Start
Choose model — FLUX.1-dev for quality, FLUX.1-schnell for speed, SD 3.5 for ControlNet ecosystem, SDXL for LoRA abundance.
Design workflow — Text-to-image (simplest), img2img (style transfer), ControlNet (structural guidance), inpainting (targeted edits).
Build pipeline — ComfyUI for visual node graphs, diffusers library for code-first, or API services (Replicate, fal.ai) for managed.
Add conditioning — ControlNet (canny, depth, pose), IP-Adapter (style transfer), LoRA (fine-tuned concepts).
Automate — Batch generation with parameter sweeps, quality filtering, and output organization.
Core Capabilities
Domain
Technologies
Notes
Models
FLUX.1-dev/schnell, SD 3.5, SDXL, Kandinsky 3
FLUX is 2025-2026 standard for quality
Conditioning
ControlNet (canny, depth, pose, segmentation), IP-Adapter
Structural and style guidance
Fine-Tuning
LoRA, DreamBooth, textual inversion
Custom concepts in 20 min on consumer GPU
Workflows
ComfyUI, diffusers (Python), A1111
ComfyUI for complex multi-step; diffusers for code
APIs
Replicate, fal.ai, Together AI, HF Inference
Managed GPU, pay-per-image
Local
qwen-image-mps (Apple Silicon), CUDA, ROCm
M4 Max: FLUX.1-schnell in 4-8 sec/image
Architecture Patterns
Pattern 1: ComfyUI Production Pipeline
[Load Checkpoint] ──→ [CLIP Text Encode] ──→ [KSampler] ──→ [VAE Decode] ──→ [Save Image]
│ │ │
FLUX.1-dev positive + negative steps: 20-30
or SD 3.5 prompts with weights cfg: 3.5-7.5
scheduler: euler
│
[ControlNet Apply] (optional)
│
canny/depth/pose
from reference image
ComfyUI workflows are JSON-serializable. Store them in version control:
workflows/
├── txt2img-flux-base.json # Basic FLUX text-to-image
├── controlnet-canny-sd35.json # Canny edge guided generation
├── lora-character-flux.json # Character LoRA application
├── inpaint-background-swap.json # Background replacement
└── batch-product-shots.json # Automated product photography
Pattern 2: Code-First with diffusers
# FLUX.1-dev with ControlNet conditioning
from diffusers import FluxPipeline, FluxControlNetPipeline
from diffusers.utils import load_image
import torch
# Basic text-to-image
pipe = FluxPipeline.from_pretrained(
"black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16
).to("cuda")
image = pipe(
prompt="A cozy library with warm lighting, bookshelves floor to ceiling",
num_inference_steps=28,
guidance_scale=3.5,
width=1024, height=1024,
).images[0]
# Batch generation with parameter sweep
params = [
{"guidance_scale": 3.0, "num_inference_steps": 20},
{"guidance_scale": 3.5, "num_inference_steps": 28},
{"guidance_scale": 4.0, "num_inference_steps": 35},
]
for i, p in enumerate(params):
img = pipe(prompt=prompt, **p).images[0]
img.save(f"output/sweep_{i}_cfg{p['guidance_scale']}.png")
Pattern 3: LoRA Training and Application
Training:
20-50 images of concept ──→ [kohya_ss / ai-toolkit] ──→ LoRA weights (.safetensors)
│
captioned with BLIP/Florence2
trained 1000-3000 steps
rank 16-32, alpha = rank
Application:
[Base Model] + [LoRA weights @ strength 0.6-0.9] ──→ [Generate with trigger word]
File organization:
loras/
├── character-alice-v2.safetensors # trigger: "alice_character"
├── style-watercolor-v1.safetensors # trigger: "watercolor_style"
└── product-shoe-v3.safetensors # trigger: "brandx_shoe"
Anti-Patterns
CFG scale too high — FLUX works best at 3.0-4.0 CFG. Using 7-12 (old SD habits) produces oversaturated, artifact-heavy images. Check model-specific recommendations.
Ignoring negative prompts where supported — SD 3.5 and SDXL benefit from negative prompts ("blurry, low quality, distorted"). FLUX does not use negatives the same way.
Training LoRA on uncaptioned data — Images without accurate captions produce LoRAs that activate unpredictably. Always caption training data with BLIP-2 or Florence-2.
No seed tracking — Without recording seeds, you cannot reproduce good results or iterate systematically. Always log seed, prompt, and all parameters.
Single-image evaluation — Generating one image and judging the model is like evaluating a coin flip from one toss. Generate 4-8 images per prompt and evaluate the distribution.
Quality Checklist
Model chosen based on use case: FLUX for quality, schnell for speed, SD 3.5 for ControlNet
CFG scale appropriate for model (FLUX: 3.0-4.0, SD 3.5: 4.0-7.5, SDXL: 7.0-12.0)
Seeds logged for every generation (reproducibility)
ControlNet conditioning validated: reference image preprocessed correctly
LoRA training data captioned with automated tool (BLIP-2, Florence-2)
Batch generation used for evaluation (minimum 4 images per prompt)
Output organized with metadata (prompt, seed, model, params in filename or sidecar)
ComfyUI workflows version-controlled as JSON
GPU memory managed: model offloading for large models, attention slicing for VRAM limits
Generation latency profiled: target < 10 sec for interactive, < 60 sec for batch
1 --- 2 license: Apache-2.0 3 name: image-generation-workflow-engine 4 description: "Build image generation pipelines with Stable Diffusion, FLUX, ControlNet, LoRA, and ComfyUI workflows. Activate on: image generation pipeline, ComfyUI workflow, ControlNet, LoRA training, diffusion model. NOT for: video generation (ai-video-production-master), image classification (computer-vision-pipeline)." 5 allowed-tools: Read,Write,Edit,Bash(python:*,pip:*,npm:*,npx:*) 6 category: AI & Machine Learning 7 tags: 8 - image-generation 9 - stable-diffusion 10 - flux 11 - comfyui 12 - lora 13 pairs-with: 14 - skill: ai-video-production-master 15 reason: Generated images serve as keyframes and style references for video pipelines 16 - skill: computer-vision-pipeline 17 reason: CV preprocessing (segmentation, depth) feeds ControlNet conditioning 18 - skill: multimodal-embedding-generator 19 reason: CLIP/SigLIP embeddings guide generation and enable style search 20 metadata: 21 source: https://skillmd.com/skills/curiositech/image-generation-workflow-engine 22 --- 23 24 # Image Generation Workflow Engine 25 26 Build production image generation pipelines with FLUX, Stable Diffusion 3.5, ControlNet, LoRA, and ComfyUI for automated creative workflows. 27 28 ## Activation Triggers 29 30 **Activate on**: "image generation pipeline", "ComfyUI workflow", "ControlNet conditioning", "LoRA training", "FLUX generation", "Stable Diffusion pipeline", "batch image generation", "img2img workflow", "inpainting pipeline" 31 32 **NOT for**: Video generation from images (ai-video-production-master), image classification or object detection (computer-vision-pipeline), or multimodal search embeddings (multimodal-embedding-generator) 33 34 ## Quick Start 35 36 1. **Choose model** — FLUX.1-dev for quality, FLUX.1-schnell for speed, SD 3.5 for ControlNet ecosystem, SDXL for LoRA abundance. 37 2. **Design workflow** — Text-to-image (simplest), img2img (style transfer), ControlNet (structural guidance), inpainting (targeted edits). 38 3. **Build pipeline** — ComfyUI for visual node graphs, diffusers library for code-first, or API services (Replicate, fal.ai) for managed. 39 4. **Add conditioning** — ControlNet (canny, depth, pose), IP-Adapter (style transfer), LoRA (fine-tuned concepts). 40 5. **Automate** — Batch generation with parameter sweeps, quality filtering, and output organization. 41 42 ## Core Capabilities 43 44 | Domain | Technologies | Notes | 45 |--------|-------------|-------| 46 | **Models** | FLUX.1-dev/schnell, SD 3.5, SDXL, Kandinsky 3 | FLUX is 2025-2026 standard for quality | 47 | **Conditioning** | ControlNet (canny, depth, pose, segmentation), IP-Adapter | Structural and style guidance | 48 | **Fine-Tuning** | LoRA, DreamBooth, textual inversion | Custom concepts in 20 min on consumer GPU | 49 | **Workflows** | ComfyUI, diffusers (Python), A1111 | ComfyUI for complex multi-step; diffusers for code | 50 | **APIs** | Replicate, fal.ai, Together AI, HF Inference | Managed GPU, pay-per-image | 51 | **Local** | qwen-image-mps (Apple Silicon), CUDA, ROCm | M4 Max: FLUX.1-schnell in 4-8 sec/image | 52 53 ## Architecture Patterns 54 55 ### Pattern 1: ComfyUI Production Pipeline 56 57 ``` 58 [Load Checkpoint] ──→ [CLIP Text Encode] ──→ [KSampler] ──→ [VAE Decode] ──→ [Save Image] 59 │ │ │ 60 FLUX.1-dev positive + negative steps: 20-30 61 or SD 3.5 prompts with weights cfg: 3.5-7.5 62 scheduler: euler 63 │ 64 [ControlNet Apply] (optional) 65 │ 66 canny/depth/pose 67 from reference image 68 ``` 69 70 ComfyUI workflows are JSON-serializable. Store them in version control: 71 72 ``` 73 workflows/ 74 ├── txt2img-flux-base.json # Basic FLUX text-to-image 75 ├── controlnet-canny-sd35.json # Canny edge guided generation 76 ├── lora-character-flux.json # Character LoRA application 77 ├── inpaint-background-swap.json # Background replacement 78 └── batch-product-shots.json # Automated product photography 79 ``` 80 81 ### Pattern 2: Code-First with diffusers 82 83 ```python 84 # FLUX.1-dev with ControlNet conditioning 85 from diffusers import FluxPipeline, FluxControlNetPipeline 86 from diffusers.utils import load_image 87 import torch 88 89 # Basic text-to-image 90 pipe = FluxPipeline.from_pretrained( 91 "black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16 92 ).to("cuda") 93 94 image = pipe( 95 prompt="A cozy library with warm lighting, bookshelves floor to ceiling", 96 num_inference_steps=28, 97 guidance_scale=3.5, 98 width=1024, height=1024, 99 ).images[0] 100 101 # Batch generation with parameter sweep 102 params = [ 103 {"guidance_scale": 3.0, "num_inference_steps": 20}, 104 {"guidance_scale": 3.5, "num_inference_steps": 28}, 105 {"guidance_scale": 4.0, "num_inference_steps": 35}, 106 ] 107 for i, p in enumerate(params): 108 img = pipe(prompt=prompt, **p).images[0] 109 img.save(f"output/sweep_{i}_cfg{p['guidance_scale']}.png") 110 ``` 111 112 ### Pattern 3: LoRA Training and Application 113 114 ``` 115 Training: 116 20-50 images of concept ──→ [kohya_ss / ai-toolkit] ──→ LoRA weights (.safetensors) 117 │ 118 captioned with BLIP/Florence2 119 trained 1000-3000 steps 120 rank 16-32, alpha = rank 121 122 Application: 123 [Base Model] + [LoRA weights @ strength 0.6-0.9] ──→ [Generate with trigger word] 124 125 File organization: 126 loras/ 127 ├── character-alice-v2.safetensors # trigger: "alice_character" 128 ├── style-watercolor-v1.safetensors # trigger: "watercolor_style" 129 └── product-shoe-v3.safetensors # trigger: "brandx_shoe" 130 ``` 131 132 ## Anti-Patterns 133 134 1. **CFG scale too high** — FLUX works best at 3.0-4.0 CFG. Using 7-12 (old SD habits) produces oversaturated, artifact-heavy images. Check model-specific recommendations. 135 2. **Ignoring negative prompts where supported** — SD 3.5 and SDXL benefit from negative prompts ("blurry, low quality, distorted"). FLUX does not use negatives the same way. 136 3. **Training LoRA on uncaptioned data** — Images without accurate captions produce LoRAs that activate unpredictably. Always caption training data with BLIP-2 or Florence-2. 137 4. **No seed tracking** — Without recording seeds, you cannot reproduce good results or iterate systematically. Always log seed, prompt, and all parameters. 138 5. **Single-image evaluation** — Generating one image and judging the model is like evaluating a coin flip from one toss. Generate 4-8 images per prompt and evaluate the distribution. 139 140 ## Quality Checklist 141 142 - [ ] Model chosen based on use case: FLUX for quality, schnell for speed, SD 3.5 for ControlNet 143 - [ ] CFG scale appropriate for model (FLUX: 3.0-4.0, SD 3.5: 4.0-7.5, SDXL: 7.0-12.0) 144 - [ ] Seeds logged for every generation (reproducibility) 145 - [ ] ControlNet conditioning validated: reference image preprocessed correctly 146 - [ ] LoRA training data captioned with automated tool (BLIP-2, Florence-2) 147 - [ ] Batch generation used for evaluation (minimum 4 images per prompt) 148 - [ ] Output organized with metadata (prompt, seed, model, params in filename or sidecar) 149 - [ ] ComfyUI workflows version-controlled as JSON 150 - [ ] GPU memory managed: model offloading for large models, attention slicing for VRAM limits 151 - [ ] Generation latency profiled: target < 10 sec for interactive, < 60 sec for batch