Update README.md
Browse files
README.md
CHANGED
@@ -39,6 +39,13 @@ pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
|
39 |
base_model_path, controlnet=controlnet, torch_dtype=torch.float16
|
40 |
)
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
control_image = load_image("./cond1.jpg")
|
43 |
prompt = "a professional studio photograph of an attractive model wearing a teal top with lace detail"
|
44 |
|
|
|
39 |
base_model_path, controlnet=controlnet, torch_dtype=torch.float16
|
40 |
)
|
41 |
|
42 |
+
# speed up diffusion process with faster scheduler and memory optimization
|
43 |
+
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
44 |
+
# remove following line if xformers is not installed or when using Torch 2.0.
|
45 |
+
#pipe.enable_xformers_memory_efficient_attention()
|
46 |
+
# memory optimization.
|
47 |
+
pipe.enable_model_cpu_offload()
|
48 |
+
|
49 |
control_image = load_image("./cond1.jpg")
|
50 |
prompt = "a professional studio photograph of an attractive model wearing a teal top with lace detail"
|
51 |
|