update to v6 modal pipeline

This commit is contained in:
Yudi Xiao 2025-03-03 10:50:23 +08:00
parent 05ff0a42d5
commit 5a5c2038bb
1 changed files with 7 additions and 8 deletions

View File

@ -83,8 +83,9 @@ output_dir = "/root/comfy/ComfyUI/output"
concurrency_limit=50,
container_idle_timeout=120,
# 5 minute container keep alive after it processes an input; increasing this value is a great way to reduce ComfyUI cold start times
timeout=800,
gpu="T4",
timeout=600,
gpu="L4",
memory=(32768, 32768),
secrets=[secret],
volumes={
"/root/comfy/ComfyUI/models": vol,
@ -125,7 +126,7 @@ class ComfyUI:
node["inputs"]["default_value"] = node["inputs"]["default_value"].replace("input_s3", "input")
with open(f"/root/{session_id}.json", "w", encoding="utf-8") as f:
f.write(json.dumps(workflow, ensure_ascii=False))
cmd = f"comfy run --workflow /root/{session_id}.json --wait --timeout 1200"
cmd = f"comfy run --workflow /root/{session_id}.json --wait --timeout 600 --verbose"
# TODO 接收返回值
subprocess.run(cmd, shell=True, check=True)
@ -157,9 +158,7 @@ class ComfyUI:
# run inference on the currently running container
fname = self.infer.local(new_workflow_file)
j = {
"file_name": fname
}
j = {"file_name": fname}
print("json", j)
return Response(content=json.dumps(j), media_type="application/json")