diff --git a/frameworks/ComfyUI/0.18.5/Dockerfile b/frameworks/ComfyUI/0.18.5/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..313adf275016862ad3650eb6c6a525cd07aad184 --- /dev/null +++ b/frameworks/ComfyUI/0.18.5/Dockerfile @@ -0,0 +1,33 @@ + +FROM opencloudos/opencloudos9-cuda-devel:12.8 + +LABEL maintainer="stronking 363133710@qq.com" +LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" +LABEL org.opencontainers.image.description="ComfyUI v0.19.1 (GPU) on OpenCloudOS 9" +ENV NVIDIA_VISIBLE_DEVICES=all +ARG COMFYUI_VERSION=0.18.5 + +ENV NVIDIA_VISIBLE_DEVICES=all \ + PYTHONUNBUFFERED=1 \ + PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PIP_DEFAULT_TIMEOUT=120 + + +WORKDIR /opt + +RUN --mount=type=cache,target=/root/.cache/pip \ + wget -q -O /tmp/requirements.txt \ + https://raw.githubusercontent.com/Comfy-Org/ComfyUI/refs/tags/v${COMFYUI_VERSION}/requirements.txt && \ + python3 -m pip install --upgrade pip setuptools wheel && \ + python3 -m pip install -r /tmp/requirements.txt + +RUN wget -q -O /tmp/comfyui.zip \ + https://github.com/Comfy-Org/ComfyUI/archive/refs/tags/v${COMFYUI_VERSION}.zip && \ + unzip -q /tmp/comfyui.zip -d /opt && \ + mv /opt/ComfyUI-${COMFYUI_VERSION} /opt/ComfyUI && \ + rm -f /tmp/comfyui.zip /tmp/requirements.txt + +WORKDIR /opt/ComfyUI + +EXPOSE 8188 +CMD ["python3","main.py","--listen","0.0.0.0"] \ No newline at end of file diff --git a/frameworks/ComfyUI/0.18.5/README.md b/frameworks/ComfyUI/0.18.5/README.md new file mode 100644 index 0000000000000000000000000000000000000000..90c0cfdb3b1108fef8eb4ebaf0ca39b6e677e36c --- /dev/null +++ b/frameworks/ComfyUI/0.18.5/README.md @@ -0,0 +1,103 @@ +# ComfyUI 0.18.5 on OpenCloudOS 9 + +## 基本信息 +- **框架版本**:v0.18.5 +- **基础镜像**:opencloudos9-cuda-devel:12.8 +- **Python 版本**:3.11 +- **CUDA 版本**: 12.x 或 更高 + +## 构建 + +docker build -t oc9-comfyui:0.18.5 . + +## 镜像启动命令 + +docker run -d --name --gpus all -p 8188:8188 oc9-comfyui:0.18.5 + +## 镜像测试命令 + +docker run --rm --gpus all -p 8188:8188 oc9-comfyui:0.18.5 bash test.sh + +## ComfyUI 版本对于python依赖说明 + +### 关键依赖变化时间线 +| tag / tag 范围 | 相对前一阶段的主要变化 | +| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `v0.0.1`–`v0.0.2` | 最早基线:`torch`/`torchsde`/`torchvision`/`torchaudio`、`einops`、`transformers>=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | +| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | +| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | +| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | +| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | +| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | +| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | +| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | +| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | +| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | +| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | +| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | +| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | +| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | +| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | +| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | +| `v0.11.0` | 新增 `requests`。([GitHub][11]) | +| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | +| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | +| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | +| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | +| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | +| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | +| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | +| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | +| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | + +[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" +[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" +[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" +[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" +[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" +[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" +[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" +[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" +[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" +[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" +[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" +[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" +[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" +[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" +[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" +[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" +[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" +[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" +[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" + + + + + +### v0.19.x 逐 tag 差异 + +| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | +| ------------------- | -------------------------: | ---------------------------: | ------------- | +| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | +| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | +| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | +| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | +| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | + + + + +## 启动代码会自动设置的环境变量 + +| 环境变量 | 什么时候设置 | 作用/说明 | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | +| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | +| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | +| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | +| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | +| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | +| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | +| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | +| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | +| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.18.5/build.conf b/frameworks/ComfyUI/0.18.5/build.conf new file mode 100644 index 0000000000000000000000000000000000000000..bd19c9a96572eeafa6efbcfea6a40222fede883e --- /dev/null +++ b/frameworks/ComfyUI/0.18.5/build.conf @@ -0,0 +1,4 @@ +# ConfyUI 0.18.5 on OpenCloudOS 9 (GPU) +IMAGE_NAME=oc9-comfyui +IMAGE_TAG=0.18.5 +GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.18.5/test.sh b/frameworks/ComfyUI/0.18.5/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..858dba6aa6628d61061ef1231a7117962a1dc5e2 --- /dev/null +++ b/frameworks/ComfyUI/0.18.5/test.sh @@ -0,0 +1,252 @@ +#!/bin/bash + +set -e + +IMAGE="${1:-}" + +if [ -z "${IMAGE}" ]; then + echo "用法: bash test.sh <镜像名:标签>" + exit 1 +fi + +if ! command -v docker >/dev/null 2>&1; then + echo "✗ 未找到 docker" + exit 1 +fi + +echo "=== ComfyUI 容器基础功能测试 ===" +echo "测试镜像: ${IMAGE}" + +docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' +set -e +export CUDA_HOME=/usr/local/cuda +export PATH=/usr/local/cuda/bin:$PATH +export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH +echo "=== ComfyUI GPU 镜像基础功能测试 ===" + +COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" +COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" +COMFYUI_PORT="${COMFYUI_PORT:-18188}" +STRICT_GPU="${STRICT_GPU:-1}" +LOG_FILE="/tmp/comfyui_test.log" + +pass() { + echo "✓ 通过" +} + +fail() { + echo "✗ 失败" + if [ -f "$LOG_FILE" ]; then + echo "------ ComfyUI 日志 ------" + tail -n 120 "$LOG_FILE" || true + echo "-------------------------" + fi + exit 1 +} + +echo +echo "=== 1. 检查 ComfyUI 目录 ===" +echo -n "检查目录 ${COMFYUI_DIR}... " +if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then + pass +else + fail +fi + +cd "$COMFYUI_DIR" + +echo +echo "=== 2. 检查 CUDA 基础环境 ===" + +echo -n "检查 nvidia-smi... " +if command -v nvidia-smi >/dev/null 2>&1; then + nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvidia-smi" + fail + else + echo "跳过,未找到 nvidia-smi" + fi +fi + +echo -n "检查 nvcc --version... " +if command -v nvcc >/dev/null 2>&1; then + nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvcc" + fail + else + echo "跳过,未找到 nvcc" + fi +fi + +echo +echo "=== 3. 检查 Python / PyTorch / CUDA ===" + +echo -n "检查 Python 版本... " +python3 --version && pass || fail + +echo -n "检查 torch import 和 CUDA 可用性... " +python3 - <<'PY' +import sys +import torch + +print("torch version:", torch.__version__) +print("torch cuda version:", torch.version.cuda) +print("torch cuda available:", torch.cuda.is_available()) + +if not torch.cuda.is_available(): + raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") + +count = torch.cuda.device_count() +print("cuda device count:", count) + +if count < 1: + raise RuntimeError("未检测到 CUDA 设备") + +for i in range(count): + print(f"cuda device {i}:", torch.cuda.get_device_name(i)) + +x = torch.ones((2, 2), device="cuda") +y = x @ x +assert y.is_cuda +assert y.shape == (2, 2) + +print("torch CUDA tensor test ok") +PY +pass + +echo +echo "=== 4. 检查 ComfyUI 核心模块 import ===" + +echo -n "检查 ComfyUI Python 模块... " +python3 - <<'PY' +import os +import sys + +sys.path.insert(0, os.getcwd()) + +import comfy +import folder_paths +import nodes + +print("comfy import ok") +print("folder_paths import ok") +print("nodes import ok") +print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) + +if len(nodes.NODE_CLASS_MAPPINGS) <= 0: + raise RuntimeError("ComfyUI 节点注册数量异常") +PY +pass + +echo +echo "=== 5. 启动 ComfyUI API 服务 ===" + +rm -f "$LOG_FILE" + +echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " +python3 main.py \ + --listen "$COMFYUI_HOST" \ + --port "$COMFYUI_PORT" \ + >"$LOG_FILE" 2>&1 & + +COMFYUI_PID=$! + +cleanup() { + if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + kill "$COMFYUI_PID" >/dev/null 2>&1 || true + wait "$COMFYUI_PID" >/dev/null 2>&1 || true + fi +} +trap cleanup EXIT + +sleep 3 + +if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + pass +else + fail +fi + +echo -n "等待 ComfyUI API 就绪... " +python3 - <=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | +| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | +| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | +| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | +| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | +| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | +| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | +| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | +| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | +| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | +| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | +| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | +| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | +| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | +| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | +| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | +| `v0.11.0` | 新增 `requests`。([GitHub][11]) | +| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | +| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | +| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | +| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | +| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | +| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | +| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | +| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | +| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | + +[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" +[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" +[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" +[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" +[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" +[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" +[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" +[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" +[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" +[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" +[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" +[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" +[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" +[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" +[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" +[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" +[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" +[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" +[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" + + + + + +### v0.19.x 逐 tag 差异 + +| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | +| ------------------- | -------------------------: | ---------------------------: | ------------- | +| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | +| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | +| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | +| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | +| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | + + + + +## 启动代码会自动设置的环境变量 + +| 环境变量 | 什么时候设置 | 作用/说明 | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | +| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | +| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | +| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | +| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | +| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | +| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | +| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | +| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | +| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.19.0/build.conf b/frameworks/ComfyUI/0.19.0/build.conf new file mode 100644 index 0000000000000000000000000000000000000000..5a5c534e298be4b59f928da10c9f6e1573634d4c --- /dev/null +++ b/frameworks/ComfyUI/0.19.0/build.conf @@ -0,0 +1,4 @@ +# ConfyUI 0.19.0 on OpenCloudOS 9 (GPU) +IMAGE_NAME=oc9-comfyui +IMAGE_TAG=0.19.0 +GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.19.0/test.sh b/frameworks/ComfyUI/0.19.0/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..858dba6aa6628d61061ef1231a7117962a1dc5e2 --- /dev/null +++ b/frameworks/ComfyUI/0.19.0/test.sh @@ -0,0 +1,252 @@ +#!/bin/bash + +set -e + +IMAGE="${1:-}" + +if [ -z "${IMAGE}" ]; then + echo "用法: bash test.sh <镜像名:标签>" + exit 1 +fi + +if ! command -v docker >/dev/null 2>&1; then + echo "✗ 未找到 docker" + exit 1 +fi + +echo "=== ComfyUI 容器基础功能测试 ===" +echo "测试镜像: ${IMAGE}" + +docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' +set -e +export CUDA_HOME=/usr/local/cuda +export PATH=/usr/local/cuda/bin:$PATH +export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH +echo "=== ComfyUI GPU 镜像基础功能测试 ===" + +COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" +COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" +COMFYUI_PORT="${COMFYUI_PORT:-18188}" +STRICT_GPU="${STRICT_GPU:-1}" +LOG_FILE="/tmp/comfyui_test.log" + +pass() { + echo "✓ 通过" +} + +fail() { + echo "✗ 失败" + if [ -f "$LOG_FILE" ]; then + echo "------ ComfyUI 日志 ------" + tail -n 120 "$LOG_FILE" || true + echo "-------------------------" + fi + exit 1 +} + +echo +echo "=== 1. 检查 ComfyUI 目录 ===" +echo -n "检查目录 ${COMFYUI_DIR}... " +if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then + pass +else + fail +fi + +cd "$COMFYUI_DIR" + +echo +echo "=== 2. 检查 CUDA 基础环境 ===" + +echo -n "检查 nvidia-smi... " +if command -v nvidia-smi >/dev/null 2>&1; then + nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvidia-smi" + fail + else + echo "跳过,未找到 nvidia-smi" + fi +fi + +echo -n "检查 nvcc --version... " +if command -v nvcc >/dev/null 2>&1; then + nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvcc" + fail + else + echo "跳过,未找到 nvcc" + fi +fi + +echo +echo "=== 3. 检查 Python / PyTorch / CUDA ===" + +echo -n "检查 Python 版本... " +python3 --version && pass || fail + +echo -n "检查 torch import 和 CUDA 可用性... " +python3 - <<'PY' +import sys +import torch + +print("torch version:", torch.__version__) +print("torch cuda version:", torch.version.cuda) +print("torch cuda available:", torch.cuda.is_available()) + +if not torch.cuda.is_available(): + raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") + +count = torch.cuda.device_count() +print("cuda device count:", count) + +if count < 1: + raise RuntimeError("未检测到 CUDA 设备") + +for i in range(count): + print(f"cuda device {i}:", torch.cuda.get_device_name(i)) + +x = torch.ones((2, 2), device="cuda") +y = x @ x +assert y.is_cuda +assert y.shape == (2, 2) + +print("torch CUDA tensor test ok") +PY +pass + +echo +echo "=== 4. 检查 ComfyUI 核心模块 import ===" + +echo -n "检查 ComfyUI Python 模块... " +python3 - <<'PY' +import os +import sys + +sys.path.insert(0, os.getcwd()) + +import comfy +import folder_paths +import nodes + +print("comfy import ok") +print("folder_paths import ok") +print("nodes import ok") +print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) + +if len(nodes.NODE_CLASS_MAPPINGS) <= 0: + raise RuntimeError("ComfyUI 节点注册数量异常") +PY +pass + +echo +echo "=== 5. 启动 ComfyUI API 服务 ===" + +rm -f "$LOG_FILE" + +echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " +python3 main.py \ + --listen "$COMFYUI_HOST" \ + --port "$COMFYUI_PORT" \ + >"$LOG_FILE" 2>&1 & + +COMFYUI_PID=$! + +cleanup() { + if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + kill "$COMFYUI_PID" >/dev/null 2>&1 || true + wait "$COMFYUI_PID" >/dev/null 2>&1 || true + fi +} +trap cleanup EXIT + +sleep 3 + +if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + pass +else + fail +fi + +echo -n "等待 ComfyUI API 就绪... " +python3 - <=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | +| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | +| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | +| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | +| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | +| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | +| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | +| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | +| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | +| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | +| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | +| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | +| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | +| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | +| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | +| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | +| `v0.11.0` | 新增 `requests`。([GitHub][11]) | +| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | +| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | +| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | +| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | +| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | +| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | +| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | +| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | +| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | + +[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" +[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" +[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" +[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" +[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" +[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" +[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" +[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" +[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" +[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" +[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" +[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" +[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" +[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" +[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" +[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" +[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" +[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" +[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" + + + + + +### v0.19.x 逐 tag 差异 + +| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | +| ------------------- | -------------------------: | ---------------------------: | ------------- | +| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | +| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | +| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | +| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | +| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | + + + + +## 启动代码会自动设置的环境变量 + +| 环境变量 | 什么时候设置 | 作用/说明 | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | +| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | +| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | +| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | +| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | +| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | +| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | +| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | +| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | +| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.19.1/build.conf b/frameworks/ComfyUI/0.19.1/build.conf new file mode 100644 index 0000000000000000000000000000000000000000..64d70867c87c71717d2aef083b935305bcc37e3f --- /dev/null +++ b/frameworks/ComfyUI/0.19.1/build.conf @@ -0,0 +1,4 @@ +# ConfyUI 0.19.1 on OpenCloudOS 9 (GPU) +IMAGE_NAME=oc9-comfyui +IMAGE_TAG=0.19.1 +GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.19.1/test.sh b/frameworks/ComfyUI/0.19.1/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..858dba6aa6628d61061ef1231a7117962a1dc5e2 --- /dev/null +++ b/frameworks/ComfyUI/0.19.1/test.sh @@ -0,0 +1,252 @@ +#!/bin/bash + +set -e + +IMAGE="${1:-}" + +if [ -z "${IMAGE}" ]; then + echo "用法: bash test.sh <镜像名:标签>" + exit 1 +fi + +if ! command -v docker >/dev/null 2>&1; then + echo "✗ 未找到 docker" + exit 1 +fi + +echo "=== ComfyUI 容器基础功能测试 ===" +echo "测试镜像: ${IMAGE}" + +docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' +set -e +export CUDA_HOME=/usr/local/cuda +export PATH=/usr/local/cuda/bin:$PATH +export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH +echo "=== ComfyUI GPU 镜像基础功能测试 ===" + +COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" +COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" +COMFYUI_PORT="${COMFYUI_PORT:-18188}" +STRICT_GPU="${STRICT_GPU:-1}" +LOG_FILE="/tmp/comfyui_test.log" + +pass() { + echo "✓ 通过" +} + +fail() { + echo "✗ 失败" + if [ -f "$LOG_FILE" ]; then + echo "------ ComfyUI 日志 ------" + tail -n 120 "$LOG_FILE" || true + echo "-------------------------" + fi + exit 1 +} + +echo +echo "=== 1. 检查 ComfyUI 目录 ===" +echo -n "检查目录 ${COMFYUI_DIR}... " +if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then + pass +else + fail +fi + +cd "$COMFYUI_DIR" + +echo +echo "=== 2. 检查 CUDA 基础环境 ===" + +echo -n "检查 nvidia-smi... " +if command -v nvidia-smi >/dev/null 2>&1; then + nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvidia-smi" + fail + else + echo "跳过,未找到 nvidia-smi" + fi +fi + +echo -n "检查 nvcc --version... " +if command -v nvcc >/dev/null 2>&1; then + nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvcc" + fail + else + echo "跳过,未找到 nvcc" + fi +fi + +echo +echo "=== 3. 检查 Python / PyTorch / CUDA ===" + +echo -n "检查 Python 版本... " +python3 --version && pass || fail + +echo -n "检查 torch import 和 CUDA 可用性... " +python3 - <<'PY' +import sys +import torch + +print("torch version:", torch.__version__) +print("torch cuda version:", torch.version.cuda) +print("torch cuda available:", torch.cuda.is_available()) + +if not torch.cuda.is_available(): + raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") + +count = torch.cuda.device_count() +print("cuda device count:", count) + +if count < 1: + raise RuntimeError("未检测到 CUDA 设备") + +for i in range(count): + print(f"cuda device {i}:", torch.cuda.get_device_name(i)) + +x = torch.ones((2, 2), device="cuda") +y = x @ x +assert y.is_cuda +assert y.shape == (2, 2) + +print("torch CUDA tensor test ok") +PY +pass + +echo +echo "=== 4. 检查 ComfyUI 核心模块 import ===" + +echo -n "检查 ComfyUI Python 模块... " +python3 - <<'PY' +import os +import sys + +sys.path.insert(0, os.getcwd()) + +import comfy +import folder_paths +import nodes + +print("comfy import ok") +print("folder_paths import ok") +print("nodes import ok") +print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) + +if len(nodes.NODE_CLASS_MAPPINGS) <= 0: + raise RuntimeError("ComfyUI 节点注册数量异常") +PY +pass + +echo +echo "=== 5. 启动 ComfyUI API 服务 ===" + +rm -f "$LOG_FILE" + +echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " +python3 main.py \ + --listen "$COMFYUI_HOST" \ + --port "$COMFYUI_PORT" \ + >"$LOG_FILE" 2>&1 & + +COMFYUI_PID=$! + +cleanup() { + if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + kill "$COMFYUI_PID" >/dev/null 2>&1 || true + wait "$COMFYUI_PID" >/dev/null 2>&1 || true + fi +} +trap cleanup EXIT + +sleep 3 + +if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + pass +else + fail +fi + +echo -n "等待 ComfyUI API 就绪... " +python3 - <=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | +| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | +| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | +| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | +| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | +| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | +| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | +| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | +| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | +| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | +| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | +| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | +| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | +| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | +| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | +| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | +| `v0.11.0` | 新增 `requests`。([GitHub][11]) | +| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | +| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | +| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | +| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | +| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | +| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | +| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | +| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | +| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | + +[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" +[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" +[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" +[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" +[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" +[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" +[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" +[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" +[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" +[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" +[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" +[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" +[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" +[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" +[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" +[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" +[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" +[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" +[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" + + + + + +### v0.19.x 逐 tag 差异 + +| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | +| ------------------- | -------------------------: | ---------------------------: | ------------- | +| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | +| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | +| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | +| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | +| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | + + + + +## 启动代码会自动设置的环境变量 + +| 环境变量 | 什么时候设置 | 作用/说明 | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | +| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | +| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | +| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | +| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | +| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | +| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | +| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | +| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | +| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.19.2/build.conf b/frameworks/ComfyUI/0.19.2/build.conf new file mode 100644 index 0000000000000000000000000000000000000000..76a24a0c3049ef29174334aee7cb4a96d46ad878 --- /dev/null +++ b/frameworks/ComfyUI/0.19.2/build.conf @@ -0,0 +1,4 @@ +# ConfyUI 0.19.2 on OpenCloudOS 9 (GPU) +IMAGE_NAME=oc9-comfyui +IMAGE_TAG=0.19.2 +GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.19.2/test.sh b/frameworks/ComfyUI/0.19.2/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..858dba6aa6628d61061ef1231a7117962a1dc5e2 --- /dev/null +++ b/frameworks/ComfyUI/0.19.2/test.sh @@ -0,0 +1,252 @@ +#!/bin/bash + +set -e + +IMAGE="${1:-}" + +if [ -z "${IMAGE}" ]; then + echo "用法: bash test.sh <镜像名:标签>" + exit 1 +fi + +if ! command -v docker >/dev/null 2>&1; then + echo "✗ 未找到 docker" + exit 1 +fi + +echo "=== ComfyUI 容器基础功能测试 ===" +echo "测试镜像: ${IMAGE}" + +docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' +set -e +export CUDA_HOME=/usr/local/cuda +export PATH=/usr/local/cuda/bin:$PATH +export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH +echo "=== ComfyUI GPU 镜像基础功能测试 ===" + +COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" +COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" +COMFYUI_PORT="${COMFYUI_PORT:-18188}" +STRICT_GPU="${STRICT_GPU:-1}" +LOG_FILE="/tmp/comfyui_test.log" + +pass() { + echo "✓ 通过" +} + +fail() { + echo "✗ 失败" + if [ -f "$LOG_FILE" ]; then + echo "------ ComfyUI 日志 ------" + tail -n 120 "$LOG_FILE" || true + echo "-------------------------" + fi + exit 1 +} + +echo +echo "=== 1. 检查 ComfyUI 目录 ===" +echo -n "检查目录 ${COMFYUI_DIR}... " +if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then + pass +else + fail +fi + +cd "$COMFYUI_DIR" + +echo +echo "=== 2. 检查 CUDA 基础环境 ===" + +echo -n "检查 nvidia-smi... " +if command -v nvidia-smi >/dev/null 2>&1; then + nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvidia-smi" + fail + else + echo "跳过,未找到 nvidia-smi" + fi +fi + +echo -n "检查 nvcc --version... " +if command -v nvcc >/dev/null 2>&1; then + nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvcc" + fail + else + echo "跳过,未找到 nvcc" + fi +fi + +echo +echo "=== 3. 检查 Python / PyTorch / CUDA ===" + +echo -n "检查 Python 版本... " +python3 --version && pass || fail + +echo -n "检查 torch import 和 CUDA 可用性... " +python3 - <<'PY' +import sys +import torch + +print("torch version:", torch.__version__) +print("torch cuda version:", torch.version.cuda) +print("torch cuda available:", torch.cuda.is_available()) + +if not torch.cuda.is_available(): + raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") + +count = torch.cuda.device_count() +print("cuda device count:", count) + +if count < 1: + raise RuntimeError("未检测到 CUDA 设备") + +for i in range(count): + print(f"cuda device {i}:", torch.cuda.get_device_name(i)) + +x = torch.ones((2, 2), device="cuda") +y = x @ x +assert y.is_cuda +assert y.shape == (2, 2) + +print("torch CUDA tensor test ok") +PY +pass + +echo +echo "=== 4. 检查 ComfyUI 核心模块 import ===" + +echo -n "检查 ComfyUI Python 模块... " +python3 - <<'PY' +import os +import sys + +sys.path.insert(0, os.getcwd()) + +import comfy +import folder_paths +import nodes + +print("comfy import ok") +print("folder_paths import ok") +print("nodes import ok") +print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) + +if len(nodes.NODE_CLASS_MAPPINGS) <= 0: + raise RuntimeError("ComfyUI 节点注册数量异常") +PY +pass + +echo +echo "=== 5. 启动 ComfyUI API 服务 ===" + +rm -f "$LOG_FILE" + +echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " +python3 main.py \ + --listen "$COMFYUI_HOST" \ + --port "$COMFYUI_PORT" \ + >"$LOG_FILE" 2>&1 & + +COMFYUI_PID=$! + +cleanup() { + if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + kill "$COMFYUI_PID" >/dev/null 2>&1 || true + wait "$COMFYUI_PID" >/dev/null 2>&1 || true + fi +} +trap cleanup EXIT + +sleep 3 + +if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + pass +else + fail +fi + +echo -n "等待 ComfyUI API 就绪... " +python3 - <=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | +| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | +| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | +| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | +| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | +| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | +| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | +| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | +| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | +| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | +| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | +| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | +| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | +| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | +| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | +| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | +| `v0.11.0` | 新增 `requests`。([GitHub][11]) | +| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | +| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | +| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | +| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | +| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | +| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | +| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | +| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | +| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | + +[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" +[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" +[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" +[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" +[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" +[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" +[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" +[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" +[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" +[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" +[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" +[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" +[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" +[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" +[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" +[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" +[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" +[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" +[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" + + + + + +### v0.19.x 逐 tag 差异 + +| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | +| ------------------- | -------------------------: | ---------------------------: | ------------- | +| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | +| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | +| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | +| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | +| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | + + + + +## 启动代码会自动设置的环境变量 + +| 环境变量 | 什么时候设置 | 作用/说明 | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | +| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | +| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | +| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | +| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | +| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | +| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | +| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | +| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | +| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.19.3/build.conf b/frameworks/ComfyUI/0.19.3/build.conf new file mode 100644 index 0000000000000000000000000000000000000000..e22eee33376452951ed6962dfa916ed12690b53d --- /dev/null +++ b/frameworks/ComfyUI/0.19.3/build.conf @@ -0,0 +1,4 @@ +# ConfyUI 0.19.3 on OpenCloudOS 9 (GPU) +IMAGE_NAME=oc9-comfyui +IMAGE_TAG=0.19.3 +GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.19.3/test.sh b/frameworks/ComfyUI/0.19.3/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..858dba6aa6628d61061ef1231a7117962a1dc5e2 --- /dev/null +++ b/frameworks/ComfyUI/0.19.3/test.sh @@ -0,0 +1,252 @@ +#!/bin/bash + +set -e + +IMAGE="${1:-}" + +if [ -z "${IMAGE}" ]; then + echo "用法: bash test.sh <镜像名:标签>" + exit 1 +fi + +if ! command -v docker >/dev/null 2>&1; then + echo "✗ 未找到 docker" + exit 1 +fi + +echo "=== ComfyUI 容器基础功能测试 ===" +echo "测试镜像: ${IMAGE}" + +docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' +set -e +export CUDA_HOME=/usr/local/cuda +export PATH=/usr/local/cuda/bin:$PATH +export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH +echo "=== ComfyUI GPU 镜像基础功能测试 ===" + +COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" +COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" +COMFYUI_PORT="${COMFYUI_PORT:-18188}" +STRICT_GPU="${STRICT_GPU:-1}" +LOG_FILE="/tmp/comfyui_test.log" + +pass() { + echo "✓ 通过" +} + +fail() { + echo "✗ 失败" + if [ -f "$LOG_FILE" ]; then + echo "------ ComfyUI 日志 ------" + tail -n 120 "$LOG_FILE" || true + echo "-------------------------" + fi + exit 1 +} + +echo +echo "=== 1. 检查 ComfyUI 目录 ===" +echo -n "检查目录 ${COMFYUI_DIR}... " +if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then + pass +else + fail +fi + +cd "$COMFYUI_DIR" + +echo +echo "=== 2. 检查 CUDA 基础环境 ===" + +echo -n "检查 nvidia-smi... " +if command -v nvidia-smi >/dev/null 2>&1; then + nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvidia-smi" + fail + else + echo "跳过,未找到 nvidia-smi" + fi +fi + +echo -n "检查 nvcc --version... " +if command -v nvcc >/dev/null 2>&1; then + nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvcc" + fail + else + echo "跳过,未找到 nvcc" + fi +fi + +echo +echo "=== 3. 检查 Python / PyTorch / CUDA ===" + +echo -n "检查 Python 版本... " +python3 --version && pass || fail + +echo -n "检查 torch import 和 CUDA 可用性... " +python3 - <<'PY' +import sys +import torch + +print("torch version:", torch.__version__) +print("torch cuda version:", torch.version.cuda) +print("torch cuda available:", torch.cuda.is_available()) + +if not torch.cuda.is_available(): + raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") + +count = torch.cuda.device_count() +print("cuda device count:", count) + +if count < 1: + raise RuntimeError("未检测到 CUDA 设备") + +for i in range(count): + print(f"cuda device {i}:", torch.cuda.get_device_name(i)) + +x = torch.ones((2, 2), device="cuda") +y = x @ x +assert y.is_cuda +assert y.shape == (2, 2) + +print("torch CUDA tensor test ok") +PY +pass + +echo +echo "=== 4. 检查 ComfyUI 核心模块 import ===" + +echo -n "检查 ComfyUI Python 模块... " +python3 - <<'PY' +import os +import sys + +sys.path.insert(0, os.getcwd()) + +import comfy +import folder_paths +import nodes + +print("comfy import ok") +print("folder_paths import ok") +print("nodes import ok") +print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) + +if len(nodes.NODE_CLASS_MAPPINGS) <= 0: + raise RuntimeError("ComfyUI 节点注册数量异常") +PY +pass + +echo +echo "=== 5. 启动 ComfyUI API 服务 ===" + +rm -f "$LOG_FILE" + +echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " +python3 main.py \ + --listen "$COMFYUI_HOST" \ + --port "$COMFYUI_PORT" \ + >"$LOG_FILE" 2>&1 & + +COMFYUI_PID=$! + +cleanup() { + if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + kill "$COMFYUI_PID" >/dev/null 2>&1 || true + wait "$COMFYUI_PID" >/dev/null 2>&1 || true + fi +} +trap cleanup EXIT + +sleep 3 + +if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + pass +else + fail +fi + +echo -n "等待 ComfyUI API 就绪... " +python3 - <=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | +| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | +| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | +| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | +| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | +| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | +| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | +| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | +| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | +| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | +| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | +| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | +| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | +| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | +| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | +| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | +| `v0.11.0` | 新增 `requests`。([GitHub][11]) | +| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | +| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | +| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | +| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | +| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | +| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | +| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | +| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | +| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | + +[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" +[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" +[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" +[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" +[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" +[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" +[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" +[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" +[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" +[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" +[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" +[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" +[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" +[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" +[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" +[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" +[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" +[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" +[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" + + + + + +### v0.19.x 逐 tag 差异 + +| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | +| ------------------- | -------------------------: | ---------------------------: | ------------- | +| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | +| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | +| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | +| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | +| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | + + + + +## 启动代码会自动设置的环境变量 + +| 环境变量 | 什么时候设置 | 作用/说明 | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | +| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | +| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | +| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | +| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | +| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | +| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | +| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | +| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | +| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.19.4/build.conf b/frameworks/ComfyUI/0.19.4/build.conf new file mode 100644 index 0000000000000000000000000000000000000000..82b7153838d09c5b04f1aa1627f90944a5b92909 --- /dev/null +++ b/frameworks/ComfyUI/0.19.4/build.conf @@ -0,0 +1,4 @@ +# ConfyUI 0.19.4 on OpenCloudOS 9 (GPU) +IMAGE_NAME=oc9-comfyui +IMAGE_TAG=0.19.4 +GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.19.4/test.sh b/frameworks/ComfyUI/0.19.4/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..858dba6aa6628d61061ef1231a7117962a1dc5e2 --- /dev/null +++ b/frameworks/ComfyUI/0.19.4/test.sh @@ -0,0 +1,252 @@ +#!/bin/bash + +set -e + +IMAGE="${1:-}" + +if [ -z "${IMAGE}" ]; then + echo "用法: bash test.sh <镜像名:标签>" + exit 1 +fi + +if ! command -v docker >/dev/null 2>&1; then + echo "✗ 未找到 docker" + exit 1 +fi + +echo "=== ComfyUI 容器基础功能测试 ===" +echo "测试镜像: ${IMAGE}" + +docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' +set -e +export CUDA_HOME=/usr/local/cuda +export PATH=/usr/local/cuda/bin:$PATH +export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH +echo "=== ComfyUI GPU 镜像基础功能测试 ===" + +COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" +COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" +COMFYUI_PORT="${COMFYUI_PORT:-18188}" +STRICT_GPU="${STRICT_GPU:-1}" +LOG_FILE="/tmp/comfyui_test.log" + +pass() { + echo "✓ 通过" +} + +fail() { + echo "✗ 失败" + if [ -f "$LOG_FILE" ]; then + echo "------ ComfyUI 日志 ------" + tail -n 120 "$LOG_FILE" || true + echo "-------------------------" + fi + exit 1 +} + +echo +echo "=== 1. 检查 ComfyUI 目录 ===" +echo -n "检查目录 ${COMFYUI_DIR}... " +if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then + pass +else + fail +fi + +cd "$COMFYUI_DIR" + +echo +echo "=== 2. 检查 CUDA 基础环境 ===" + +echo -n "检查 nvidia-smi... " +if command -v nvidia-smi >/dev/null 2>&1; then + nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvidia-smi" + fail + else + echo "跳过,未找到 nvidia-smi" + fi +fi + +echo -n "检查 nvcc --version... " +if command -v nvcc >/dev/null 2>&1; then + nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail +else + if [ "$STRICT_GPU" = "1" ]; then + echo "未找到 nvcc" + fail + else + echo "跳过,未找到 nvcc" + fi +fi + +echo +echo "=== 3. 检查 Python / PyTorch / CUDA ===" + +echo -n "检查 Python 版本... " +python3 --version && pass || fail + +echo -n "检查 torch import 和 CUDA 可用性... " +python3 - <<'PY' +import sys +import torch + +print("torch version:", torch.__version__) +print("torch cuda version:", torch.version.cuda) +print("torch cuda available:", torch.cuda.is_available()) + +if not torch.cuda.is_available(): + raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") + +count = torch.cuda.device_count() +print("cuda device count:", count) + +if count < 1: + raise RuntimeError("未检测到 CUDA 设备") + +for i in range(count): + print(f"cuda device {i}:", torch.cuda.get_device_name(i)) + +x = torch.ones((2, 2), device="cuda") +y = x @ x +assert y.is_cuda +assert y.shape == (2, 2) + +print("torch CUDA tensor test ok") +PY +pass + +echo +echo "=== 4. 检查 ComfyUI 核心模块 import ===" + +echo -n "检查 ComfyUI Python 模块... " +python3 - <<'PY' +import os +import sys + +sys.path.insert(0, os.getcwd()) + +import comfy +import folder_paths +import nodes + +print("comfy import ok") +print("folder_paths import ok") +print("nodes import ok") +print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) + +if len(nodes.NODE_CLASS_MAPPINGS) <= 0: + raise RuntimeError("ComfyUI 节点注册数量异常") +PY +pass + +echo +echo "=== 5. 启动 ComfyUI API 服务 ===" + +rm -f "$LOG_FILE" + +echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " +python3 main.py \ + --listen "$COMFYUI_HOST" \ + --port "$COMFYUI_PORT" \ + >"$LOG_FILE" 2>&1 & + +COMFYUI_PID=$! + +cleanup() { + if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + kill "$COMFYUI_PID" >/dev/null 2>&1 || true + wait "$COMFYUI_PID" >/dev/null 2>&1 || true + fi +} +trap cleanup EXIT + +sleep 3 + +if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then + pass +else + fail +fi + +echo -n "等待 ComfyUI API 就绪... " +python3 - <