Skip to content

All-In-One: Caption-Text To Prompt Guidance (Z-Image, Flux.2 Klein, Qwen Image)

Notifications You must be signed in to change notification settings

WasamiKirua/PromptLab

Repository files navigation

PromptLab

PromptLab is a lightweight FastAPI app for experimenting with prompt workflows. It combines a kawaii-themed UI with practical tools to generate prompts and captions.

Highlights

  • Caption to Prompt: Upload an image and get a structured prompt generated by your chosen provider.
  • Text to Prompt: Describe an idea in text and generate a prompt from it.
  • Light/Dark theme: Toggle on the Home page; the theme applies across all pages.

Requirements

  • Python 3.10+
  • uv

Installation (uv)

uv venv
source .venv/bin/activate
uv pip install -r pyproject.toml

If you prefer syncing directly from pyproject.toml:

uv pip install -r pyproject.toml

Running the App

uvicorn main:app --reload

Then open:

  • Home: http://127.0.0.1:8000/
  • CaptionToPrompt: http://127.0.0.1:8000/caption-to-prompt
  • TextToPrompt: http://127.0.0.1:8000/text-to-prompt

Configuration

Create a .env file (or copy from .env.example if present). Supported keys include:

  • GEMINI_API_KEY
  • GROK_API_KEY
  • OPENAI_API_KEY

The UI saves API keys automatically as you change them.

Interface Overview

Home

  • Landing page with a light/dark toggle.
  • Theme selection is stored in local storage and applied to all pages.

CaptionToPrompt

  • Upload an image and select a target base model.
  • Choose a provider (Gemini, Grok, OpenAI).
  • Grok includes an optional NSFW toggle to control prompt behavior.

TextToPrompt

  • Provide a text description (“Dream your picture”).
  • Choose a target base model and provider.
  • Generates a prompt from text input.

Project Layout (high level)

main.py                  # FastAPI app + routes
captioning_utils.py      # Caption + prompt generation utilities
prompts_lib.py           # Prompt helpers
templates/               # HTML templates

Notes

  • The UI is designed for fast iteration on prompts.

About

All-In-One: Caption-Text To Prompt Guidance (Z-Image, Flux.2 Klein, Qwen Image)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published