Prompt Generator
Generates Stable Diffusion and Flux prompts via Qwen3-8B on Ollama, with a Gradio UI and CLI.
What this file does
Generates Stable Diffusion and Flux prompts via Qwen3-8B on Ollama, with a Gradio UI and CLI.
When to use it
- You want a ready-made prompt generator for AI art
- You need a Gradio web UI for prompt crafting
- You want to experiment with style presets and Jinja2 templates
- You need a stateless Python API for prompt generation
Assumes this stack
Prompt Generator
A Python tool that uses Qwen3-8B via Ollama to generate high-quality prompts for Stable Diffusion and Flux.
Project Overview
- Core Technology: Qwen3-8B via Ollama
- Purpose: Generate detailed, style-specific prompts for generative AI art
- Key Features:
- Gradio Web UI with style selector and parameter controls
- Fast generation (~7s per prompt)
- 7 style presets (cinematic, anime, fantasy, cyberpunk, etc.)
- Jinja2 templating for customizable prompts
- Temperature/Top-P controls via Ollama API
- Automatic reasoning extraction (strips "Thinking..." blocks)
Key Files
app.py: Gradio web UIqwen_generator.py: Core generator - CLI and Python APIconfig/templates.yaml: Jinja2 style templates
Usage
# Web UI (recommended)
python app.py
# CLI
python qwen_generator.py "a mystical forest" --style fantasy
# CLI with advanced options
python qwen_generator.py "cyberpunk city" --style cyberpunk --temperature 0.8 --emphasis "neon lighting"
# List styles
python qwen_generator.py --list-styles
Requirements
- Python 3.8+
- Ollama with
qwen3:8bmodel
pip install -r requirements.txt
ollama pull qwen3:8b
Development Notes
- Style System: Jinja2 templates in
config/templates.yaml - Thread Safety:
generate_prompt()accepts params directly (stateless) - Output Cleaning:
extract_final_prompt()removes reasoning blocks - Timeout: Default 120s, configurable via
--timeout
What's inside
1 project overview, 1 key files list, 1 usage section, 1 requirements list, 1 development notes section
Change this for your project
- Replace
qwen3:8bwith your Ollama model name - Replace
config/templates.yamlpath if you move templates - Replace
Limbicnation/prompt-genwith your own repository URL
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Related Documents
Totem — Development Rules
Defines team-wide conventions for a pnpm monorepo: branch strategy, commit rules, tooling, and a mandatory knowledge-search workflow before coding.
MechCAD-MLLM
Proposes a MLLM + dual-decoder architecture for mechanical CAD generation, combining Drawing2CAD and CAD-GPT ideas.
Agent Instructions
Defines a three-layer architecture (directive, orchestration, execution) for AI agents that self-anneal errors and update living SOPs.