Spaces:
Running
Running
Update utils.py
Browse files
utils.py
CHANGED
@@ -12,6 +12,7 @@ from PIL import Image
|
|
12 |
# --- Place any download or path setup here ---
|
13 |
MODEL_ID ="runwayml/stable-diffusion-v1-5" # Can swap for custom path if using IP-Adapter
|
14 |
ADAPTER_PATH = "/workspace/.cache/huggingface/ip_adapter/ip-adapter_sd15.bin"
|
|
|
15 |
DEVICE = "cpu"
|
16 |
MODEL_CACHE = "/workspace/.cache/huggingface"
|
17 |
|
@@ -26,7 +27,9 @@ pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
|
|
26 |
).to(DEVICE)
|
27 |
|
28 |
pipe.load_ip_adapter(
|
29 |
-
pretrained_model_name_or_path=
|
|
|
|
|
30 |
# Optionally: subfolder="models" if using the repo, not a direct path
|
31 |
)
|
32 |
|
|
|
12 |
# --- Place any download or path setup here ---
|
13 |
MODEL_ID ="runwayml/stable-diffusion-v1-5" # Can swap for custom path if using IP-Adapter
|
14 |
ADAPTER_PATH = "/workspace/.cache/huggingface/ip_adapter/ip-adapter_sd15.bin"
|
15 |
+
ADAPTER_DIR = "/workspace/.cache/huggingface/ip_adapter"
|
16 |
DEVICE = "cpu"
|
17 |
MODEL_CACHE = "/workspace/.cache/huggingface"
|
18 |
|
|
|
27 |
).to(DEVICE)
|
28 |
|
29 |
pipe.load_ip_adapter(
|
30 |
+
pretrained_model_name_or_path=ADAPTER_DIR,
|
31 |
+
subfolder=".", # The weights file is directly in ADAPTER_DIR
|
32 |
+
weight_name="ip-adapter_sd15.bin"
|
33 |
# Optionally: subfolder="models" if using the repo, not a direct path
|
34 |
)
|
35 |
|