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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -13,6 +13,9 @@ import random
13
  import re
14
  from PIL import ImageFilter # Für GaussianBlur wird nur für SAM benötigt!
15
 
 
 
 
16
  # === OPTIMIERTE EINSTELLUNGEN ===
17
  device = "cuda" if torch.cuda.is_available() else "cpu"
18
  torch_dtype = torch.float16 if device == "cuda" else torch.float32
@@ -576,7 +579,9 @@ def load_img2img(keep_environment=False):
576
  controlnet=[controlnet_depth, controlnet_canny], # Depth zuerst!
577
  torch_dtype=torch_dtype,
578
  safety_checker=None,
579
- requires_safety_checker=False
 
 
580
  ).to(device)
581
 
582
  # Scheduler konfigurieren
@@ -619,7 +624,9 @@ def load_img2img(keep_environment=False):
619
  controlnet=[controlnet_openpose, controlnet_canny], # OpenPose zuerst!
620
  torch_dtype=torch_dtype,
621
  safety_checker=None,
622
- requires_safety_checker=False
 
 
623
  ).to(device)
624
 
625
  # Scheduler konfigurieren
 
13
  import re
14
  from PIL import ImageFilter # Für GaussianBlur wird nur für SAM benötigt!
15
 
16
+
17
+ os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1" # 2x schnellerer Download
18
+
19
  # === OPTIMIERTE EINSTELLUNGEN ===
20
  device = "cuda" if torch.cuda.is_available() else "cpu"
21
  torch_dtype = torch.float16 if device == "cuda" else torch.float32
 
579
  controlnet=[controlnet_depth, controlnet_canny], # Depth zuerst!
580
  torch_dtype=torch_dtype,
581
  safety_checker=None,
582
+ requires_safety_checker=False,
583
+ cache_dir="/tmp/models",
584
+ use_safetensors=True
585
  ).to(device)
586
 
587
  # Scheduler konfigurieren
 
624
  controlnet=[controlnet_openpose, controlnet_canny], # OpenPose zuerst!
625
  torch_dtype=torch_dtype,
626
  safety_checker=None,
627
+ requires_safety_checker=False,
628
+ cache_dir="/tmp/models",
629
+ use_safetensors=True
630
  ).to(device)
631
 
632
  # Scheduler konfigurieren