An AI-powered tool for creators and cosplay enthusiasts to generate professional cosplay images from their photos.
- Photo Upload & Analysis: Smart image analysis for optimal results
- Character Library: 10+ popular characters across different styles (anime, superhero, gaming, comic, fantasy)
- Smart Prompt Engineering: AI-optimized prompts for better generation quality
- Real-time Generation: Live progress tracking and status updates
- Modern UI: Beautiful, responsive interface built with React and Tailwind CSS
- FastAPI: Modern, fast web framework for building APIs
- Google Imagen Pro: AI image generation engine
- Image Processing: OpenCV and Pillow for photo analysis
- Smart Prompting: Intelligent prompt engineering system
- React 18: Modern React with hooks and functional components
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first CSS framework
- Responsive Design: Mobile-first approach
cosplay-ai-v1/
βββ backend/
β βββ main.py # FastAPI application
β βββ imagen_client.py # Google Imagen integration
β βββ prompt_builder.py # Smart prompt generation
β βββ photo_analyzer.py # Image analysis utilities
β βββ character_library.py # Character/style definitions
β βββ utils.py # Helper functions
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ utils/ # Utility functions
β βββ public/ # Static assets
βββ .env.example # Environment variables template
βββ requirements.txt # Python dependencies
βββ README.md # This file
- Python 3.8+
- Node.js 16+
- Google Cloud Project with Imagen Pro API access
-
Clone and navigate to the project:
cd cosplay-ai-v1/backend -
Install Python dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp ../.env.example .env # Edit .env with your Google Cloud credentials -
Run the backend server:
python main.py
The API will be available at http://localhost:8000
-
Navigate to frontend directory:
cd cosplay-ai-v1/frontend -
Install dependencies:
npm install
-
Start the development server:
npm start
The frontend will be available at http://localhost:3000
Create a .env file in the backend directory:
# Google Cloud Configuration
GOOGLE_CLOUD_PROJECT_ID=your-project-id
GOOGLE_APPLICATION_CREDENTIALS=./google-credentials.json
IMAGEN_LOCATION=us-central1
# API Configuration
API_HOST=0.0.0.0
API_PORT=8000
DEBUG=True
# CORS Configuration
FRONTEND_URL=http://localhost:3000- Create a Google Cloud Project
- Enable the Vertex AI API
- Set up authentication credentials
- Configure Imagen Pro access
GET /- API health checkGET /health- Detailed health statusPOST /generate-cosplay- Generate cosplay imageGET /generation/{id}- Get generation statusGET /characters- List available characters
# Generate cosplay image
curl -X POST "http://localhost:8000/generate-cosplay" \
-F "photo=@/path/to/photo.jpg" \
-F "character=sailor-moon" \
-F "style=anime" \
-F "quality=high"
# Check generation status
curl "http://localhost:8000/generation/{generation_id}"| Character | Style | Description |
|---|---|---|
| Sailor Moon | Anime | Classic magical girl with sailor uniform |
| Wonder Woman | Superhero | Amazonian warrior princess |
| D.Va | Gaming | Professional gamer and mech pilot |
| Harley Quinn | Comic | Chaotic villain with jester costume |
| Princess Zelda | Fantasy | Royal princess with magical powers |
| Power Girl | Superhero | Powerful superhero with classic costume |
| 2B | Gaming | Android combat unit with elegant design |
| Mikasa Ackerman | Anime | Skilled soldier with military uniform |
| Catwoman | Comic | Feline-themed thief with sleek costume |
| Ahri | Gaming | Nine-tailed fox spirit with magical attire |
- Project structure setup
- FastAPI backend with core modules
- React frontend with TypeScript
- Tailwind CSS styling
- Basic API endpoints
- Google Imagen Pro API integration
- Photo analysis implementation
- Prompt building system
- Character library integration
- Frontend-backend integration
- Real-time progress tracking
- Error handling and validation
- Result display and download
- Beta user testing
- Performance optimization
- Quality control measures
- Launch preparation
cd backend
pytestcd frontend
npm test# Build for production
pip install -r requirements.txt
# Deploy to your preferred platform# Build for production
npm run build
# Deploy to your preferred platform- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Google Imagen Pro integration
- Basic character library
- Smart prompt engineering
- Web interface
- SDXL + IP-Adapter integration
- Face preservation technology
- Advanced character customization
- Batch processing
- API rate limiting and monetization
Built with β€οΈ for the cosplay community