Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Prompt Variator

Generate creative variations of AI image prompts in seconds.

Paste a seed prompt → Get multiple creative variants → Copy & use in your favorite image generator.

Python Flask License: MIT


🚀 Quick Start

# 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.py

Open http://localhost:9090 and you're ready to go.


✨ Features

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

💡 How It Works

  1. Paste your seed prompt into the text area (or use the example)
  2. Configure your provider — Local AI or OpenRouter, pick your model
  3. Generate — the LLM creates creative variations with different settings, lighting, moods, and compositions
  4. 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

⚙️ Configuration

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

📡 API Reference

The server exposes a simple REST API:

POST /api/generate

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
}

Other Endpoints

Method Endpoint Description
GET / Web UI
POST /api/test-connection Test API connectivity
GET /api/config Default configuration

🏗️ Project Structure

├── .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)

📄 License

MIT — feel free to use and modify.


Built with Flask + OpenAI SDK

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages