working L4 GPU with 8 core CPU 32G memory

This commit is contained in:
Yudi Xiao 2025-03-03 18:36:53 +08:00
parent 5a5c2038bb
commit 75bffc1310
1 changed files with 5 additions and 4 deletions

View File

@ -83,9 +83,11 @@ output_dir = "/root/comfy/ComfyUI/output"
concurrency_limit=50, concurrency_limit=50,
container_idle_timeout=120, 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 # 5 minute container keep alive after it processes an input; increasing this value is a great way to reduce ComfyUI cold start times
timeout=600, timeout=900,
gpu="L4", gpu="L4",
memory=(32768, 32768), cpu=8,
# memory=(32768, 32768), # (内存预留量, 内存使用上限)
memory=32768,
secrets=[secret], secrets=[secret],
volumes={ volumes={
"/root/comfy/ComfyUI/models": vol, "/root/comfy/ComfyUI/models": vol,
@ -126,8 +128,7 @@ class ComfyUI:
node["inputs"]["default_value"] = node["inputs"]["default_value"].replace("input_s3", "input") 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: with open(f"/root/{session_id}.json", "w", encoding="utf-8") as f:
f.write(json.dumps(workflow, ensure_ascii=False)) f.write(json.dumps(workflow, ensure_ascii=False))
cmd = f"comfy run --workflow /root/{session_id}.json --wait --timeout 600 --verbose" cmd = f"comfy run --workflow /root/{session_id}.json --wait --timeout 900 --verbose"
# TODO 接收返回值
subprocess.run(cmd, shell=True, check=True) subprocess.run(cmd, shell=True, check=True)
# looks up the name of the output image file based on the workflow # looks up the name of the output image file based on the workflow