Deadmon commited on
Commit
397288e
·
verified ·
1 Parent(s): dd2f728

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -98,7 +98,8 @@ def generate_image(prompt, control_image, control_mode, num_steps=50, guidance=4
98
  x = get_noise(1, height, width, device=torch_device, dtype=torch.bfloat16, seed=seed)
99
  inp_cond = prepare(t5=t5, clip=clip, img=x, prompt=prompt)
100
 
101
- x = denoise_controlnet(model, **inp_cond, controlnet=controlnet, timesteps=timesteps, guidance=guidance, controlnet_cond=controlnet_cond, control_mode=control_modes.index(control_mode))
 
102
 
103
  x = unpack(x.float(), height, width)
104
  x = ae.decode(x)
 
98
  x = get_noise(1, height, width, device=torch_device, dtype=torch.bfloat16, seed=seed)
99
  inp_cond = prepare(t5=t5, clip=clip, img=x, prompt=prompt)
100
 
101
+ controlnet.control_mode = control_modes.index(control_mode) # Set the control mode directly in the controlnet model
102
+ x = denoise_controlnet(model, **inp_cond, controlnet=controlnet, timesteps=timesteps, guidance=guidance, controlnet_cond=controlnet_cond)
103
 
104
  x = unpack(x.float(), height, width)
105
  x = ae.decode(x)