diff --git a/ext/comfyui_modal_deploy.py b/ext/comfyui_modal_deploy.py index 132c796..dc3408b 100644 --- a/ext/comfyui_modal_deploy.py +++ b/ext/comfyui_modal_deploy.py @@ -27,6 +27,9 @@ image = ( .run_commands("comfy node install https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git") .run_commands("comfy node install https://github.com/jamesWalker55/comfyui-various.git") .run_commands("comfy node install https://gitea.bowongai.com/Polaris/ComfyUI-CustomNode.git") + .run_commands("comfy node install https://github.com/rgthree/rgthree-comfy.git") + .run_commands("comfy node install https://github.com/yuvraj108c/ComfyUI-Dwpose-Tensorrt") + .run_commands("comfy node install https://github.com/kijai/ComfyUI-DepthAnythingV2") .pip_install("sageattention") .run_commands("rm -rf /root/comfy/ComfyUI/models&&ln -s /models /root/comfy/ComfyUI/models") .run_commands("rm -rf /root/comfy/ComfyUI/input&&ln -s /models/input /root/comfy/ComfyUI/input") @@ -58,16 +61,25 @@ vol = modal.Volume.from_name("comfy_model", environment_name="dev", create_if_mi def ui_1(): subprocess.Popen("comfy launch -- --listen 0.0.0.0 --port 8000", shell=True) -# @app.function( -# max_containers=1, -# secrets=[custom_secret] -# ) -# @modal.concurrent( -# max_inputs=10 -# ) -# @modal.web_server(8000, startup_timeout=60) -# def ui_2(): -# subprocess.Popen("comfy launch -- --cpu --listen 0.0.0.0 --port 8000", shell=True) +@app.function( + cpu=(4, 64), + memory=(4096, 131072), + min_containers=0, + buffer_containers=0, + max_containers=1, + gpu="L40S:3", + scaledown_window=600, + secrets=[custom_secret], + volumes={ + "/models": vol + } +) +@modal.concurrent( + max_inputs=20 +) +@modal.web_server(8000, startup_timeout=60) +def ui_2(): + subprocess.Popen("comfy launch -- --listen 0.0.0.0 --port 8000", shell=True) # # @app.function( # max_containers=1, diff --git a/nodes/image_modal_nodes.py b/nodes/image_modal_nodes.py index ade2efb..aa726d0 100644 --- a/nodes/image_modal_nodes.py +++ b/nodes/image_modal_nodes.py @@ -1,6 +1,5 @@ import io import json -import traceback from time import sleep import folder_paths