Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,7 @@ controlnet_softEdge_model_path = "lllyasviel/control_v11p_sd15_softedge"
|
|
24 |
controlnet_depth_model_path = "lllyasviel/control_v11f1p_sd15_depth"
|
25 |
# device = "cuda:0"
|
26 |
device = "cpu"
|
|
|
27 |
##################################################################################################################
|
28 |
# 1. load pipeline
|
29 |
##################################################################################################################
|
@@ -87,7 +88,7 @@ def task1_StyleTransfer(photo, blur_radius, sketch):
|
|
87 |
|
88 |
Control_factor = 1.2
|
89 |
IP_factor = 0.6
|
90 |
-
ip_model = IPAdapter(pipe_depth, image_encoder_path, ip_ckpt, device, Control_factor=Control_factor, IP_factor=IP_factor)
|
91 |
|
92 |
depth_image= Image.open(sketch)
|
93 |
img_array = np.array(depth_image)
|
|
|
24 |
controlnet_depth_model_path = "lllyasviel/control_v11f1p_sd15_depth"
|
25 |
# device = "cuda:0"
|
26 |
device = "cpu"
|
27 |
+
dtype = torch.float16 if device.type == 'cuda' else torch.float32
|
28 |
##################################################################################################################
|
29 |
# 1. load pipeline
|
30 |
##################################################################################################################
|
|
|
88 |
|
89 |
Control_factor = 1.2
|
90 |
IP_factor = 0.6
|
91 |
+
ip_model = IPAdapter(pipe_depth, image_encoder_path, ip_ckpt, device, Control_factor=Control_factor, IP_factor=IP_factor,dtype=torch.float32)
|
92 |
|
93 |
depth_image= Image.open(sketch)
|
94 |
img_array = np.array(depth_image)
|