Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -235,59 +235,81 @@ def update_bbox_from_image(image):
|
|
| 235 |
return bbox[0], bbox[1], bbox[2], bbox[3]
|
| 236 |
|
| 237 |
def main_ui():
|
| 238 |
-
with gr.Blocks(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
|
| 240 |
# --- Info-Bereich (Startseite) ---
|
| 241 |
gr.Markdown(
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
<strong>Empfehlung:</strong><br>
|
| 285 |
-
Für eine präzise Abstimmung der zentralen Parameter – Prompt, Negativ-Prompt, Veränderungsstärke (Strength), Inferenz-Schritte (Steps) <br>
|
| 286 |
-
und Prompt-Stärke (Guidance) – liefern leistungsfähige Sprachmodelle wie GPT, Grok oder DeepSeek hochqualitative, kontextbezogene Vorschläge.
|
| 287 |
-
</div>
|
| 288 |
-
"""
|
| 289 |
-
)
|
| 290 |
-
|
| 291 |
|
| 292 |
# --- Button zentriert im unteren Drittel, Taupe-Farbe ---
|
| 293 |
with gr.Row():
|
|
@@ -480,27 +502,6 @@ def main_ui():
|
|
| 480 |
outputs=info_components
|
| 481 |
)
|
| 482 |
|
| 483 |
-
# --- CSS für Taupe-Button ---
|
| 484 |
-
demo.css = """
|
| 485 |
-
#start-button {
|
| 486 |
-
background-color: #0080FF !important;
|
| 487 |
-
border: none !important;
|
| 488 |
-
margin: 50px auto !important;
|
| 489 |
-
display: block !important;
|
| 490 |
-
font-weight: 600;
|
| 491 |
-
width: 280px;
|
| 492 |
-
}
|
| 493 |
-
#start-button:hover {
|
| 494 |
-
background-color: #D3D3D3 !important;
|
| 495 |
-
}
|
| 496 |
-
.hint-box {
|
| 497 |
-
margin-top: 20px;
|
| 498 |
-
}
|
| 499 |
-
.custom-text {
|
| 500 |
-
font-size: 25px !important;
|
| 501 |
-
}
|
| 502 |
-
"""
|
| 503 |
-
|
| 504 |
return demo
|
| 505 |
|
| 506 |
|
|
|
|
| 235 |
return bbox[0], bbox[1], bbox[2], bbox[3]
|
| 236 |
|
| 237 |
def main_ui():
|
| 238 |
+
with gr.Blocks(
|
| 239 |
+
title="AI Image Generator",
|
| 240 |
+
theme=gr.themes.Base(),
|
| 241 |
+
css="""
|
| 242 |
+
.info-box {
|
| 243 |
+
background-color: #f8f4f0;
|
| 244 |
+
padding: 15px;
|
| 245 |
+
border-radius: 8px;
|
| 246 |
+
border-left: 4px solid #8B7355;
|
| 247 |
+
margin: 20px 0;
|
| 248 |
+
}
|
| 249 |
+
#start-button {
|
| 250 |
+
background-color: #0080FF !important;
|
| 251 |
+
border: none !important;
|
| 252 |
+
margin: 50px auto !important;
|
| 253 |
+
display: block !important;
|
| 254 |
+
font-weight: 600;
|
| 255 |
+
width: 280px;
|
| 256 |
+
}
|
| 257 |
+
#start-button:hover {
|
| 258 |
+
background-color: #D3D3D3 !important;
|
| 259 |
+
}
|
| 260 |
+
.hint-box {
|
| 261 |
+
margin-top: 20px;
|
| 262 |
+
}
|
| 263 |
+
.custom-text {
|
| 264 |
+
font-size: 25px !important;
|
| 265 |
+
}
|
| 266 |
+
"""
|
| 267 |
+
) as demo:
|
| 268 |
|
| 269 |
# --- Info-Bereich (Startseite) ---
|
| 270 |
gr.Markdown(
|
| 271 |
+
"""
|
| 272 |
+
# Demo-Projekt: Stable Diffusion Text-to-Image / Image-to-Image
|
| 273 |
+
|
| 274 |
+
<div class="info-box">
|
| 275 |
+
Dieses Projekt ist ein kleines <strong>Demo</strong> um meine Fähigkeiten als <strong>AI-Engineer</strong>
|
| 276 |
+
in technischer Kompetenz und selbstständiger Projektstrukturierung zu zeigen.<br>
|
| 277 |
+
Der Fokus liegt auf <strong>Struktur, Konzept und technischer Umsetzung</strong>
|
| 278 |
+
im Bereich Text-to-Image / Image-to-Image mit dem Diffusionsmodell "Stable Diffusion" <br>
|
| 279 |
+
<strong>nicht</strong> auf einer vollständigen Produktionsversion.
|
| 280 |
+
</div>
|
| 281 |
+
|
| 282 |
+
<div class="info-box">
|
| 283 |
+
Zudem präsentieren die Hugging-Face-Files(<code>Main.py</code>, <code>impaint_module.py</code>, <code>UI-Gradio.py</code>)<br>
|
| 284 |
+
eine <strong>skalierbare, professionelle Architektur</strong> für Text-to-Image- und Image-to-Image-Entwicklung
|
| 285 |
+
die die <br><strong>gesamte Komplexität einer professionellen Umsetzung</strong> verdeutlicht.<br><br>
|
| 286 |
+
Die damit gezeigten Fähigkeiten meinerseits sind <strong>sicherlich auf andere Projekte übertragbar</strong>.
|
| 287 |
+
</div>
|
| 288 |
+
|
| 289 |
+
<div class="info-box">
|
| 290 |
+
<strong>Hinweis:</strong><br>
|
| 291 |
+
Die Anwendung läuft derzeit auf <strong>CPU</strong> ist jedoch <strong>vollständig GPU-fähig </strong>.
|
| 292 |
+
Deshalb muss bei jeder Generierung eine <strong>längere Wartezeit</strong> eingeplant werden.<br>
|
| 293 |
+
Der Generierungsfortschritt ist im Logfile einsehbar (Schaltfläche neben "Running").<br>
|
| 294 |
+
Bei Verbindungsabbrüchen wird die aktuelle Generierung zunächst vollständig abgeschlossen, bevor neue Anfragen bearbeitet werden. Das<br>
|
| 295 |
+
generierte Bild wird in diesem Fall <strong>nicht angezeigt</strong>. Dies gewährleistet die Stabilität des Systems und verhindert Ressourcenkonflikte. <br>
|
| 296 |
+
Die Meldung "Connection re-established" zeigt an, dass die Verbindung wiederhergestellt wurde, die laufende Verarbeitung jedoch priorisiert wird.
|
| 297 |
+
</div>
|
| 298 |
+
|
| 299 |
+
<div class="info-box">
|
| 300 |
+
Die <strong>Bild-zu-Bild-Funktion</strong> ist speziell für die Bearbeitung <strong>einzelner Personen</strong> optimiert.<br>
|
| 301 |
+
Sie ermöglicht wahlweise:<br>
|
| 302 |
+
• die gezielte <strong>Veränderung des Gesichts</strong> bei erhaltener Umgebung, oder<br>
|
| 303 |
+
• den <strong>Schutz des Motivs</strong>, während nur der <strong>Hintergrund angepasst</strong> wird.
|
| 304 |
+
</div>
|
| 305 |
+
|
| 306 |
+
<div class="info-box">
|
| 307 |
+
<strong>Empfehlung:</strong><br>
|
| 308 |
+
Für eine präzise Abstimmung der zentralen Parameter – Prompt, Negativ-Prompt, Veränderungsstärke (Strength), Inferenz-Schritte (Steps) <br>
|
| 309 |
+
und Prompt-Stärke (Guidance) – liefern leistungsfähige Sprachmodelle wie GPT, Grok oder DeepSeek hochqualitative, kontextbezogene Vorschläge.
|
| 310 |
+
</div>
|
| 311 |
+
"""
|
| 312 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
|
| 314 |
# --- Button zentriert im unteren Drittel, Taupe-Farbe ---
|
| 315 |
with gr.Row():
|
|
|
|
| 502 |
outputs=info_components
|
| 503 |
)
|
| 504 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 505 |
return demo
|
| 506 |
|
| 507 |
|