A newer version of the Streamlit SDK is available:
1.52.1
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
- Enter your text prompt - Describe what you want to create
- Add reference image - Upload file or paste web URL
- Review AI suggestions - See automatic style analysis
- Adjust settings - Control reference strength and parameters
- Generate art - Create AI art guided by your reference
- 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
- Subject: What you want to see
- Style: Artistic technique or medium
- Mood: Emotional atmosphere
- 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
- Choose clear, high-quality images
- Match the style you want to achieve
- Consider color palette and mood
- Test different reference strengths
Prompt Writing
- Be specific about desired elements
- Use artistic terminology
- Describe lighting and atmosphere
- Combine multiple style keywords
Iterative Improvement
- Start with medium reference strength
- Generate multiple variations
- Adjust settings based on results
- Save successful parameter combinations
Workflow Efficiency
- Prepare reference images in advance
- Use consistent naming conventions
- Save metadata for reproducibility
- 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!