TheAIBoi commited on
Commit
fccbc96
·
verified ·
1 Parent(s): 52386fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -11,6 +11,8 @@ from controlnet_aux import OpenposeDetector
11
  import insightface
12
  import onnxruntime
13
 
 
 
14
  device = "cuda" if torch.cuda.is_available() else "cpu"
15
  model_repo_id = "RunDiffusion/Juggernaut-XL-v9" # Replace to the model you would like to use
16
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
@@ -39,6 +41,7 @@ openpose_detector = OpenposeDetector.from_pretrained("lllyasviel/ControlNet").to
39
 
40
  try:
41
  pipe.load_ip_adapter("h94/IP-Adapter", subfolder="sdxl_models", weight_name="ip-adapter-plus-face_sdxl_vit-h.safetensors")
 
42
  except Exception as e:
43
  print(f"Could not load IP-Adapter FaceID. Make sure the model exists and paths are correct: {e}")
44
  print("Trying a common alternative: ip-adapter-plus-face_sdxl_vit-h.safetensors")
 
11
  import insightface
12
  import onnxruntime
13
 
14
+ ip_adapter_loaded = False
15
+
16
  device = "cuda" if torch.cuda.is_available() else "cpu"
17
  model_repo_id = "RunDiffusion/Juggernaut-XL-v9" # Replace to the model you would like to use
18
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
 
41
 
42
  try:
43
  pipe.load_ip_adapter("h94/IP-Adapter", subfolder="sdxl_models", weight_name="ip-adapter-plus-face_sdxl_vit-h.safetensors")
44
+ ip_adapter_loaded = True
45
  except Exception as e:
46
  print(f"Could not load IP-Adapter FaceID. Make sure the model exists and paths are correct: {e}")
47
  print("Trying a common alternative: ip-adapter-plus-face_sdxl_vit-h.safetensors")