Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -35,17 +35,26 @@ high_threshold = 200
|
|
35 |
|
36 |
# Models
|
37 |
pose_model = OpenposeDetector.from_pretrained("lllyasviel/ControlNet")
|
|
|
38 |
controlnet = ControlNetModel.from_pretrained(
|
39 |
"lllyasviel/sd-controlnet-openpose", torch_dtype=torch.float16
|
40 |
)
|
41 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
42 |
"runwayml/stable-diffusion-v1-5", controlnet=controlnet, safety_checker=None, torch_dtype=torch.float16
|
43 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
45 |
|
46 |
# This command loads the individual model components on GPU on-demand. So, we don't
|
47 |
# need to explicitly call pipe.to("cuda").
|
48 |
-
pipe.enable_model_cpu_offload()
|
49 |
|
50 |
# xformers
|
51 |
pipe.enable_xformers_memory_efficient_attention()
|
|
|
35 |
|
36 |
# Models
|
37 |
pose_model = OpenposeDetector.from_pretrained("lllyasviel/ControlNet")
|
38 |
+
'''
|
39 |
controlnet = ControlNetModel.from_pretrained(
|
40 |
"lllyasviel/sd-controlnet-openpose", torch_dtype=torch.float16
|
41 |
)
|
42 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
43 |
"runwayml/stable-diffusion-v1-5", controlnet=controlnet, safety_checker=None, torch_dtype=torch.float16
|
44 |
)
|
45 |
+
'''
|
46 |
+
|
47 |
+
controlnet = ControlNetModel.from_pretrained(
|
48 |
+
"lllyasviel/sd-controlnet-openpose", torch_dtype=torch.get_default_dtype()
|
49 |
+
)
|
50 |
+
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
51 |
+
"runwayml/stable-diffusion-v1-5", controlnet=controlnet, safety_checker=None, torch_dtype=torch.get_default_dtype()
|
52 |
+
)
|
53 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
54 |
|
55 |
# This command loads the individual model components on GPU on-demand. So, we don't
|
56 |
# need to explicitly call pipe.to("cuda").
|
57 |
+
#pipe.enable_model_cpu_offload()
|
58 |
|
59 |
# xformers
|
60 |
pipe.enable_xformers_memory_efficient_attention()
|