An intelligent multi-agent AI system built with Google ADK for virtual clothing try-on. Upload a person image, select from our catalog, and let AI show you how the outfit would look from all angles!
- β Multi-View Try-On: Automatic 3-angle try-on (front/side/back)
- β Catalog System: Browse 10 curated fashion garments (no uploads needed)
- β Auto-Start Mode: New image upload automatically begins workflow
- β Batch Processing: Try-on all 3 views in one operation
- π¬ Video Generation: Create promotional videos with Veo 3.1 β NEW
- β Continuous Workflow: Unlimited try-ons with automatic versioning
- β Rate Limiting: Smart cooldown (5s) prevents excessive API calls
- β Image Validation: Automatic person image validation
- β 9:16 Aspect Ratio: Optimized for portrait/mobile viewing
- β Session Management: Track all uploads and try-on results
- π― Interactive Coordinator: User-driven workflow with LLM intelligence
- πΌοΈ Image Manager Agent: Auto-generates 3 views from 1 image (4 tools)
- π Catalog Manager Agent: Shows catalog and manages selection (2 tools)
- β¨ Try-On Specialist Agent: Batch try-on on all 3 views + video generation (5 tools)
- π Clean Organization: 11 tools distributed across 3 specialized sub-agents
- π Fast Workflow: Auto-start mode with automatic multi-view generation
- π¬ User Control: Interactive with natural conversation flow
- π¨ Complete View: See garments from every angle instantly
- π¬ Video Marketing: Generate professional videos with Veo 3.1
COORDINATOR AGENT (LlmAgent - Interactive)
β
βββ Image Manager Agent (4 tools) - AUTO-START + AUTO-MULTIVIEW
β ββ list_reference_images
β ββ clear_reference_images
β ββ load_artifacts_tool
β ββ generate_multiview_person β NEW
β
βββ Catalog Manager Agent (2 tools)
β ββ list_catalog_clothes
β ββ select_catalog_cloth
β
βββ Try-On Specialist Agent (5 tools)
ββ virtual_tryon
ββ list_tryon_results
ββ get_rate_limit_status
ββ batch_multiview_tryon β NEW
ββ generate_video_from_results π¬ NEW
Why Interactive + Auto Batch?
- β User controls pace at each phase
- β Auto-generates 3 views from 1 image
- β Auto-start on new image upload
- β Batch try-on all 3 views automatically
- β Natural conversation flow
- β Flexible and maintainable
- β Support for continuous operations
- β Complete angle coverage instantly
-
Upload Person Image β AUTO-MULTIVIEW
- Image saved automatically (reference_image_v1.png)
- System generates 3 views: front, side, back (~10-15s)
- Catalog displayed automatically
-
View Catalog β AUTOMATIC
- 10 garments displayed
- User selects by number
-
Select Garment β INTERACTIVE
- User chooses garment
- Confirmation displayed
-
Execute Batch Try-On β AUTOMATIC
- Try-on processed on all 3 views (~15-20s)
- Results saved: tryon_result_v1.png (front), v2.png (side), v3.png (back)
-
View Results β WAIT
- User reviews all 3 results
- Complete angle coverage
-
Generate Video (Optional) π¬ β INTERACTIVE
- System offers video generation
- Veo 3.1 creates professional video (~40-90s)
- Video showcases rotating fashion views
- Perfect for social media marketing
-
Continue? β INTERACTIVE
- Upload new person (β auto-start + auto-multiview)
- Try different garment (batch try-on all 3 views)
- View all results
- Finish
- Upload multiple person images (v1, v2, v3...)
- Each upload auto-starts workflow with multi-view generation
- All 3 views processed automatically for each garment
- All results preserved (v1, v2, v3 for first garment, v4, v5, v6 for second, etc.)
- No manual cleanup needed
- Complete angle coverage for every try-on
- Python 3.10+
- Google ADK (
pip install google-adk) - Gemini API key with image generation access
-
Clone the repository:
git clone <repository-url> cd adk-design-agent
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables: Create a
.envfile in the project root:GEMINI_API_KEY=your_gemini_api_key_here GOOGLE_API_KEY=your_gemini_api_key_here GOOGLE_GENAI_USE_VERTEXAI=false
-
Verify installation:
python -c "import google.adk; print('ADK installed successfully')"
Start the Interactive Multi-Agent system:
adk run agent:runnerExpected output:
π― Virtual Try-On Agent System (v3.1.0) - Ready!
Or use the quick start script:
Windows:
run.batLinux/Mac:
chmod +x run.sh
./run.shStart the ADK web interface:
adk webThen navigate to: http://127.0.0.1:8000/dev-ui?app=agent
- Start Agent: Run
adk run agent:runner - Upload Image: Attach person photo (9:16 ratio preferred)
- Auto-Start: System automatically shows catalog
- Select Garment: Choose by number (1-10)
- View Result: See virtual try-on result
- Continue: Upload new person or try different garment
User: "Hi, I want to try on some clothes"
Agent: "Hello! Welcome to our Virtual Try-On service! πβ¨
Let's start by uploading a person image.
Please provide a 9:16 portrait photo."
User: [Uploads person image]
Agent: "β
Person image validated and saved!
Ready to browse our catalog!"
User: "Show me the catalog"
Agent: "Here are our available garments:
1. π Classic White T-Shirt - Versatile everyday essential
2. π Navy Business Suit - Professional formal wear
3. π§₯ Denim Jacket - Casual cool style
4. π Floral Summer Dress - Bright and cheerful
5. π½ Athletic Sports Jersey - Active lifestyle
6. π§₯ Leather Biker Jacket - Edgy street style
7. π© Vintage Cardigan - Cozy classic comfort
Which garment would you like to try? (1-7)"
User: "I want to try garment #2"
Agent: "β
Navy Business Suit selected!
Checking rate limit... β
Ready!
Creating batch try-on on all 3 views... π¨"
Agent: "β¨ Virtual Try-On Complete - All 3 Views!
πΈ Front view: tryon_result_v1.png
πΈ Side view: tryon_result_v2.png
πΈ Back view: tryon_result_v3.png
You can see the Navy Suit from every angle!
Want to try another garment?"
- list_reference_images - List all uploaded person images
- clear_reference_images - Clear all uploaded images
- load_artifacts_tool - Load previous artifacts
- generate_multiview_person - Generate 3 views (front/side/back) from 1 image β NEW
- list_catalog_clothes - Display all 10 catalog garments
- select_catalog_cloth - Select garment by ID (1-10)
- virtual_tryon - Execute single virtual try-on
- list_tryon_results - Show all try-on results
- get_rate_limit_status - Check cooldown status
- batch_multiview_tryon - Try-on garment on all 3 views automatically β NEW
- generate_video_from_results - Generate Veo 3.1 video from batch results π¬ NEW
Purpose: Create professional promotional videos from batch try-on results
When to use:
- After
batch_multiview_tryoncompletes successfully - When user wants marketing content for social media
- To showcase garments from all angles in video format
Default Configuration (Auto-applied):
{
"video_length": 8, # 8 seconds duration
"aspect_ratio": "16:9", # Horizontal format (YouTube/presentations)
"transition_style": "smooth_rotation" # Smooth transitions between views
}Example:
# After batch try-on completes with 3 results
# Just call without parameters - uses defaults automatically
generate_video_from_results()
# Returns: Video URL for download
# Processing time: 40-90 seconds
# Output: 8-second video in 16:9 formatFeatures:
- β Uses Veo 2.0 model (veo-2.0-generate-001)
- β Image-to-video generation with your try-on results
- β Automatic loading of 3 batch results
- β Professional transitions between views
- β 16:9 aspect ratio perfect for YouTube/presentations
- β No text overlays (avoids spelling errors)
- β Downloadable video URL with 24-hour validity
- β 8-second duration with smooth rotation
Workflow Integration:
1. User uploads person image β 3 views generated
2. User selects garment β Batch try-on creates 3 results
3. System shows results β Offers video generation
4. User accepts β 8-second video in 16:9 generated (~60-90s)
5. User downloads video β Ready for YouTube/presentations!
- User downloads video β Ready for social media!
## π File Structure
```text
adk-design-agent/
βββ agent.py # β Interactive Multi-Agent System (v3.1.0)
βββ prompts.py # All agent instructions
βββ prompt.py.old # Legacy single agent (backup)
βββ tools/
β βββ tryon_tool.py # Virtual try-on tools (10 tools)
β βββ rate_limiter.py # Rate limiting utilities
βββ catalog/ # 10 fashion garments
βββ reference_images/ # Uploaded person images (auto-versioned)
βββ tryon_results/ # Generated results (auto-versioned)
βββ deep_think_loop.py # Deep thinking utilities
βββ requirements.txt # Python dependencies
βββ pyproject.toml # Project configuration
βββ run.bat / run.sh # Quick start scripts
βββ README.md # This file
Create a .env file:
# Required for Virtual Try-On
GEMINI_API_KEY=your_gemini_api_key_here
# Required for Video Generation (Veo 3.1)
GOOGLE_API_KEY=your_gemini_api_key_here # Same key works for both
# Optional
GOOGLE_GENAI_USE_VERTEXAI=false
RATE_LIMIT_COOLDOWN=5.0 # Cooldown seconds (default: 5.0)Note: GOOGLE_API_KEY is required for video generation. You can use the same API key as GEMINI_API_KEY.
Environment variable in .env:
RATE_LIMIT_COOLDOWN=5.0 # Cooldown between try-ons (default: 5s)Or edit tools/rate_limiter.py for custom logic.
Add/modify garments in tools/tryon_tool.py:
CATALOG_CLOTHES = [
{"id": 1, "name": "Your Garment", "description": "Description"},
# ... add up to 10 garments
]Place garment images in catalog/ folder.
-
"GEMINI_API_KEY environment variable not set"
- Ensure your
.envfile contains the API key - Verify the key has image generation permissions
- Check the key is loaded:
echo $GEMINI_API_KEY(Linux/Mac) orecho $env:GEMINI_API_KEY(PowerShell)
- Ensure your
-
"Rate limit exceeded"
- Wait 5 seconds between try-ons (default cooldown)
- Check status: "What's the rate limit status?"
- The cooldown resets automatically
-
"Invalid garment selection"
- Use garment ID from 1-10 only
- Run "Show me the catalog" to see available garments
- Cannot upload custom garments (catalog-only mode)
-
"Person image validation failed"
- Ensure image is 9:16 aspect ratio (portrait)
- Upload clear portrait photos
- File must be JPG or PNG format
-
"Cannot import module"
- Check you're in the project directory
- Verify all files exist:
agent.py,prompts.py,tools/ - Run:
python -c "from agent import root_agent; print('OK')"
Enable detailed logging:
# Windows PowerShell
$env:PYTHONPATH="."; python -c "import logging; logging.basicConfig(level='DEBUG'); from agent import root_agent"
# Linux/Mac
export PYTHONPATH=.; python -c "import logging; logging.basicConfig(level=logging.DEBUG); from agent import root_agent"Or in your Python code:
import logging
logging.basicConfig(level=logging.DEBUG)logging.basicConfig(level=logging.DEBUG)
## π Documentation
- **[Google ADK Docs](https://google.github.io/adk-docs/)** - Official ADK documentation
- **[Gemini API](https://ai.google.dev/gemini-api/docs)** - Gemini model documentation
- **[Image Generation](https://ai.google.dev/gemini-api/docs/imagen)** - Imagen 3 documentation
## π Advanced Usage
### Adding New Agents
To extend the Interactive system:
```python
# In agent.py
# 1. Import new instruction from prompts.py
from prompts import (
IMAGE_MANAGER_INSTRUCTION,
CATALOG_MANAGER_INSTRUCTION,
TRYON_SPECIALIST_INSTRUCTION,
INTERACTIVE_COORDINATOR_INSTRUCTION,
STYLE_ADVISOR_INSTRUCTION # Add new instruction
)
# 2. Create new agent
style_advisor_agent = LlmAgent(
name="style_advisor_agent",
model="gemini-2.5-flash",
instruction=STYLE_ADVISOR_INSTRUCTION,
tools=[recommend_style, analyze_preferences],
before_model_callback=process_reference_images_callback
)
# 3. Add to coordinator's sub_agents
root_agent = LlmAgent(
name="virtual_tryon_coordinator",
sub_agents=[
image_manager_agent,
catalog_manager_agent,
tryon_specialist_agent,
style_advisor_agent # Add here
]
)
Modify agent instructions in prompts.py:
CUSTOM_WORKFLOW_INSTRUCTION = """
You are the Custom Workflow Agent for the Virtual Try-On system.
Your responsibilities:
1. Step 1: [Your custom step]
2. Step 2: [Your custom step]
3. Step 3: [Your custom step]
Available tools:
- [list your tools]
Important:
- Always validate inputs
- Provide clear feedback
- Handle errors gracefully
"""# Adjust model for speed/quality
LlmAgent(
model="gemini-2.5-flash", # β Best balance (recommended)
# model="gemini-2.0-flash-exp", # Fast, experimental features
# model="gemini-2.5-pro", # Slower, highest quality
)Edit tools/rate_limiter.py or set environment variable:
# In .env
RATE_LIMIT_COOLDOWN=10.0 # 10 seconds cooldownContributions are welcome! Here's how:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test thoroughly:
# Test your changes adk run agent:runner # Upload test image and verify workflow
- Commit:
git commit -m "Add amazing feature" - Push:
git push origin feature/amazing-feature - Open a Pull Request
- Follow existing code style and structure
- Add docstrings to new functions
- Update
prompts.pyfor instruction changes - Test interactive workflow thoroughly
- Update README.md for new features
- Maintain backward compatibility
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For issues and questions:
- Check the troubleshooting section above
- Review ADK documentation
- Open an issue in the repository
- Check existing issues for solutions
- β MULTI-VIEW GENERATION: Auto-generates 3 views (front/side/back) from 1 image
- β BATCH TRY-ON: Automatic try-on on all 3 views in one operation
- β AUTO-START + AUTO-MULTIVIEW: New image upload triggers complete workflow
- β STREAMLINED UX: No questions about garment_type or view selection
- β Interactive coordinator with 3 specialist agents
- β User-controlled workflow with automatic batch processing
- β 10 tools distributed across agents (4+2+4)
- β Complete angle coverage for every try-on
- β Enhanced documentation and cleanup
- β AUTO-START MODE: New image upload triggers automatic workflow
- β Interactive coordinator with 3 specialist agents
- β User-controlled workflow pacing (except auto-start)
- β Continuous workflow support
- β 10 garments in catalog (expanded from 7)
- β
Consolidated prompts in single file (
prompts.py) - β Clean logging output
- β Enhanced documentation
- β Automatic workflow with LoopAgent
- β Sequential chaining with output_key
- β Fully automated pipeline
- β SequentialAgent with automatic chaining
- β Output key-based data flow
- β Improved tool organization
- β Added Sequential Multi-Agent system (4 agents)
- β Better tool organization (3+2+5 distribution)
- β Comprehensive documentation
- β Removed Deep Think mode
- β Simplified to regular agent only
- β Code cleanup (removed unused imports)
- β Added catalog with 7 garments
- β Catalog-only mode (no garment uploads)
- β English-only output
- β Compare multiple try-on results
- β AI-powered comparison summary
- β Side-by-side result viewing
- β 5-second cooldown between try-ons
- β Rate limit status tool
- β Prevents excessive API calls
- β Person image validation
- β Clear reference images tool
- β List reference images tool
- β Virtual try-on tool
- β List try-on results
- β Load previous artifacts
- β Basic virtual try-on agent
- β Single agent architecture
- β Image upload handling
- β Result management
Built with β€οΈ using Google ADK and Gemini AI
β Recommended: Use Sequential Multi-Agent architecture for production!
