GIMP MCP
Generates images from text descriptions using Stable Diffusion AI, integrated with VS Code through Model Context Protocol. Supports both AI-powered realistic images and quick PIL-based sketches, with batch processing and animated GIF creation capabilities.
README
🎨 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
# 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:
./generate_image.sh "A serene mountain landscape at sunset" "mountain_sunset"
Using Python directly:
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 - Get started in 30 seconds
- ANIMATION_GUIDE.md - Create animated GIFs from text sequences
- PROMPT_EXAMPLES.md - 20+ sample prompts and best practices
- INTEGRATION_SUMMARY.md - Technical implementation details
- CHANGELOG.md - Version history and updates
💻 Usage
Two Generation Modes
1. AI Mode (Recommended)
Uses Stable Diffusion for realistic, detailed images:
./generate_image.sh "A futuristic cyberpunk city at night" "cyberpunk"
2. Sketch Mode
Fast PIL-based placeholders for quick drafts:
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:
python3 batch_generate.py output/storyboards
Animation Generation
Create animated GIFs from text sequences:
./generate_animation.sh \
"A sunrise over mountains" \
"Morning light on peaks" \
"Full daylight landscape" \
"mountain_animation"
See ANIMATION_GUIDE.md for detailed animation features.
🎨 Examples
Check 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:
- Get API token from Hugging Face
- Edit
gimp_image_gen.py:
headers["Authorization"] = "Bearer YOUR_TOKEN"
🔧 Troubleshooting
Common Issues
"Module 'PIL' not found"
source .venv/bin/activate
pip install Pillow
"Permission denied: ./generate_image.sh"
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 for setup issues
- Check PROMPT_EXAMPLES.md for prompt tips
- See 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 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:
- Check the documentation above
- Review PROMPT_EXAMPLES.md
- See INTEGRATION_SUMMARY.md
Version: 3.1.0
Last Updated: November 19, 2025
Status: ✅ Production Ready
Made with ❤️ for creative workflows
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。