Update handler.py
Browse files- handler.py +3 -4
handler.py
CHANGED
@@ -52,14 +52,12 @@ def load_models():
|
|
52 |
"lllyasviel/control_v11f1e_sd15_tile",
|
53 |
torch_dtype=torch.float16,
|
54 |
)
|
55 |
-
|
56 |
-
|
57 |
controlnet_brightness = ControlNetModel.from_pretrained(
|
58 |
"ioclab/control_v1p_sd15_brightness",
|
59 |
torch_dtype=torch.float16,
|
60 |
)
|
61 |
-
|
62 |
-
|
63 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
64 |
MODEL_ID,
|
65 |
controlnet=[
|
@@ -74,6 +72,7 @@ def load_models():
|
|
74 |
pipe.to("cuda")
|
75 |
|
76 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
|
|
77 |
pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
|
78 |
return pipe
|
79 |
|
|
|
52 |
"lllyasviel/control_v11f1e_sd15_tile",
|
53 |
torch_dtype=torch.float16,
|
54 |
)
|
55 |
+
|
|
|
56 |
controlnet_brightness = ControlNetModel.from_pretrained(
|
57 |
"ioclab/control_v1p_sd15_brightness",
|
58 |
torch_dtype=torch.float16,
|
59 |
)
|
60 |
+
|
|
|
61 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
62 |
MODEL_ID,
|
63 |
controlnet=[
|
|
|
72 |
pipe.to("cuda")
|
73 |
|
74 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
75 |
+
pipe.enable_vae_slicing()
|
76 |
pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
|
77 |
return pipe
|
78 |
|