Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -84,7 +84,7 @@ def check_server_ready(port):
|
|
84 |
|
85 |
|
86 |
|
87 |
-
@spaces.GPU(duration=
|
88 |
def generate_image(prompt, image):
|
89 |
prefix_filename = str(random.randint(0, 999999))
|
90 |
prompt = prompt.replace('ComfyUI', prefix_filename)
|
@@ -102,7 +102,7 @@ def generate_image(prompt, image):
|
|
102 |
logger.debug(f'Subprocess started with PID: {process.pid}')
|
103 |
|
104 |
# Ожидание запуска сервера
|
105 |
-
for _ in range(
|
106 |
if check_server_ready(new_port):
|
107 |
break
|
108 |
time.sleep(1)
|
@@ -154,4 +154,4 @@ if __name__ == "__main__":
|
|
154 |
demo.launch(debug=True)
|
155 |
logger.debug('demo.launch()')
|
156 |
|
157 |
-
logger.info("
|
|
|
84 |
|
85 |
|
86 |
|
87 |
+
@spaces.GPU(duration=170)
|
88 |
def generate_image(prompt, image):
|
89 |
prefix_filename = str(random.randint(0, 999999))
|
90 |
prompt = prompt.replace('ComfyUI', prefix_filename)
|
|
|
102 |
logger.debug(f'Subprocess started with PID: {process.pid}')
|
103 |
|
104 |
# Ожидание запуска сервера
|
105 |
+
for _ in range(40): # Максимум 20 секунд ожидания
|
106 |
if check_server_ready(new_port):
|
107 |
break
|
108 |
time.sleep(1)
|
|
|
154 |
demo.launch(debug=True)
|
155 |
logger.debug('demo.launch()')
|
156 |
|
157 |
+
logger.info("Exit")
|