Astridkraft commited on
Commit
c3d1d7f
·
verified ·
1 Parent(s): 38acc2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -14
app.py CHANGED
@@ -387,22 +387,43 @@ def main_ui():
387
  )
388
 
389
  generate_btn = gr.Button("Bild generieren", variant="primary")
390
- txt_output = gr.Image(
391
- label="Generiertes Bild",
392
- show_download_button=True,
393
- type="pil"
394
- )
395
 
396
- # TEXT INTEGRATION FÜR TEXT-zu-BILD
397
- text_input_t2i, text_x_t2i, text_y_t2i, text_btn_t2i = create_text_integration_section_t2i()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
 
399
- # VORSCHAU FÜR TEXT POSITION
400
- preview_t2i = gr.Image(
401
- label="Vorschau für Textposition (Klicken/Tippen um Position zu wählen)",
402
- interactive=True,
403
- show_download_button=False,
404
- type="pil"
405
- )
 
 
 
 
 
 
 
 
 
 
 
406
 
407
  # CLICK HANDLER FÜR TEXT-zu-BILD
408
  preview_t2i.select(
 
387
  )
388
 
389
  generate_btn = gr.Button("Bild generieren", variant="primary")
 
 
 
 
 
390
 
391
+ # NEUE ANORDNUNG: Bilder nebeneinander
392
+ with gr.Row():
393
+ with gr.Column():
394
+ txt_output = gr.Image(
395
+ label="Generiertes Bild",
396
+ show_download_button=True,
397
+ type="pil",
398
+ height=400
399
+ )
400
+ with gr.Column():
401
+ preview_t2i = gr.Image(
402
+ label="Vorschau für Textposition (Klicken/Tippen um Position zu wählen)",
403
+ interactive=True,
404
+ show_download_button=False,
405
+ type="pil",
406
+ height=400
407
+ )
408
 
409
+ # TEXT INTEGRATION UNTERHALB DER BILDER
410
+ with gr.Row():
411
+ gr.Markdown("### 📝 Text auf Bild integrieren")
412
+
413
+ with gr.Row():
414
+ text_input_t2i = gr.Textbox(
415
+ label="Text eingeben",
416
+ placeholder="Dein Text hier...",
417
+ max_lines=2,
418
+ scale=3
419
+ )
420
+
421
+ with gr.Row():
422
+ text_x_t2i = gr.Number(value=None, visible=False)
423
+ text_y_t2i = gr.Number(value=None, visible=False)
424
+
425
+ with gr.Row():
426
+ text_btn_t2i = gr.Button("📝 Text auf generiertes Bild", variant="secondary")
427
 
428
  # CLICK HANDLER FÜR TEXT-zu-BILD
429
  preview_t2i.select(