Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,8 @@ from PIL import Image
|
|
9 |
MAX_SEED = np.iinfo(np.int32).max
|
10 |
MAX_IMAGE_SIZE = 1024
|
11 |
IP_ADAPTER = 'h94/IP-Adapter'
|
12 |
-
WEIGHT_NAME = "ip-
|
|
|
13 |
|
14 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
15 |
model_default = "stable-diffusion-v1-5/stable-diffusion-v1-5"
|
@@ -112,7 +113,7 @@ def infer(
|
|
112 |
).to(device)
|
113 |
|
114 |
# Загрузка IP-Adapter
|
115 |
-
pipe_ip_adapter.load_ip_adapter(IP_ADAPTER, subfolder="models", weight_name=
|
116 |
pipe_ip_adapter.set_ip_adapter_scale(ip_adapter_strength)
|
117 |
|
118 |
# Преобразование изображений для IP-Adapter (размер 224x224)
|
|
|
9 |
MAX_SEED = np.iinfo(np.int32).max
|
10 |
MAX_IMAGE_SIZE = 1024
|
11 |
IP_ADAPTER = 'h94/IP-Adapter'
|
12 |
+
WEIGHT_NAME = "ip-adapter_sd15.bin"
|
13 |
+
WEIGHT_NAME_plus = "ip-adapter-plus_sd15.bin"
|
14 |
|
15 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
16 |
model_default = "stable-diffusion-v1-5/stable-diffusion-v1-5"
|
|
|
113 |
).to(device)
|
114 |
|
115 |
# Загрузка IP-Adapter
|
116 |
+
pipe_ip_adapter.load_ip_adapter(IP_ADAPTER, subfolder="models", weight_name=WEIGHT_NAME_plus)
|
117 |
pipe_ip_adapter.set_ip_adapter_scale(ip_adapter_strength)
|
118 |
|
119 |
# Преобразование изображений для IP-Adapter (размер 224x224)
|