prithivMLmods commited on
Commit
3297fb3
·
verified ·
1 Parent(s): 5e78460

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -24,11 +24,20 @@ model_file = hf_hub_download(
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
34
  ).to("cuda")
 
24
  filename="diffusion_pytorch_model_promax.safetensors",
25
  )
26
  state_dict = load_state_dict(model_file)
27
+
28
+ # **Fix**: pass loaded_keys into _load_pretrained_model
29
  model, _, _, _, _ = ControlNetModel_Union._load_pretrained_model(
30
+ controlnet_model,
31
+ state_dict,
32
+ loaded_keys,
33
+ model_file,
34
+ "xinsir/controlnet-union-sdxl-1.0",
35
  )
36
+
37
  model.to(device="cuda", dtype=torch.float16)
38
 
39
+ #----------------------
40
+
41
  vae = AutoencoderKL.from_pretrained(
42
  "madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16
43
  ).to("cuda")