README.mdโข7.71 kB
# ๐จ GIMP MCP - AI Image Generator for VS Code
> Generate images from text descriptions using Stable Diffusion AI - integrated with VS Code through Model Context Protocol (MCP)
[]()
[]()
[]()
---
## ๐ Overview
GIMP MCP is an AI-powered image generation tool that integrates with VS Code through the Model Context Protocol. It enables you to generate images from text descriptions using Stable Diffusion, with automatic fallback to PIL-based sketches.
### โจ Key Features
- ๐ค **AI-Powered**: Uses Stable Diffusion for realistic image generation
- ๐ฏ **VS Code Integrated**: Works seamlessly with GPT-4o Agent via MCP
- โก **Fast**: Sub-second generation for sketches, ~10s for AI images
- ๐จ **Dual Mode**: AI-generated or quick PIL-based drafts
- ๐ฆ **Batch Processing**: Generate multiple images at once
- ๐ฌ **Animation Support**: Create animated GIFs from text sequences
- ๐ ๏ธ **Easy Setup**: Simple bash script for quick generation
---
## ๐ Quick Start
### Prerequisites
- Python 3.9+
- VS Code with GPT-4o Agent
- Internet connection (for AI mode)
### Installation
```bash
# 1. Navigate to project directory
cd /path/to/GimpMCP
# 2. Create virtual environment
python3 -m venv .venv
# 3. Activate virtual environment
source .venv/bin/activate
# 4. Install dependencies
pip install -r requirements.txt
```
### Generate Your First Image
**Using the bash script:**
```bash
./generate_image.sh "A serene mountain landscape at sunset" "mountain_sunset"
```
**Using Python directly:**
```bash
python3 MCP/gimp-image-gen/gimp_image_gen.py \
--prompt "A serene mountain landscape at sunset" \
--output_file "output/mountain_sunset.png" \
--use-ai
```
---
## ๐ Documentation
- **[QUICKSTART.md](QUICKSTART.md)** - Get started in 30 seconds
- **[ANIMATION_GUIDE.md](ANIMATION_GUIDE.md)** - Create animated GIFs from text sequences
- **[PROMPT_EXAMPLES.md](PROMPT_EXAMPLES.md)** - 20+ sample prompts and best practices
- **[INTEGRATION_SUMMARY.md](INTEGRATION_SUMMARY.md)** - Technical implementation details
- **[CHANGELOG.md](CHANGELOG.md)** - Version history and updates
---
## ๐ป Usage
### Two Generation Modes
#### 1. AI Mode (Recommended)
Uses Stable Diffusion for realistic, detailed images:
```bash
./generate_image.sh "A futuristic cyberpunk city at night" "cyberpunk"
```
#### 2. Sketch Mode
Fast PIL-based placeholders for quick drafts:
```bash
python3 MCP/gimp-image-gen/gimp_image_gen.py \
--prompt "Quick concept sketch" \
--output_file "output/sketch.png"
```
### VS Code Integration
Ask the GPT-4o Agent directly:
```
"Generate an image of a vintage sports car in red, sunset lighting"
```
The agent will automatically invoke the tool and create your image.
### Batch Generation
Generate multiple images at once:
```bash
python3 batch_generate.py output/storyboards
```
### Animation Generation
Create animated GIFs from text sequences:
```bash
./generate_animation.sh \
"A sunrise over mountains" \
"Morning light on peaks" \
"Full daylight landscape" \
"mountain_animation"
```
See **[ANIMATION_GUIDE.md](ANIMATION_GUIDE.md)** for detailed animation features.
---
## ๐จ Examples
Check **[PROMPT_EXAMPLES.md](PROMPT_EXAMPLES.md)** for 20+ categorized examples:
- ๐ Vehicles & Transportation
- ๐ Architecture & Buildings
- ๐ค Characters & People
- ๐ Nature & Landscapes
- ๐จ Abstract & Artistic
- ๐ Food & Beverages
- ๐ฎ Games & Technology
### Sample Outputs
| Prompt | Output |
|--------|--------|
| "A simple 2D Volkswagen Beetle car in black and white, side view, minimalist design" | `beetle_ai.png` |
| "A serene Japanese garden with cherry blossoms, koi pond, stone lantern" | `japanese_garden.png` |
| "A futuristic cyberpunk city at night with neon lights, flying cars" | `cyberpunk_city.png` |
---
## ๐๏ธ Project Structure
```
GimpMCP/
โโโ .venv/ # Python virtual environment
โโโ .vscode/
โ โโโ settings.json # VS Code MCP configuration
โโโ MCP/
โ โโโ gimp-image-gen/
โ โโโ manifest.json # MCP tool definition
โ โโโ gimp_image_gen.py # Core image generator
โโโ output/ # Generated images
โโโ animations/ # Animation frames and GIFs
โโโ generate_image.sh # Quick generation script
โโโ generate_animation.sh # Animation generation script
โโโ generate_animation.py # Animation generator (Python)
โโโ batch_generate.py # Batch processing
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
```
---
## โ๏ธ Configuration
### AI Provider
Currently uses **Pollinations.ai** (free, no API key required).
To add Hugging Face support:
1. Get API token from [Hugging Face](https://huggingface.co/)
2. Edit `gimp_image_gen.py`:
```python
headers["Authorization"] = "Bearer YOUR_TOKEN"
```
---
## ๐ง Troubleshooting
### Common Issues
**"Module 'PIL' not found"**
```bash
source .venv/bin/activate
pip install Pillow
```
**"Permission denied: ./generate_image.sh"**
```bash
chmod +x generate_image.sh
```
**"AI generation failed"**
- Check internet connection
- Tool automatically falls back to PIL mode
- Try simplifying the prompt
### Getting Help
- Review [QUICKSTART.md](QUICKSTART.md) for setup issues
- Check [PROMPT_EXAMPLES.md](PROMPT_EXAMPLES.md) for prompt tips
- See [INTEGRATION_SUMMARY.md](INTEGRATION_SUMMARY.md) for technical details
---
## ๐ฏ Tips for Best Results
### For AI Mode
- Be specific and descriptive
- Include artistic style ("photorealistic", "cartoon style", etc.)
- Mention lighting ("golden hour", "studio lighting")
- Add quality terms ("highly detailed", "professional")
### Example Good Prompts
```
โ
"A luxury sports car in metallic blue, side view, detailed reflections, photorealistic, studio lighting"
โ
"A cozy coffee shop interior, warm lighting, wooden furniture, people chatting, illustration style"
โ
"A majestic medieval castle on hilltop, dramatic cloudy sky, fantasy art style, epic atmosphere"
```
### Example Poor Prompts
```
โ "A car" (too vague)
โ "Nice picture of something" (no specifics)
โ "Image" (not descriptive)
```
---
## ๐ Performance
| Mode | Speed | Quality | Use Case |
|------|-------|---------|----------|
| AI Mode | ~10-15s | High | Final images, presentations |
| Sketch Mode | <1s | Basic | Placeholders, quick drafts |
| Animation (5 frames) | ~45s | High | Animated sequences, demos |
---
## ๐ Future Enhancements
- [ ] Support for DALLยทE and other AI providers
- [ ] Custom image sizes and aspect ratios
- [ ] Style transfer from reference images
- [ ] Video format support (MP4, WebM) for animations
- [ ] Advanced GIMP scripting integration
- [ ] WebUI for non-technical users
---
## ๐ License
MIT License - See [LICENSE](LICENSE) for details
---
## ๐ Acknowledgments
- **Stable Diffusion** - AI image generation model
- **Pollinations.ai** - Free AI inference API
- **PIL/Pillow** - Python imaging library
- **Model Context Protocol** - VS Code integration framework
---
## ๐ Support
For questions or issues:
1. Check the documentation above
2. Review [PROMPT_EXAMPLES.md](PROMPT_EXAMPLES.md)
3. See [INTEGRATION_SUMMARY.md](INTEGRATION_SUMMARY.md)
---
**Version**: 3.1.0
**Last Updated**: November 19, 2025
**Status**: โ
Production Ready
Made with โค๏ธ for creative workflows