Spaces:
Running
Running
A newer version of the Gradio SDK is available: 6.24.0
AGENTS.md
ВАЖНО — язык общения: Всегда отвечай пользователю только на русском языке, независимо от языка кода или комментариев в репозитории. Пользователь слабо понимает английский.
Project instructions for AI coding agents working on Whyx-PROmpTea (Whyx-PROptimizer).
Overview
Gradio web app that rewrites, expands, and generates variations of Stable Diffusion
prompts. Core logic lives in src/, UI in app.py, visual theme in theme/whyx_theme.py,
data/tag pools in data/.
Environment
- Python 3.13 (a
.venv/virtualenv is present in the project root for local dev). - Gradio 5.x / 6.x (do NOT pin gradio in requirements.txt — HF Spaces pins its own).
app.pyauto-detects via_GRADIO_MAJOR:- Gradio 5:
theme,css,headgo ingr.Blocks() - Gradio 6:
theme,css,headgo indemo.launch()
- Gradio 5:
Conventions
- Keep source modules under
src/; import asfrom src import .... - Tag pools are JSON files under
data/tag_pools/; do not commit generated runtime files likedata/session_history.jsonif they become corrupt — reset to[]. - Ratings map centrally through
src.safety_filter: UI ratings (pg,pg13,pg16,r,r+) must never be hard-coded to tag-pool ratings elsewhere. data/negative_templates.jsonis the single source of truth for negative-prompt strings.- The artist pool (
data/tag_pools/artist.json) can be refreshed withscripts/fetch_top_artists.pyand post-enriched withscripts/enrich_artist_signatures.py.
Verification
- Import check:
.venv\Scripts\python.exe -c "import app"should succeed with no errors. - Functional check: parse/rewrite/generate via
src.prompt_parser,src.prompt_rewriter,src.variation_engine. - Tests: run
.venv\Scripts\python.exe -m pytest tests/ -q(21+ expected passes). - Run the app:
.venv\Scripts\python.exe app.pyand confirm it serves HTTP 200 on the configured port.