Astridkraft commited on
Commit
543a829
·
verified ·
1 Parent(s): fdf504d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -1
app.py CHANGED
@@ -1569,13 +1569,32 @@ def main_ui():
1569
 
1570
  return demo
1571
 
 
1572
  if __name__ == "__main__":
1573
  demo = main_ui()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1574
  demo.queue(max_size=3)
1575
  demo.launch(
1576
  server_name="0.0.0.0",
1577
  server_port=7860,
1578
- max_file_size="15MB",
 
 
 
1579
  show_error=True,
1580
  share=False,
1581
  ssr_mode=False
 
1569
 
1570
  return demo
1571
 
1572
+
1573
  if __name__ == "__main__":
1574
  demo = main_ui()
1575
+
1576
+ # ---- MODELLE VORLADEN (NEU) ----
1577
+ print("🚀 Pre-loading models for faster first response...")
1578
+ try:
1579
+ # Lade das Hauptmodell
1580
+ txt2img_pipe = load_txt2img("runwayml/stable-diffusion-v1-5")
1581
+ print("✅ Base model loaded.")
1582
+ # Versuche, die ControlNet-Pipelines zu laden
1583
+ _ = load_img2img(keep_environment=True) # Depth + Canny
1584
+ _ = load_img2img(keep_environment=False) # OpenPose + Canny
1585
+ print("✅ ControlNet pipelines loaded.")
1586
+ except Exception as e:
1587
+ print(f"⚠️ Some models could not be pre-loaded: {e}. They will load on first use.")
1588
+ # ---- ENDE MODELLE VORLADEN ----
1589
+
1590
  demo.queue(max_size=3)
1591
  demo.launch(
1592
  server_name="0.0.0.0",
1593
  server_port=7860,
1594
+ max_file_size="20MB",
1595
+ request_timeout=600,
1596
+ stream_timeout=300,
1597
+ allowed_paths=["."],
1598
  show_error=True,
1599
  share=False,
1600
  ssr_mode=False