AI-Edit-Ebene via OpenRouter (Gemini Image): Studio-Hintergrund, Retusche, Restaurierung + freier Prompt
- app/ai_edit.py: OpenRouter chat/completions (image in/out), Presets + Prompt, Retry - bot: AI-Preset-Buttons + Bildunterschrift = freier AI-Prompt; _process refaktoriert - Freistellen/Upscaling bleiben lokal (originaltreu); AI-Edit fuer generative Edits - httpx pin, config OPENROUTER_* Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNQ8ghPfzAfsyVYd6HgFb6
This commit is contained in:
@@ -63,6 +63,17 @@ POST_SHARPEN: bool = _get_bool("POST_SHARPEN", True)
|
||||
# JPEG-Qualitaet fuer zurueckgesendete Fotos (Freistellen liefert immer PNG).
|
||||
JPEG_QUALITY: int = _get_int("JPEG_QUALITY", 95)
|
||||
|
||||
# --- OpenRouter (generative AI-Edits: Hintergrund, Retusche, freier Prompt) --
|
||||
# Achtung: US-gehostet (Google/OpenAI via OpenRouter). Bewusst gesetzt.
|
||||
OPENROUTER_API_KEY: str = os.getenv("OPENROUTER_API_KEY", "").strip()
|
||||
OPENROUTER_BASE: str = os.getenv("OPENROUTER_BASE", "https://openrouter.ai/api/v1")
|
||||
OPENROUTER_MODEL: str = os.getenv("OPENROUTER_MODEL", "google/gemini-3.1-flash-image")
|
||||
OPENROUTER_TIMEOUT: int = _get_int("OPENROUTER_TIMEOUT", 120)
|
||||
# Laengste Kante, auf die Eingangsbilder vor dem Senden verkleinert werden
|
||||
# (Kosten/Tempo). Das Modell gibt ohnehin ~1024px-Ausgaben zurueck.
|
||||
AI_EDIT_MAX_EDGE: int = _get_int("AI_EDIT_MAX_EDGE", 1536)
|
||||
AI_EDIT_ENABLED: bool = bool(OPENROUTER_API_KEY)
|
||||
|
||||
# --- Health-Server ----------------------------------------------------------
|
||||
HEALTH_PORT: int = _get_int("PORT", 8080)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user