Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -122,11 +122,6 @@ def infer(
|
|
122 |
):
|
123 |
|
124 |
|
125 |
-
# print('ip_adapter_mode.value = ', ip_adapter_mode.value)
|
126 |
-
# print('control_mode.value = ', control_mode.value)
|
127 |
-
print('ip_adapter_mode = ', ip_adapter_mode)
|
128 |
-
print('control_mode = ', control_mode)
|
129 |
-
|
130 |
# Генерация изображений с Ip_Adapter ------------------------------------------------------------------------------------------------------------------
|
131 |
if use_ip_adapter: #and ip_source_image is not None and ip_adapter_image is not None:
|
132 |
|
@@ -151,7 +146,6 @@ def infer(
|
|
151 |
|
152 |
# #ip_adapter_mode = "pose_estimation" # Режим работы Ip_Adapter
|
153 |
|
154 |
-
#if ip_adapter_mode.value == "pose_estimation":
|
155 |
if ip_adapter_mode == "pose_estimation":
|
156 |
|
157 |
print('ip_adapter_mode = ', ip_adapter_mode)
|
@@ -198,8 +192,8 @@ def infer(
|
|
198 |
# Объединяем LoRA с основной моделью
|
199 |
pipe_ip_adapter.fuse_lora(lora_scale=lora_scale)
|
200 |
pipe_ip_adapter.lora_loaded = True # Помечаем, что LoRA загружена
|
201 |
-
|
202 |
-
# Убедимся, что ip_adapter_strength имеет тип float
|
203 |
ip_adapter_strength = float(ip_adapter_strength)
|
204 |
|
205 |
# Используем IP-Adapter с LoRA
|
@@ -241,7 +235,6 @@ def infer(
|
|
241 |
|
242 |
# #ip_adapter_mode = "edge_detection" # Режим работы Ip_Adapter
|
243 |
|
244 |
-
#if ip_adapter_mode.value == "edge_detection":
|
245 |
if ip_adapter_mode == "edge_detection":
|
246 |
|
247 |
print('ip_adapter_mode = ', ip_adapter_mode)
|
@@ -348,7 +341,6 @@ def infer(
|
|
348 |
|
349 |
# #ip_adapter_mode = "depth_map" # Режим работы Ip_Adapter
|
350 |
|
351 |
-
#if ip_adapter_mode.value == "depth_map":
|
352 |
if ip_adapter_mode == "depth_map":
|
353 |
|
354 |
print('ip_adapter_mode = ', ip_adapter_mode)
|
@@ -403,7 +395,6 @@ def infer(
|
|
403 |
|
404 |
# #control_mode = "pose_estimation" # Режим работы ControlNet
|
405 |
|
406 |
-
#if control_mode.value == "pose_estimation":
|
407 |
if control_mode == "pose_estimation":
|
408 |
|
409 |
print('control_mode = ', control_mode)
|
@@ -489,7 +480,6 @@ def infer(
|
|
489 |
|
490 |
# #control_mode = "edge_detection" # Режим работы ControlNet
|
491 |
|
492 |
-
#if control_mode.value == "edge_detection":
|
493 |
if control_mode == "edge_detection":
|
494 |
|
495 |
print('control_mode = ', control_mode)
|
@@ -541,7 +531,6 @@ def infer(
|
|
541 |
|
542 |
# #control_mode = "depth_map" # Режим работы ControlNet
|
543 |
|
544 |
-
#if control_mode.value == "depth_map":
|
545 |
if control_mode == "depth_map":
|
546 |
|
547 |
print('control_mode = ', control_mode)
|
|
|
122 |
):
|
123 |
|
124 |
|
|
|
|
|
|
|
|
|
|
|
125 |
# Генерация изображений с Ip_Adapter ------------------------------------------------------------------------------------------------------------------
|
126 |
if use_ip_adapter: #and ip_source_image is not None and ip_adapter_image is not None:
|
127 |
|
|
|
146 |
|
147 |
# #ip_adapter_mode = "pose_estimation" # Режим работы Ip_Adapter
|
148 |
|
|
|
149 |
if ip_adapter_mode == "pose_estimation":
|
150 |
|
151 |
print('ip_adapter_mode = ', ip_adapter_mode)
|
|
|
192 |
# Объединяем LoRA с основной моделью
|
193 |
pipe_ip_adapter.fuse_lora(lora_scale=lora_scale)
|
194 |
pipe_ip_adapter.lora_loaded = True # Помечаем, что LoRA загружена
|
195 |
+
|
196 |
+
# Убедимся, что ip_adapter_strength имеет тип float
|
197 |
ip_adapter_strength = float(ip_adapter_strength)
|
198 |
|
199 |
# Используем IP-Adapter с LoRA
|
|
|
235 |
|
236 |
# #ip_adapter_mode = "edge_detection" # Режим работы Ip_Adapter
|
237 |
|
|
|
238 |
if ip_adapter_mode == "edge_detection":
|
239 |
|
240 |
print('ip_adapter_mode = ', ip_adapter_mode)
|
|
|
341 |
|
342 |
# #ip_adapter_mode = "depth_map" # Режим работы Ip_Adapter
|
343 |
|
|
|
344 |
if ip_adapter_mode == "depth_map":
|
345 |
|
346 |
print('ip_adapter_mode = ', ip_adapter_mode)
|
|
|
395 |
|
396 |
# #control_mode = "pose_estimation" # Режим работы ControlNet
|
397 |
|
|
|
398 |
if control_mode == "pose_estimation":
|
399 |
|
400 |
print('control_mode = ', control_mode)
|
|
|
480 |
|
481 |
# #control_mode = "edge_detection" # Режим работы ControlNet
|
482 |
|
|
|
483 |
if control_mode == "edge_detection":
|
484 |
|
485 |
print('control_mode = ', control_mode)
|
|
|
531 |
|
532 |
# #control_mode = "depth_map" # Режим работы ControlNet
|
533 |
|
|
|
534 |
if control_mode == "depth_map":
|
535 |
|
536 |
print('control_mode = ', control_mode)
|