|
|
|
|
@ -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 сразу."""
|
|
|
|
|
|