Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
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)
|