Astridkraft commited on
Commit
e4ff977
·
verified ·
1 Parent(s): d6cfce8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -31
app.py CHANGED
@@ -1576,34 +1576,4 @@ def main_ui():
1576
  concurrency_limit=1
1577
  )
1578
 
1579
- return demo
1580
-
1581
-
1582
- if __name__ == "__main__":
1583
- demo = main_ui() #dadurch wird UI erstellt!
1584
-
1585
- # ---- MODELLE VORLADEN (NEU) ----
1586
- print("🚀 Pre-loading models for faster first response...")
1587
- try:
1588
- # Lade das Hauptmodell
1589
- txt2img_pipe = load_txt2img("runwayml/stable-diffusion-v1-5")
1590
- print("✅ Base model loaded.")
1591
- # Versuche, die ControlNet-Pipelines zu laden
1592
- _ = load_img2img(keep_environment=True) # Depth + Canny
1593
- _ = load_img2img(keep_environment=False) # OpenPose + Canny
1594
- print("✅ ControlNet pipelines loaded.")
1595
- except Exception as e:
1596
- print(f"⚠️ Some models could not be pre-loaded: {e}. They will load on first use.")
1597
- # ---- ENDE MODELLE VORLADEN ----
1598
-
1599
- demo.queue(max_size=3)
1600
- #Server starten mit den Parametern
1601
- #demo.launch(
1602
- # server_name="0.0.0.0",
1603
- # server_port=7860,
1604
- # max_file_size="50MB",
1605
- # allowed_paths=["."],
1606
- # show_error=True,
1607
- # share=False,
1608
- # ssr_mode=False
1609
- #)
 
1576
  concurrency_limit=1
1577
  )
1578
 
1579
+ return demo