Generate cinematic Flux 2 [pro] image prompts from reference images and concept descriptions. Upload a moodboard, describe a vibe, and get production-ready prompts written like a senior Director of Photography.
PromptEnhancer runs a two-step AI pipeline via OpenRouter:
- Visual analysis — Upload reference images and Gemini 2.5 Flash extracts abstract aesthetic properties: colour palette, light quality, compositional energy, atmosphere, cinematic style. Subjects, faces, and locations are deliberately ignored — only the feel is captured.
- Prompt generation — MiniMax M2.5 writes 3–6 Flux 2 [pro] prompts in the voice of a senior Director of Photography. Think Denis Villeneuve's restraint, Roger Deakins' mastery of practical light, David Lynch's quiet wrongness. Each prompt is 70–120 words, specifies a lens, depth of field, lighting quality, and a distinct camera angle.
Results appear as cards. Hover any card to Copy or Revise it — the revision panel lets you describe what should change ("make it warmer", "shift to dusk", "add rain") and rewrites only that prompt in-place.
- Node.js (v18 or later)
- An OpenRouter API key (both models used are available on the free tier)
git clone https://github.com/joosthel/PromptEnhancer.git
cd PromptEnhancer
npm installCreate a .env.local file in the project root:
echo 'OPENROUTER_API_KEY=sk-or-v1-...' > .env.localReplace sk-or-v1-... with your actual key from openrouter.ai/keys.
macOS — double-click start.command, or run from terminal:
./start.commandWindows — double-click start.bat, or from a terminal:
start.batBoth scripts install dependencies (if needed), check for your API key, start the dev server, and open your browser at http://localhost:3000.
You can also start manually:
npm run dev- Add reference images (optional) — drag and drop, click to browse, paste from clipboard, or enter a URL. Up to 10 images, max 10 MB each. Images are compressed client-side before sending.
- Describe your concept (optional) — fill in any combination of Storyline, Subject, Environment, and Mood. All fields are optional; you can use images alone, text alone, or both.
- Choose a prompt count — 3, 4, 5, or 6 prompts.
- Generate — the pipeline runs server-side. With images, expect ~15–30 seconds for the vision step plus generation. Text-only is faster.
- Revise — hover any result card, click Revise, describe what should change, and Apply. Only that card updates.
| Layer | Tech |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript 5 |
| Styling | Tailwind CSS 4 |
| AI Gateway | OpenRouter |
| Vision model | google/gemini-2.5-flash |
| Text model | minimax/minimax-m2.5 |
No database. No auth. No extra npm packages beyond the Next.js scaffold.
src/
app/
page.tsx # Main page — state, generate + update handlers
layout.tsx # Root layout
globals.css # Global styles
api/
generate/route.ts # Two-step pipeline: Gemini vision → MiniMax generation
revise/route.ts # Single-card revision: MiniMax rewrite
components/
ApiKeyInput.tsx # Optional client-side API key input
ImageUploader.tsx # Drag-drop, paste, URL input
InputForm.tsx # Storyline / Subject / Environment / Mood fields
PromptList.tsx # Revision orchestration, visual style panel
PromptCard.tsx # Prompt display, copy, inline revise UI
lib/
openrouter.ts # Typed fetch wrapper + JSON parser
system-prompt.ts # All prompt builders and shared types
image-utils.ts # Canvas resize/compress, clipboard, URL validation
| Variable | Required | Description |
|---|---|---|
OPENROUTER_API_KEY |
Yes | Your OpenRouter API key — stored server-side only |
MIT