Spaces:
Running
on
Zero
Running
on
Zero
Update model.py
Browse files
model.py
CHANGED
|
@@ -21,9 +21,9 @@ CONTROLNET_MODEL_IDS = {
|
|
| 21 |
}
|
| 22 |
|
| 23 |
|
| 24 |
-
def download_all_controlnet_weights() -> None:
|
| 25 |
-
|
| 26 |
-
|
| 27 |
|
| 28 |
|
| 29 |
class Model:
|
|
@@ -57,7 +57,7 @@ class Model:
|
|
| 57 |
beta_schedule="scaled_linear",
|
| 58 |
num_train_timesteps=1000,
|
| 59 |
steps_offset=1
|
| 60 |
-
)
|
| 61 |
# pipe.enable_freeu(b1=1.1, b2=1.1, s1=0.5, s2=0.7)
|
| 62 |
pipe.enable_xformers_memory_efficient_attention()
|
| 63 |
pipe.force_zeros_for_empty_prompt = False
|
|
@@ -176,6 +176,11 @@ class Model:
|
|
| 176 |
prompt=prompt, negative_prompt=negative_prompt, control_image=canny_image, num_steps=num_steps, controlnet_conditioning_scale=float(controlnet_conditioning_scale), seed=seed, num_images=1,
|
| 177 |
)
|
| 178 |
print(f'Image is {results[0]}')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
return [canny_image, results[0]]
|
| 180 |
|
| 181 |
|
|
|
|
| 21 |
}
|
| 22 |
|
| 23 |
|
| 24 |
+
# def download_all_controlnet_weights() -> None:
|
| 25 |
+
# for model_id in CONTROLNET_MODEL_IDS.values():
|
| 26 |
+
# ControlNetModel.from_pretrained(model_id)
|
| 27 |
|
| 28 |
|
| 29 |
class Model:
|
|
|
|
| 57 |
beta_schedule="scaled_linear",
|
| 58 |
num_train_timesteps=1000,
|
| 59 |
steps_offset=1
|
| 60 |
+
)
|
| 61 |
# pipe.enable_freeu(b1=1.1, b2=1.1, s1=0.5, s2=0.7)
|
| 62 |
pipe.enable_xformers_memory_efficient_attention()
|
| 63 |
pipe.force_zeros_for_empty_prompt = False
|
|
|
|
| 176 |
prompt=prompt, negative_prompt=negative_prompt, control_image=canny_image, num_steps=num_steps, controlnet_conditioning_scale=float(controlnet_conditioning_scale), seed=seed, num_images=1,
|
| 177 |
)
|
| 178 |
print(f'Image is {results[0]}')
|
| 179 |
+
print(prompt)
|
| 180 |
+
print(negative_prompt)
|
| 181 |
+
print(num_steps)
|
| 182 |
+
print(controlnet_conditioning_scale)
|
| 183 |
+
print(seed)
|
| 184 |
return [canny_image, results[0]]
|
| 185 |
|
| 186 |
|