ADD 增加waas专用comfyui服务器

This commit is contained in:
kyj@bowong.ai 2025-08-01 11:42:58 +08:00
parent 3c76c6d918
commit 2448d5c0c0
2 changed files with 129 additions and 2 deletions

View File

@ -16,7 +16,7 @@ image = (
)
.pip_install_from_pyproject(os.path.join(os.path.dirname(__file__), "pyproject.toml"))
.run_commands("comfy node install https://github.com/yolain/ComfyUI-Easy-Use.git")
.run_commands("comfy node install https://github.com/kijai/ComfyUI-WanVideoWrapper.git")
.run_commands("comfy node install https://github.com/kijai/ComfyUI-WanVideoWrapper.git", force_build=True)
.run_commands("comfy node install https://github.com/christian-byrne/audio-separation-nodes-comfyui.git")
.run_commands("comfy node install https://github.com/crystian/ComfyUI-Crystools.git")
.run_commands("comfy node install https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git")
@ -26,10 +26,14 @@ image = (
.run_commands("comfy node install https://github.com/cubiq/ComfyUI_essentials.git")
.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", force_build=True)
.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")
.run_commands("comfy node install https://github.com/chrisgoringe/cg-use-everywhere.git")
.run_commands("comfy node install https://github.com/alt-key-project/comfyui-dream-video-batches")
.run_commands("comfy node install https://github.com/Smirnov75/ComfyUI-mxToolkit")
.run_commands("comfy node install https://github.com/PowerHouseMan/ComfyUI-AdvancedLivePortrait")
.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")

View File

@ -0,0 +1,123 @@
# 文件名 comfyui_v2.py
import os
import subprocess
import modal
image = (
modal.Image.debian_slim(
python_version="3.10"
)
.apt_install("git", "gcc", "libportaudio2", "ffmpeg")
.pip_install("comfy_cli==0.0.0",
index_url="https://packages-1747622887395:0ee15474ccd7b27b57ca63a9306327678e6c2631@g-ldyi2063-pypi.pkg.coding.net/dev/packages/simple")
.run_commands(
"comfy --skip-prompt install --fast-deps --nvidia --version 0.3.40"
)
.pip_install_from_pyproject(os.path.join(os.path.dirname(__file__), "pyproject.toml"))
.run_commands("comfy node install https://github.com/yolain/ComfyUI-Easy-Use.git")
.run_commands("comfy node install https://github.com/crystian/ComfyUI-Crystools.git")
.run_commands("comfy node install https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git")
.run_commands("comfy node install https://github.com/kijai/ComfyUI-KJNodes.git")
.run_commands("comfy node install https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git")
.run_commands("comfy node install https://github.com/WASasquatch/was-node-suite-comfyui.git")
.run_commands("comfy node install https://github.com/cubiq/ComfyUI_essentials.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("rm -rf /root/comfy/ComfyUI/models&&ln -s /models /root/comfy/ComfyUI/models")
.run_commands("rm -rf /root/comfy/ComfyUI/input&&ln -s /waas/input /root/comfy/ComfyUI/input")
.run_commands("rm -rf /root/comfy/ComfyUI/output&&ln -s /waas/output /root/comfy/ComfyUI/output")
)
app = modal.App(image=image)
custom_secret = modal.Secret.from_name("comfyui-custom-secret", environment_name="dev")
vol = modal.Volume.from_name("comfy_model", environment_name="dev", create_if_missing=True)
secret = modal.Secret.from_name("aws-s3-secret", environment_name="dev")
@app.function(
min_containers=0,
buffer_containers=0,
max_containers=1,
scaledown_window=600,
secrets=[secret, custom_secret],
volumes={
"/models": vol,
"/waas": modal.CloudBucketMount(
bucket_name="modal-media-cache",
secret=secret,
key_prefix="waas/comfyui_1/"
),
}
)
@modal.concurrent(
max_inputs=10
)
@modal.web_server(8000, startup_timeout=120)
def ui_1():
subprocess.Popen("comfy launch -- --cpu --listen 0.0.0.0 --port 8000", shell=True)
@app.function(
min_containers=0,
buffer_containers=0,
max_containers=1,
scaledown_window=600,
secrets=[secret, custom_secret],
volumes={
"/models": vol,
"/waas": modal.CloudBucketMount(
bucket_name="modal-media-cache",
secret=secret,
key_prefix="waas/comfyui_2/"
),
}
)
@modal.concurrent(
max_inputs=10
)
@modal.web_server(8000, startup_timeout=120)
def ui_2():
subprocess.Popen("comfy launch -- --cpu --listen 0.0.0.0 --port 8000", shell=True)
@app.function(
min_containers=0,
buffer_containers=0,
max_containers=1,
scaledown_window=600,
secrets=[secret, custom_secret],
volumes={
"/models": vol,
"/waas": modal.CloudBucketMount(
bucket_name="modal-media-cache",
secret=secret,
key_prefix="waas/comfyui_3/"
),
}
)
@modal.concurrent(
max_inputs=10
)
@modal.web_server(8000, startup_timeout=120)
def ui_3():
subprocess.Popen("comfy launch -- --cpu --listen 0.0.0.0 --port 8000", shell=True)
@app.function(
min_containers=0,
buffer_containers=0,
max_containers=1,
scaledown_window=600,
secrets=[secret, custom_secret],
volumes={
"/models": vol,
"/waas": modal.CloudBucketMount(
bucket_name="modal-media-cache",
secret=secret,
key_prefix="waas/comfyui_4/"
),
}
)
@modal.concurrent(
max_inputs=10
)
@modal.web_server(8000, startup_timeout=120)
def ui_4():
subprocess.Popen("comfy launch -- --cpu --listen 0.0.0.0 --port 8000", shell=True)