openfree commited on
Commit
c2badc2
·
verified ·
1 Parent(s): e2fa285

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
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
- state_dict = load_state_dict(model_file)
 
 
 
 
27
  model, _, _, _, _ = ControlNetModel_Union._load_pretrained_model(
28
- controlnet_model, state_dict, model_file, "xinsir/controlnet-union-sdxl-1.0"
29
  )
30
- model.to(device="cuda", dtype=torch.float16)
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