Spaces:
Runtime error
Runtime error
lixiang46
commited on
Commit
β’
95ce3cf
1
Parent(s):
08f2519
debug
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ unet = UNet2DConditionModel.from_pretrained(f"{ckpt_dir}/unet", revision=None).h
|
|
34 |
controlnet_depth = ControlNetModel.from_pretrained(f"{ckpt_dir_depth}", revision=None).half().to(device)
|
35 |
controlnet_canny = ControlNetModel.from_pretrained(f"{ckpt_dir_canny}", revision=None).half().to(device)
|
36 |
|
37 |
-
image_encoder = CLIPVisionModelWithProjection.from_pretrained(f'{ckpt_dir_ipa}/
|
38 |
ip_img_size = 336
|
39 |
clip_image_processor = CLIPImageProcessor(size=ip_img_size, crop_size=ip_img_size )
|
40 |
|
@@ -63,7 +63,7 @@ def load_ipa(pipe):
|
|
63 |
if hasattr(pipe.unet, 'encoder_hid_proj'):
|
64 |
pipe.unet.text_encoder_hid_proj = pipe.unet.encoder_hid_proj
|
65 |
|
66 |
-
pipe.load_ip_adapter(
|
67 |
return pipe
|
68 |
|
69 |
@spaces.GPU
|
|
|
34 |
controlnet_depth = ControlNetModel.from_pretrained(f"{ckpt_dir_depth}", revision=None).half().to(device)
|
35 |
controlnet_canny = ControlNetModel.from_pretrained(f"{ckpt_dir_canny}", revision=None).half().to(device)
|
36 |
|
37 |
+
image_encoder = CLIPVisionModelWithProjection.from_pretrained(f'{ckpt_dir_ipa}/image_encoder', ignore_mismatched_sizes=True).to(dtype=torch.float16, device=device)
|
38 |
ip_img_size = 336
|
39 |
clip_image_processor = CLIPImageProcessor(size=ip_img_size, crop_size=ip_img_size )
|
40 |
|
|
|
63 |
if hasattr(pipe.unet, 'encoder_hid_proj'):
|
64 |
pipe.unet.text_encoder_hid_proj = pipe.unet.encoder_hid_proj
|
65 |
|
66 |
+
pipe.load_ip_adapter(f'{ckpt_dir_ipa}' , subfolder="", weight_name=["ip_adapter_plus_general.bin"])
|
67 |
return pipe
|
68 |
|
69 |
@spaces.GPU
|