Comp-I / docs /PHASE2E_STYLE_REFERENCE_GUIDE.md
axrzce's picture
Deploy from GitHub main
338d95d verified

A newer version of the Streamlit SDK is available: 1.52.1

Upgrade

CompI Phase 2.E: Style Reference/Example Image to AI Art - User Guide

🎨 Transform Any Image into AI Art Guidance

Phase 2.E allows you to use any reference image (from your device or the web) to guide the style, mood, and composition of your AI-generated art. Upload local files or paste URLs from Google Images, Pinterest, Instagram, or any other source!

πŸš€ Quick Start

1. Launch the Application

streamlit run src/ui/compi_phase2e_streamlit_ui.py

2. Basic Workflow

  1. Enter your text prompt - Describe what you want to create
  2. Add reference image - Upload file or paste web URL
  3. Review AI suggestions - See automatic style analysis
  4. Adjust settings - Control reference strength and parameters
  5. Generate art - Create AI art guided by your reference
  6. Download results - Save images with full metadata

πŸ“Έ Reference Image Sources

Supported Input Methods

πŸ–ΌοΈ Local File Upload

  • Formats: PNG, JPG, JPEG, BMP, TIFF, WebP
  • Size Limit: Up to 10MB per file
  • Quality: Higher resolution = better style analysis

🌐 Web URL Input

  • Google Images: Right-click β†’ "Copy image address"
  • Pinterest: Click image β†’ Copy URL from address bar
  • Instagram: Use image direct links
  • Art Websites: DeviantArt, ArtStation, Behance
  • Any Website: Direct image URLs (.jpg, .png, etc.)

URL Examples

βœ… Good URLs:
https://example.com/artwork.jpg
https://pinterest.com/pin/123456789/
https://images.unsplash.com/photo-123/image.jpg

❌ Avoid:
https://website.com/gallery-page (not direct image)
https://social-media.com/post/123 (post page, not image)

πŸŽ›οΈ Interface Guide

Main Controls

Text Input Section

  • Main Prompt: Primary description of what you want to generate
  • Style Keywords: Additional artistic style descriptors
  • Mood/Atmosphere: Emotional tone and feeling

Reference Image Section

  • Upload Tab: Drag & drop or browse for local files
  • URL Tab: Paste any web image URL
  • Analysis Display: Real-time style analysis and suggestions

Generation Settings

  • Reference Strength: How closely to follow the reference (0.1-0.9)
  • Number of Images: Generate 1-4 variations
  • Quality Settings: Inference steps and guidance scale
  • Seed Control: Random or fixed for reproducibility

AI Style Analysis

When you load a reference image, the AI automatically analyzes:

  • Visual Properties: Brightness, contrast, color distribution
  • Style Characteristics: Artistic technique, complexity, mood
  • Suggested Keywords: Automatically generated style descriptors
  • Enhancement Options: One-click addition to your prompt

βš™οΈ Settings Guide

Reference Strength Control

The reference strength determines how closely your generated art follows the reference image:

Strength Effect Best For
0.1-0.3 Loose inspiration, high creativity Abstract concepts, creative freedom
0.4-0.6 Balanced style transfer Most use cases, artistic guidance
0.7-0.9 Close adherence to reference Style mimicking, specific looks

Quality vs Speed Settings

Setting Fast (10-15 steps) Balanced (20-30 steps) High Quality (40-50 steps)
Time 30-60 seconds 1-2 minutes 3-5 minutes
Quality Good for testing Recommended Best results
Use Case Quick iterations Final generation Professional work

Guidance Scale

Scale Effect Best For
5-10 More creative, loose interpretation Artistic freedom, abstract art
10-15 Balanced prompt following Most use cases
15-20 Strict prompt adherence Precise requirements

🎨 Creative Techniques

Effective Reference Selection

βœ… Good References

  • Clear artistic style (paintings, digital art, photography styles)
  • Strong visual identity (distinctive colors, techniques, moods)
  • Good composition (well-balanced, not cluttered)
  • High contrast (clear light/dark areas)

❌ Challenging References

  • Cluttered images with too many elements
  • Low contrast or very dark/bright images
  • Screenshots or UI elements
  • Text-heavy images

Prompt Enhancement Tips

Combine Multiple Styles

Base: "A serene mountain landscape"
+ Style: "oil painting, impressionist"
+ Mood: "golden hour, peaceful"
+ AI Suggestions: "soft brushstrokes, warm colors"
= Enhanced: "A serene mountain landscape, oil painting, impressionist, golden hour, peaceful, soft brushstrokes, warm colors"

Layer Your Descriptions

  1. Subject: What you want to see
  2. Style: Artistic technique or medium
  3. Mood: Emotional atmosphere
  4. Details: Specific elements or effects

Reference Strength Strategies

Creative Exploration (Low Strength: 0.2-0.4)

  • Use reference for general mood/color inspiration
  • Allow AI maximum creative freedom
  • Good for abstract or conceptual art

Style Transfer (Medium Strength: 0.5-0.7)

  • Balance between reference and creativity
  • Maintain reference style while changing content
  • Most versatile approach

Style Mimicking (High Strength: 0.7-0.9)

  • Close adherence to reference technique
  • Minimal creative deviation
  • Good for specific artistic styles

πŸ“ Output Management

File Naming Convention

Generated files follow a comprehensive naming pattern:

{prompt}_{style}_{mood}_{timestamp}_seed{number}_{REFIMG|NOREFIMG}_v{variation}.png

Example:

magical_forest_fantasy_mystical_20250701_143022_seed12345_REFIMG_v1.png

Metadata Files

Each image includes a JSON metadata file with:

  • Complete generation parameters
  • Reference image information
  • AI style analysis results
  • Reproducibility data

Organization Tips

  • Create project folders for different art series
  • Use consistent naming for easy searching
  • Save metadata for reproducing successful results
  • Export favorites to separate collections

πŸ”§ Troubleshooting

Common Issues

"Failed to load image from URL"

  • βœ… Check URL is a direct image link
  • βœ… Try right-clicking image β†’ "Copy image address"
  • βœ… Ensure URL ends with .jpg, .png, etc.
  • βœ… Test URL in browser first

"Generation taking too long"

  • βœ… Reduce inference steps (try 15-20)
  • βœ… Lower image count (try 1-2 images)
  • βœ… Check GPU memory availability
  • βœ… Restart application if needed

"Poor quality results"

  • βœ… Increase inference steps (try 30-40)
  • βœ… Adjust reference strength
  • βœ… Improve prompt specificity
  • βœ… Try different reference images

"Out of memory errors"

  • βœ… Enable memory optimizations in settings
  • βœ… Reduce batch size to 1 image
  • βœ… Close other applications
  • βœ… Use CPU mode if necessary

Performance Optimization

For Better Speed

  • Use GPU if available
  • Enable memory optimizations
  • Start with lower inference steps
  • Generate fewer images per batch

For Better Quality

  • Use high-resolution reference images
  • Increase inference steps (30-50)
  • Fine-tune reference strength
  • Use descriptive, specific prompts

🎯 Best Practices

Reference Image Selection

  1. Choose clear, high-quality images
  2. Match the style you want to achieve
  3. Consider color palette and mood
  4. Test different reference strengths

Prompt Writing

  1. Be specific about desired elements
  2. Use artistic terminology
  3. Describe lighting and atmosphere
  4. Combine multiple style keywords

Iterative Improvement

  1. Start with medium reference strength
  2. Generate multiple variations
  3. Adjust settings based on results
  4. Save successful parameter combinations

Workflow Efficiency

  1. Prepare reference images in advance
  2. Use consistent naming conventions
  3. Save metadata for reproducibility
  4. Organize outputs by project/style

πŸš€ Advanced Tips

Multi-Style Blending

  • Use reference for base style
  • Add contrasting style keywords
  • Experiment with different strengths

Series Creation

  • Use same reference with different prompts
  • Maintain consistent style across images
  • Vary only specific elements

Style Evolution

  • Start with high reference strength
  • Gradually reduce for more creativity
  • Create progression series

This guide provides everything you need to master CompI Phase 2.E and create stunning AI art guided by any reference image!