Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -23,11 +23,15 @@ model_file = hf_hub_download(
|
|
23 |
"xinsir/controlnet-union-sdxl-1.0",
|
24 |
filename="diffusion_pytorch_model_promax.safetensors",
|
25 |
)
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
model, _, _, _, _ = ControlNetModel_Union._load_pretrained_model(
|
28 |
-
controlnet_model, state_dict, model_file, "xinsir/controlnet-union-sdxl-1.0"
|
29 |
)
|
30 |
-
|
31 |
|
32 |
vae = AutoencoderKL.from_pretrained(
|
33 |
"madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16
|
|
|
23 |
"xinsir/controlnet-union-sdxl-1.0",
|
24 |
filename="diffusion_pytorch_model_promax.safetensors",
|
25 |
)
|
26 |
+
|
27 |
+
# First extract the keys from the state_dict
|
28 |
+
loaded_keys = list(state_dict.keys())
|
29 |
+
|
30 |
+
# Then call the method with the additional parameter
|
31 |
model, _, _, _, _ = ControlNetModel_Union._load_pretrained_model(
|
32 |
+
controlnet_model, state_dict, model_file, "xinsir/controlnet-union-sdxl-1.0", loaded_keys
|
33 |
)
|
34 |
+
|
35 |
|
36 |
vae = AutoencoderKL.from_pretrained(
|
37 |
"madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16
|