Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -68,7 +68,7 @@ def generate_image(prompt, image):
|
|
68 |
# Запускаем скрипт как подпроцесс
|
69 |
process = subprocess.Popen([sys.executable, COMF_PATH, "--listen", "127.0.0.1"])
|
70 |
logger.debug(f'Subprocess started with PID: {process.pid}')
|
71 |
-
|
72 |
try:
|
73 |
# Ожидание запуска сервера
|
74 |
for _ in range(20): # Максимум 20 секунд ожидания
|
@@ -103,8 +103,8 @@ def generate_image(prompt, image):
|
|
103 |
except subprocess.TimeoutExpired:
|
104 |
process.kill()
|
105 |
|
106 |
-
logger.error("No new image was generated")
|
107 |
-
return
|
108 |
|
109 |
|
110 |
if __name__ == "__main__":
|
|
|
68 |
# Запускаем скрипт как подпроцесс
|
69 |
process = subprocess.Popen([sys.executable, COMF_PATH, "--listen", "127.0.0.1"])
|
70 |
logger.debug(f'Subprocess started with PID: {process.pid}')
|
71 |
+
latest_image = None
|
72 |
try:
|
73 |
# Ожидание запуска сервера
|
74 |
for _ in range(20): # Максимум 20 секунд ожидания
|
|
|
103 |
except subprocess.TimeoutExpired:
|
104 |
process.kill()
|
105 |
|
106 |
+
#logger.error("No new image was generated")
|
107 |
+
return latest_image
|
108 |
|
109 |
|
110 |
if __name__ == "__main__":
|