Transform character models with AI-powered outfit variations
ImageAlchemy is an open-source image generation tool that specializes in creating outfit variations for character models in different colors and styles. The application uses Stable Diffusion XL to transform images with customizable outfits while maintaining the character's core facial features.
Red | Purple | Pink |
---|---|---|
Blue | Yellow | Purple |
---|---|---|
Teal | Red | Purple |
---|---|---|
Pink | Green | Blue |
---|---|---|
Teal | Red | Purple |
---|---|---|
Pink | Green | Blue |
---|---|---|
Teal | Red | Purple |
---|---|---|
Pink | Green | Blue |
---|---|---|
Control 1 | Control 2 | Control 3 |
---|---|---|
- Create outfit variations for any character style with different colors and patterns
- Support for multiple style configurations (anime, cartoon, realistic, and more)
- Preserve the character's face and body structure
- Maintain consistent expressions and key character features
- Automatically cycle through reference images
- Customizable strength, guidance, and quality settings
- macOS optimized with Metal Performance Shaders support
- Windows and Linux compatible with CUDA acceleration
- Python 3.8 or higher
- For GPU acceleration:
- NVIDIA GPU with CUDA support (Windows/Linux)
- Apple Silicon or Intel Mac with Metal support (macOS)
For the fastest setup, follow these steps in order:
-
Setup your environment:
# macOS chmod +x scripts/setup/01_setup_mac.sh ./scripts/setup/01_setup_mac.sh # Windows scripts\setup\01_setup_windows.bat
-
Setup the AI model:
# macOS/Linux chmod +x scripts/setup/02_setup_sdxl.sh ./scripts/setup/02_setup_sdxl.sh # Optional custom model chmod +x scripts/setup/03_setup_custom_sdxl.sh ./scripts/setup/03_setup_custom_sdxl.sh
-
Run the server:
# macOS chmod +x scripts/run/01_run_mac.sh ./scripts/run/01_run_mac.sh # Windows scripts\run\01_run_windows.bat
-
Generate images:
# macOS chmod +x scripts/run/02_run_generator_mac.sh ./scripts/run/02_run_generator_mac.sh # Windows scripts\run\02_run_generator_windows.bat
See INSTALLATION.md for detailed installation instructions.
# macOS
./run_mac.sh
# Windows/Linux
source venv/bin/activate # or .\venv\Scripts\activate on Windows
uvicorn main:app --reload
The server runs at http://localhost:8000
- Place reference images in the
images
directory - Run the batch generator:
python generator.py
Generated images are saved in a timestamped directory with format: variations_YYYYMMDD_HHMMSS/
Generate variations of an uploaded image based on a text prompt.
Parameters:
prompt
: Text description of the desired outfitnegative_prompt
(optional): Elements to avoid in the generated imagestrength
(default=0.75): How much to transform the reference image (0-1)guidance_scale
(default=10.0): How closely to follow the promptsteps
(default=50): Number of denoising stepsbatch_size
(default=1): Number of images to generatefile
: Input image file
Example with cURL:
curl -X POST "http://localhost:8000/generate/" \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "file=@path/to/your/character.jpg" \
-F "prompt=A character in a red dress with elegant design" \
-F "strength=0.75" \
-F "guidance_scale=10.0" \
-F "steps=50"
ImageAlchemy supports multiple character styles that can be configured through prompt settings:
Transform your character with YoRHa-inspired outfits, blindfolds, and android aesthetics.
Create bright, colorful cartoon character variations with stylized proportions.
Generate anime-inspired character outfits with typical anime aesthetics.
And many more styles limited only by your imagination and prompt engineering skills!
The application uses a modular prompt system to generate variations:
-
Edit outfit styles:
- Modify
prompts/outfit_styles.json
to change colors or outfit descriptions - Add new outfit styles by following the existing format
- Modify
-
Edit character characteristics:
- Modify
prompts/character_styles.json
to change the expression or features - Adjust the "expression_modifier" for different looks
- Modify
-
Edit negative prompts:
- Modify
prompts/negative_prompts.json
to control what to avoid in generations
- Modify
All prompt components are automatically combined using the prompt builder utility.
ImageAlchemy/
├── config/ # Configuration files
│ └── default_config.json # Main configuration
├── docs/ # Documentation
├── images/ # Reference images directory
├── models/ # AI model files
├── prompts/ # Modular prompt components
│ ├── character_styles.json # Character characteristic prompts
│ ├── negative_prompts.json # Negative prompt components
│ └── outfit_styles.json # Outfit style variations
├── scripts/ # Organized scripts
│ ├── setup/ # Installation scripts
│ │ ├── 01_setup_mac.sh # macOS environment setup
│ │ ├── 02_setup_sdxl.sh # SDXL model setup
│ │ └── 03_setup_custom_sdxl.sh # Custom model setup
│ ├── run/ # Execution scripts
│ │ └── 01_run_mac.sh # macOS launcher
│ └── utils/ # Utility scripts
│ ├── cleanup.sh # Cleanup utilities
│ └── prompt_builder.py # Prompt building utility
├── main.py # FastAPI server and image generation core
├── generator.py # Batch generation script
├── requirements.txt # Python dependencies
├── INSTALLATION.md # Step-by-step installation guide
└── README.md # Project documentation
For detailed installation instructions, see INSTALLATION.md.
- macOS: First generation may be slower as models compile for Metal
- Windows/Linux: CUDA acceleration requires a compatible NVIDIA GPU
- Reduce batch size to 1 for better performance on lower-end hardware
- Adjust
steps
parameter based on your hardware capabilities
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Stable Diffusion XL
- Utilizes EpicJuggernautXL custom model
- Powered by HuggingFace Diffusers