S

Smart AI Image Generation Framework

Boost productivity with intelligent generate images using AI model APIs. Built for Claude Code with best practices and real-world patterns.

SkillCommunityaiv1.0.0MIT
0 views0 copies

AI Image Generation Framework

Comprehensive AI image generation toolkit covering prompt engineering, model selection, API integration, batch generation, and quality optimization for creating images with Stable Diffusion, DALL-E, Midjourney, and Flux models.

When to Use This Skill

Choose AI Image Generation when:

  • Generating images from text prompts for content, marketing, or products
  • Building image generation pipelines integrated into applications
  • Optimizing prompts for consistent, high-quality image output
  • Comparing different image generation models for quality and cost
  • Creating batch image generation workflows

Consider alternatives when:

  • Need photo editing — use image editing tools
  • Need consistent brand photography — hire a photographer
  • Need vector graphics — use design tools (Figma, Illustrator)

Quick Start

# Activate image generation claude skill activate smart-ai-image-generation-framework # Generate images claude "Generate a hero image for a SaaS landing page about project management" # Optimize prompts claude "Improve this prompt for better results: 'a cat sitting on a chair'"

Example: Image Generation API Integration

// Multi-provider image generation interface ImageGenerationRequest { prompt: string; negativePrompt?: string; width: number; height: number; model: string; samples: number; seed?: number; } interface ImageGenerationResult { images: { url: string; seed: number }[]; cost: number; generationTime: number; } async function generateImage(req: ImageGenerationRequest): Promise<ImageGenerationResult> { const startTime = Date.now(); // Route to appropriate provider based on model switch (req.model) { case 'flux-dev': case 'sdxl': return generateWithModelsLab(req); case 'dall-e-3': return generateWithOpenAI(req); default: throw new Error(`Unknown model: ${req.model}`); } } // Prompt engineering helper function enhancePrompt(basePrompt: string, style: string): string { const styleEnhancements: Record<string, string> = { 'photorealistic': 'professional photography, 8K UHD, sharp focus, studio lighting', 'illustration': 'digital illustration, clean lines, vibrant colors, artstation', 'minimal': 'minimalist design, clean composition, negative space, modern', 'cinematic': 'cinematic lighting, depth of field, dramatic atmosphere, film grain', }; const enhancement = styleEnhancements[style] || ''; return `${basePrompt}, ${enhancement}`; }

Core Concepts

Model Comparison

ModelQualitySpeedCostBest For
Flux DevExcellentFast$$General purpose, high quality
SDXLVery GoodMedium$Flexible, many styles
DALL-E 3ExcellentFast$$$Text rendering, coherent scenes
Midjourney v6ExcellentMedium$$Artistic, aesthetic
Stable Diffusion 3Very GoodMedium$$Open-source, customizable

Prompt Engineering Techniques

TechniqueDescriptionExample
Subject + StyleDescribe subject and visual style"A mountain landscape, watercolor painting style"
Negative PromptsSpecify what to avoid"blurry, low quality, distorted, watermark"
Quality ModifiersAdd quality keywords"masterpiece, best quality, highly detailed"
CompositionSpecify framing and layout"wide angle shot, rule of thirds, centered"
LightingDescribe light conditions"golden hour lighting, soft shadows, rim light"
MediumSpecify art medium"oil painting, digital art, photograph"

Configuration

ParameterDescriptionDefault
default_modelDefault generation modelflux-dev
default_sizeDefault image dimensions1024x1024
qualityQuality: draft, standard, hdstandard
negative_promptDefault negative prompt"blurry, low quality, watermark"
batch_sizeBatch generation count4
save_promptsLog prompts and resultstrue
retry_on_filterRetry if content filter triggerstrue

Best Practices

  1. Be specific and descriptive in prompts — "A golden retriever puppy sitting in autumn leaves, soft natural lighting, shallow depth of field, Canon EOS R5" produces dramatically better results than "a cute dog." Specificity guides the model toward your vision.

  2. Use negative prompts to eliminate common artifacts — Always include "blurry, deformed, ugly, duplicate, mutated, watermark, text, low quality" in negative prompts. This steers the model away from common failure modes.

  3. Generate multiple variants and select the best — AI image generation is stochastic. Generate 4-8 images per prompt with different seeds and select the best result. The cost of extra generations is far less than the time spent tweaking prompts.

  4. Match the model to the use case — Use Flux or DALL-E 3 for coherent scenes with text. Use SDXL with LoRAs for specific styles. Use Midjourney for artistic, aesthetic outputs. No single model excels at everything.

  5. Build a prompt library for consistent brand imagery — Save successful prompts with their outputs as templates. Reuse proven prompt structures, modifying only the subject while keeping style, lighting, and quality modifiers consistent.

Common Issues

Generated images have anatomical errors (extra fingers, distorted faces). Use face-focused models or face restoration post-processing. Add "anatomically correct, realistic proportions" to prompts. For hands, specify "five fingers, correct hand anatomy" explicitly.

Consistent style is difficult across multiple generations. Use the same seed, style keywords, and model for a series. With SDXL/SD, use LoRA models trained on your desired style. For batch consistency, use image-to-image with a reference image to maintain visual coherence.

Content filter blocks legitimate prompts. Many providers use safety filters that can be overly conservative. Rephrase prompts to use neutral language, avoid words that trigger false positives (even in innocent contexts), and contact provider support if legitimate use cases are consistently blocked.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates