8/26/2026

sfffffasdf

Thinking...

Looking into model diagnostics

I need to answer by diagnosing the issue. Since the user hasn't been explicit, it looks like I need to browse for information related to the current software and specifics about the model. I'm considering "minimax-h3" and wondering if maybe it’s a typo for Minimax Hailuo? I should search the web to clarify, and maybe look into the ComfyUI implementation as well. This will help narrow down the specifics!

Investigating regression issues

I'm looking into a regression issue that popped up from version 0.32 onward, especially with clone at large full resolution. The user mentioned they have a 0.4 MP resolution (864x480), and it seems that smaller resolutions are unaffected. I need to figure out how 2x might still be a concern. They were using PyTorch attention defaults versus SageAttention, with benchmarks from Sage 2.2 and 960x544 — intriguing performance on an unspecified GPU! I'll need more details on that.

Checking pip command for torch

I need to be careful with the pip command for installing torch, especially considering it might vary between nightly and stable versions. Since the current date is 2026, it’s likely I should check the official requirements to be sure I'm using the correct index. This way, I can avoid any potential issues during installation. Let's confirm the latest details before proceeding!

从你给出的配置看,H100 本身没问题,更可疑的是 CUDA/PyTorch/Comfy-Kitchen 加速内核没有真正启用,以及 attention 后端仍在走原生 PyTorch。

类似的 5 秒、约 0.5MP、20 steps、res_multistep 测试中,SageAttention 热启动约 58 秒,原生 attention 约 91 秒;再叠加模型加载、CLIP 编码和 VAE 解码,总时间接近 2 分钟很合理。(github.com)

你的环境中最可疑的地方

当前是:

text
Driver: 580.173.02
nvidia-smi CUDA: 13.0
PyTorch: 2.13.0+cu126
系统 nvcc: 12.4

三者版本不一致本身不一定报错:

  • nvidia-smi CUDA 13.0 表示驱动最高支持 CUDA 13;
  • PyTorch 使用自己携带的 CUDA 12.6 runtime;
  • nvcc 12.4 主要影响本地编译扩展。

但是,当前 Comfy-Kitchen 的预编译 CUDA wheel 要求 CUDA runtime ≥13.0;从源码编译则要求 Toolkit ≥12.8。你现在的 torch cu126 + nvcc 12.4 很可能导致 Comfy-Kitchen CUDA 后端无法加载,最终回退到 Triton/eager/PyTorch 路径。H100 上这足以造成接近 2 倍的差距。(github.com)


第一步:确认是否发生内核回退

在当前环境执行:

bash
cd ~/ComfyUI-Clean/ComfyUI-master

python - <<'PY'
import torch
import importlib.metadata as md

print("Torch:", torch.__version__)
print("Torch CUDA:", torch.version.cuda)
print("GPU:", torch.cuda.get_device_name(0))
print("Compute capability:", torch.cuda.get_device_capability(0))

try:
    print("comfy-kitchen:", md.version("comfy-kitchen"))
    import comfy_kitchen as ck
    print("Backends:")
    print(ck.list_backends())
except Exception as e:
    print("comfy-kitchen ERROR:", repr(e))
PY

重点看输出:

text
cuda:
    available: True

如果出现以下任一种情况,基本就找到原因了:

text
cuda available: False

或者:

text
comfy-kitchen ERROR

或者只有:

text
eager
triton

没有可用的 cuda backend。

同时检查启动日志中有没有:

text
Found comfy_kitchen backend cuda
Using sage attention

如果只看到:

text
Using pytorch attention

速度通常会明显慢。


第二步:建议将 PyTorch 切到 cu130

你的驱动已经是 R580,满足 CUDA 13.0 wheel 的要求。ComfyUI 当前官方独立环境也提供 torch 2.13.0+cu130 栈。(github.com)

建议先备份环境:

bash
python -m pip freeze > requirements-backup.txt

然后安装匹配版本:

bash
python -m pip uninstall -y torch torchvision torchaudio

python -m pip install \
  torch==2.13.0+cu130 \
  torchvision==0.28.0+cu130 \
  torchaudio==2.11.0+cu130 \
  --index-url https://download.pytorch.org/whl/cu130

重新安装 ComfyUI 当前要求的 Comfy-Kitchen:

bash
grep '^comfy-kitchen' requirements.txt
python -m pip install --force-reinstall --no-deps "$(grep '^comfy-kitchen' requirements.txt)"

再验证:

bash
python - <<'PY'
import torch
import comfy_kitchen as ck

print(torch.__version__)
print(torch.version.cuda)
print(torch.cuda.get_device_name())
print(ck.list_backends())
PY

目标结果:

text
2.13.0+cu130
13.0
NVIDIA H100 80GB HBM3
cuda backend available: True

关于系统 nvcc

如果全部使用预编译 wheel,系统 nvcc 12.4 不一定影响运行。

但如果要本地编译 Comfy-Kitchen、SageAttention 或其他 CUDA 扩展,建议把 CUDA Toolkit 升到至少 12.8,最好与 PyTorch 对齐到 13.0。当前 Comfy-Kitchen 源码编译要求 Toolkit ≥12.8。(github.com)


第三步:确认 Attention 后端

你的截图只显示了:

text
Sampler: Res Multistep

没有看到 Attention Backend 节点。

建议在工作流中加入:

text
UNET Loader
    ↓
Model Attention Backend
    ↓
Basic Guider / Scheduler

优先测试:

  1. sage attention
  2. comfy kitchen attention
  3. 原生 PyTorch attention,作为对照

或者通过启动参数:

bash
python main.py --use-sage-attention

启动时必须确认日志明确显示:

text
Using sage attention

在一组公开的同参数测试中:

Attention 热启动耗时
SageAttention 2.2 约 58 秒
Native attention 约 91 秒

这正好接近你描述的“目标约 1 分钟,实际约 2 分钟”。(github.com)


第四步:区分冷启动和真正采样时间

你的配置是:

text
864×480
5 秒
约 124 帧
20 steps(如果使用官方模板)
pruned INT8

不要只测第一次。连续生成两次完全相同的尺寸、帧数和模型:

  • 第一次:加载模型、量化权重准备、CUDA/Triton 编译;
  • 第二次:热启动,更接近真实性能。

记录:

项目 第一次 第二次
CLIP 编码
Sampling 20 steps
Video VAE Decode
Audio VAE Decode
总时间

判断方式:

  • 第一次 120 秒、第二次 60~70 秒:基本正常,是冷启动;
  • 两次都约 120 秒:attention 或 Comfy-Kitchen 内核问题;
  • 采样约 60 秒,但总耗时 120 秒:CLIP/VAE/模型加载或 offload 问题;
  • 每一步采样约 5~6 秒:采样后端明显不正常;
  • 每一步约 2~3 秒:采样基本正常,时间花在其他节点。

第五步:检查 Dynamic VRAM/offload

H100 80GB 搭配 pruned INT8 模型,本不应该在采样过程中频繁把权重在 CPU/GPU 之间搬运。

启动日志中检查有没有大量:

text
partially loaded
loaded partially
offloaded
lowvram
DynamicVRAM

可以做一次 A/B 测试:

默认启动

bash
python main.py

高显存测试

bash
python main.py \
  --highvram \
  --disable-dynamic-vram \
  --disable-async-offload

ComfyUI 的 --highvram 会尽量让模型常驻显存,而 --disable-dynamic-vram 可以用于排除动态权重流式加载造成的性能问题。(github.com)

如果第二种启动方式从 120 秒下降到约 60~70 秒,说明根因是:

  • Dynamic VRAM;
  • async offload;
  • 模型被部分加载;
  • CPU/GPU 权重搬运。

注意观察显存峰值,避免同时常驻不需要的多个 H3 模型。


第六步:生成时监控 H100 是否真正跑满

开另一个终端:

bash
nvidia-smi --query-gpu=\
name,pstate,power.draw,power.limit,clocks.current.sm,\
utilization.gpu,utilization.memory,memory.used,memory.total \
--format=csv -l 1

也可以:

bash
nvidia-smi dmon -s pucvmet -d 1

采样阶段重点看:

  • Pstate 是否为 P0;
  • GPU Util 是否接近 90%~100%;
  • 功耗是否明显上升;
  • SM 时钟是否稳定;
  • 显存是否稳定,而不是上下反复波动。

典型异常

GPU Util 99%,但功耗很低

例如:

text
GPU Util: 99%
Power: 80~150W
Memory bandwidth: 很低

通常意味着:

  • 使用了低效 kernel;
  • Comfy-Kitchen 回退;
  • attention 后端不合适;
  • 大量小 kernel/同步操作。

ComfyUI 最近也有 H3 性能回归报告,症状就是 GPU Util 很高,但功耗和显存带宽很低。(github.com)

GPU Util 周期性掉到 0%

通常意味着:

  • CPU offload;
  • 权重从内存搬运;
  • VAE 在 CPU 上;
  • 磁盘读取;
  • CLIP 没有放在 GPU 上。

功耗被限制

检查:

bash
nvidia-smi -q -d POWER,CLOCK,PERFORMANCE

云服务器上的 H100 也可能被设置了较低 power limit,或者实际是共享/vGPU/MIG 实例。再检查:

bash
nvidia-smi -L
nvidia-smi topo -m

确认不是 MIG 切分实例。


第七步:确认 ComfyUI 版本

执行:

bash
git describe --tags --always --dirty
git log -1 --format='%H %ci'
python -m pip show comfy-kitchen

当前已有报告指出 ComfyUI 0.32.0/0.33.1 在 H3 高分辨率长视频下存在明显性能回归。不过该报告主要影响 1280×736、长视频,512×512 小尺寸未受影响;你的 864×480 不完全符合该问题,因此优先级低于 CUDA backend 和 attention。(github.com)

如果你正好使用 0.32.x/0.33.x,可以临时用独立目录对比 0.31.1,而不要直接破坏现有环境:

bash
cd ~
git clone https://github.com/Comfy-Org/ComfyUI.git ComfyUI-H3-test
cd ComfyUI-H3-test
git checkout v0.31.1

然后软链接模型目录,使用相同环境和工作流做一次 A/B 测试。


我的判断排序

根据目前信息,可能性从高到低是:

  1. PyTorch cu126 导致 Comfy-Kitchen CUDA backend 没加载,发生 fallback
  2. 没有使用 SageAttention,仍在使用原生 PyTorch attention
  3. 你测的是冷启动总时间,而“1 分钟”指热启动采样时间
  4. Dynamic VRAM/async offload 在 H100 上仍然搬运权重
  5. 云端 H100 被限制功耗、MIG 切分或共享
  6. ComfyUI 版本性能回归

最先执行这两个检查即可快速定位:

bash
python - <<'PY'
import torch
import comfy_kitchen as ck
print(torch.__version__, torch.version.cuda)
print(torch.cuda.get_device_name(), torch.cuda.get_device_capability())
print(ck.list_backends())
PY

以及生成时:

bash
nvidia-smi dmon -s pucvmet -d 1

我最倾向的修复组合是:

text
PyTorch 2.13.0+cu130
+ 可用的 comfy-kitchen CUDA backend
+ SageAttention
+ 第二次热启动测试
+ 排除 DynamicVRAM/offload

这套配置下,你截图中的 864×480、5 秒、pruned INT8、20 steps 才比较有可能稳定到约 1 分钟级别。