Astridkraft commited on
Commit
79b9a95
·
verified ·
1 Parent(s): 6267596

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -4
app.py CHANGED
@@ -1560,14 +1560,16 @@ def main_ui():
1560
  with gr.Row():
1561
  with gr.Column():
1562
  img_prompt = gr.Textbox(
1563
- placeholder="change background to beach with palm trees, keep person unchanged, sunny day",
 
1564
  lines=2,
1565
  label="🎯 Transformations-Prompt (Englisch)",
1566
  info="Was soll verändert werden? Sei spezifisch."
1567
  )
1568
  with gr.Column():
1569
  img_neg_prompt = gr.Textbox(
1570
- placeholder="blurry, deformed, ugly, bad anatomy, extra limbs, poorly drawn hands",
 
1571
  lines=2,
1572
  label="🚫 Negativ-Prompt (Englisch)",
1573
  info="Was soll vermieden werden? Unerwünschte Elemente auflisten."
@@ -1682,8 +1684,37 @@ def main_ui():
1682
  inputs=coordinate_inputs,
1683
  outputs=preview_output
1684
  )
1685
-
1686
- # NEU: Mode-Radio-Button ändert auch Live-Vorschau
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1687
  mode_radio.change(
1688
  fn=update_live_preview,
1689
  inputs=coordinate_inputs,
 
1560
  with gr.Row():
1561
  with gr.Column():
1562
  img_prompt = gr.Textbox(
1563
+ value="[STIL] von [HAUPTMOTIV], [UMGEBUNG], [DETAILS], [QUALITÄT], [BELEUCHTUNG]", # STARTWERT!
1564
+ #placeholder="change background to beach with palm trees, keep person unchanged, sunny day",
1565
  lines=2,
1566
  label="🎯 Transformations-Prompt (Englisch)",
1567
  info="Was soll verändert werden? Sei spezifisch."
1568
  )
1569
  with gr.Column():
1570
  img_neg_prompt = gr.Textbox(
1571
+ value="[GESICHTER], [FEHLER], [QUALITÄT], [UNERWÜNSCHTES]", # STARTWERT!
1572
+ #placeholder="blurry, deformed, ugly, bad anatomy, extra limbs, poorly drawn hands",
1573
  lines=2,
1574
  label="🚫 Negativ-Prompt (Englisch)",
1575
  info="Was soll vermieden werden? Unerwünschte Elemente auflisten."
 
1684
  inputs=coordinate_inputs,
1685
  outputs=preview_output
1686
  )
1687
+
1688
+
1689
+ # 2. PLATZHALTER-FUNKTION
1690
+ def update_placeholders(mode):
1691
+ """Gibt strukturierte Vorlagenformeln für jeden Modus zurück"""
1692
+ if mode == "environment_change":
1693
+ return (
1694
+ "[STIL] von [HAUPTMOTIV], [UMGEBUNG], [DETAILS], [QUALITÄT], [BELEUCHTUNG]",
1695
+ "[GESICHTER], [FEHLER], [QUALITÄT], [UNERWÜNSCHTES]"
1696
+ )
1697
+ elif mode == "focus_change":
1698
+ return (
1699
+ "[GESICHTSBESCHREIBUNG], [KLEIDUNG], [POSITION], [DETAILS], [STIL]",
1700
+ "[DEFORMIERT], [UNSCHÄRFE], [ANATOMIEFEHLER], [UNERWÜNSCHTES]"
1701
+ )
1702
+ else: # face_only_change
1703
+ return (
1704
+ "[HAARFARBE], [AUGEN], [GESICHTSAUSDRUCK], [DETAILS], [BELEUCHTUNG]",
1705
+ "[UNREALISTISCH], [ASYMETRISCH], [FEHLER], [UNERWÜNSCHTES]"
1706
+ )
1707
+
1708
+
1709
+ # 3. EVENT-HANDLER zur Änderung Textbox-Info
1710
+ mode_radio.change(
1711
+ fn=update_placeholders,
1712
+ inputs=[mode_radio],
1713
+ outputs=[img_prompt, img_neg_prompt]
1714
+ )
1715
+
1716
+
1717
+ # Mode-Radio-Button ändert auch Live-Vorschau
1718
  mode_radio.change(
1719
  fn=update_live_preview,
1720
  inputs=coordinate_inputs,