Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -29,12 +29,12 @@ model_file = hf_hub_download(
|
|
29 |
"xinsir/controlnet-union-sdxl-1.0",
|
30 |
filename="diffusion_pytorch_model_promax.safetensors",
|
31 |
)
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
|
39 |
state_dict = load_state_dict(model_file)
|
40 |
model, _, _, _, _ = ControlNetModel_Union._load_pretrained_model(
|
|
|
29 |
"xinsir/controlnet-union-sdxl-1.0",
|
30 |
filename="diffusion_pytorch_model_promax.safetensors",
|
31 |
)
|
32 |
+
|
33 |
+
# Create patched version that includes the loaded_keys parameter
|
34 |
+
def patched_load_pretrained(self, pretrained_model_name_or_path, **kwargs):
|
35 |
+
if 'loaded_keys' not in kwargs:
|
36 |
+
kwargs['loaded_keys'] = set()
|
37 |
+
return original_load_pretrained(self, pretrained_model_name_or_path, **kwargs)
|
38 |
|
39 |
state_dict = load_state_dict(model_file)
|
40 |
model, _, _, _, _ = ControlNetModel_Union._load_pretrained_model(
|