Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -27,12 +27,18 @@ pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
|
|
| 27 |
).to(DEVICE)
|
| 28 |
|
| 29 |
pipe.load_ip_adapter(
|
| 30 |
-
pretrained_model_name_or_path_or_dict=
|
| 31 |
-
subfolder="
|
| 32 |
weight_name="ip-adapter_sd15.bin"
|
| 33 |
-
# Optionally: subfolder="models" if using the repo, not a direct path
|
| 34 |
)
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
def generate_sticker(input_image, prompt):
|
| 37 |
"""
|
| 38 |
Given a user image and a prompt, generates a sticker/emoji-style portrait.
|
|
|
|
| 27 |
).to(DEVICE)
|
| 28 |
|
| 29 |
pipe.load_ip_adapter(
|
| 30 |
+
pretrained_model_name_or_path_or_dict="h94/IP-Adapter",
|
| 31 |
+
subfolder="models",
|
| 32 |
weight_name="ip-adapter_sd15.bin"
|
|
|
|
| 33 |
)
|
| 34 |
|
| 35 |
+
# pipe.load_ip_adapter(
|
| 36 |
+
# pretrained_model_name_or_path_or_dict=ADAPTER_DIR,
|
| 37 |
+
# subfolder=".", # The weights file is directly in ADAPTER_DIR
|
| 38 |
+
# weight_name="ip-adapter_sd15.bin"
|
| 39 |
+
# # Optionally: subfolder="models" if using the repo, not a direct path
|
| 40 |
+
# )
|
| 41 |
+
|
| 42 |
def generate_sticker(input_image, prompt):
|
| 43 |
"""
|
| 44 |
Given a user image and a prompt, generates a sticker/emoji-style portrait.
|