Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -67,22 +67,18 @@ def predict(input_image_path, prompt, negative_prompt, controlnet_scale):
|
|
67 |
prompt = remove_color(prompt)
|
68 |
print(prompt)
|
69 |
|
70 |
-
# Always use 1.0 for controlnet_conditioning_scale regardless of the input parameter
|
71 |
-
fixed_controlnet_scale = 1.0
|
72 |
-
|
73 |
output_image = pipe(
|
74 |
image=resize_base_image,
|
75 |
control_image=resize_image,
|
76 |
strength=1.0,
|
77 |
prompt=prompt,
|
78 |
negative_prompt=negative_prompt,
|
79 |
-
controlnet_conditioning_scale=
|
80 |
generator=generator,
|
81 |
num_inference_steps=40,
|
82 |
eta=1.0,
|
83 |
).images[0]
|
84 |
print(f"Time taken: {time.time() - last_time}")
|
85 |
-
print(f"Requested controlnet scale: {controlnet_scale}, Used scale: {fixed_controlnet_scale}")
|
86 |
output_image = output_image.resize(input_image.size, Image.LANCZOS)
|
87 |
return output_image
|
88 |
|
|
|
67 |
prompt = remove_color(prompt)
|
68 |
print(prompt)
|
69 |
|
|
|
|
|
|
|
70 |
output_image = pipe(
|
71 |
image=resize_base_image,
|
72 |
control_image=resize_image,
|
73 |
strength=1.0,
|
74 |
prompt=prompt,
|
75 |
negative_prompt=negative_prompt,
|
76 |
+
controlnet_conditioning_scale=float(controlnet_scale),
|
77 |
generator=generator,
|
78 |
num_inference_steps=40,
|
79 |
eta=1.0,
|
80 |
).images[0]
|
81 |
print(f"Time taken: {time.time() - last_time}")
|
|
|
82 |
output_image = output_image.resize(input_image.size, Image.LANCZOS)
|
83 |
return output_image
|
84 |
|