Generate creative variations of AI image prompts in seconds.
Paste a seed prompt → Get multiple creative variants → Copy & use in your favorite image generator.
# Clone the repository
git clone https://github.com/YOUR_USERNAME/prompt-variator.git
cd prompt-variator
# Install dependencies
pip install -r variator_ui/requirements.txt
# Configure your API key
cp .env.example .env
# Edit .env and add your OpenRouter API key
# Start the server
cd variator_ui && python app.pyOpen http://localhost:9090 and you're ready to go.
| Feature | Description |
|---|---|
| 🔄 Multiple Providers | Connect to local AI servers (LM Studio, Ollama) or OpenRouter |
| 🎨 Dark Theme UI | Clean, responsive interface that's easy on the eyes |
| 📋 One-Click Copy | Copy any variant to clipboard with a single click |
| 🔌 Connection Test | Verify your API setup works before generating |
| 🧠 Smart Parsing | Handles JSON, markdown code blocks, and plain text responses |
| 📱 Responsive | Works on desktop and mobile devices |
- Paste your seed prompt into the text area (or use the example)
- Configure your provider — Local AI or OpenRouter, pick your model
- Generate — the LLM creates creative variations with different settings, lighting, moods, and compositions
- Copy any variant you like and use it in your image generator
Each variation keeps the core subject recognizable while changing:
- Setting / location / time of day
- Lighting and weather conditions
- Camera angle and color palette
- Mood, clothing style, and composition
Create a .env file in the project root (copy from .env.example):
| Variable | Description | Default |
|---|---|---|
OPENROUTER_API_KEY |
Your OpenRouter API key | (required for OpenRouter) |
OPENAI_BASE_URL |
Custom API base URL | https://openrouter.ai/api/v1 |
PORT |
Server port | 9090 |
The server exposes a simple REST API:
Generate creative variations of a prompt.
Request:
{
"prompt": "Ultra-realistic portrait of...",
"n": 5,
"provider": "openrouter",
"base_url": "https://openrouter.ai/api/v1",
"api_key": "sk-or-v1-...",
"model": "anthropic/claude-sonnet-4-20250514"
}Response:
{
"variants": ["Variant 1...", "Variant 2...", "..."],
"count": 5
}| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Web UI |
POST |
/api/test-connection |
Test API connectivity |
GET |
/api/config |
Default configuration |
├── .env.example # Environment template (copy to .env)
├── .gitignore # Git ignore rules
├── README.md # This file
└── variator_ui/
├── app.py # Flask backend server
├── requirements.txt # Python dependencies
└── static/
└── index.html # Frontend (HTML + CSS + JS)
MIT — feel free to use and modify.
Built with Flask + OpenAI SDK