comfy status monitor

This commit is contained in:
2026-03-08 12:06:02 +03:00
parent c3c1da3ef4
commit c2b43d0c7b
3 changed files with 67 additions and 1 deletions
+30
View File
@@ -462,6 +462,36 @@ def health():
})
@app.route("/comfyui/status", methods=["GET"])
def comfyui_status():
"""Детальная проверка статуса ComfyUI — без авторизации."""
result = {
"comfyui": "unavailable",
"ready": False,
"error": None,
"timestamp": int(time.time())
}
try:
# Проверка HTTP доступности
url = f"http://{COMFY_HOST}:{COMFY_PORT}/"
response = urllib.request.urlopen(url, timeout=5)
# Проверка что ComfyUI отвечает корректно
if response.status == 200:
result["comfyui"] = "ok"
result["ready"] = True
else:
result["error"] = f"HTTP {response.status}"
except urllib.error.URLError as e:
result["error"] = f"Connection failed: {str(e.reason)}"
except Exception as e:
result["error"] = str(e)
return jsonify(result)
@app.route("/run", methods=["POST"])
def run_job():
"""Отправляет задачу в очередь. Возвращает job_id сразу."""