Open8

ModalでComfyUIメモ

hndrhndr
hndrhndr

https://modal.com/pricing

保管料はかかりますか?
現在、ネイティブの高パフォーマンスファイルサービングオブジェクトであるボリュームは無料です。これは2026年初頭に変更される予定です。ボリュームの有料化が開始された際には、Amazon S3の料金と同程度になる予定です。

hndrhndr
hndrhndr

Modalでもbuild時のgpuチェック回避すればよさそう

# comfyapp.py
.run_commands(
        # CUDA 12.8(nvcc)導入
        "set -eux; "
        "wget https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb; "
        "dpkg -i cuda-keyring_1.1-1_all.deb; "
        "apt-get update; "
        "apt-get install -y cuda-toolkit-12-8; "
        # 1) clone(固定ディレクトリ)
        "rm -rf /opt/SageAttention; "
        "git clone --depth=1 https://github.com/thu-ml/SageAttention.git /opt/SageAttention; "
        # 2) setup.py の GPU検出ブロックを削除
        #   - リポジトリ直下に setup.py があるので “/opt/SageAttention/setup.py” を編集
        #   - パターンの違いに備え、2通りのレンジ削除を試し、いずれかが当たればOK
        "sed -i '/if not compute_capabilities:/,/Detect GPUs with compute capabilities/d' /opt/SageAttention/setup.py || true; "
        "sed -i '/# BEGIN GPU DETECTION/,/# END GPU DETECTION/d' /opt/SageAttention/setup.py || true; "
        # 3) ビルド:環境変数は同一シェルで export → pip install
        'export CUDA_HOME="/usr/local/cuda-12.8"; '
        'export PATH="$CUDA_HOME/bin:$PATH"; '
        # 4) 複数SMをサポート(T4=7.5, A100=8.0, RTX30=8.6, L4/4090=8.9, H100=9.0)
        'export TORCH_CUDA_ARCH_LIST="7.5;8.0;8.9;9.0"; '
        'export CMAKE_CUDA_ARCHITECTURES="75;80;89;90"; '
        "export FORCE_CUDA=1; "
        "cd /opt/SageAttention; "
        "pip install -v --no-build-isolation ."
    )
hndrhndr

https://github.com/comfyanonymous/ComfyUI/issues/9629
https://github.com/comfyanonymous/ComfyUI/issues/9773
sageattention2系とxformersを入れたら--use-sage-attention で起動してもQwen Image Editで無事動くようになった。

Wanではまだerrorが出てフォールバックされてしまっているのでうまくbuildができていないのかも

Requested to load WAN22_Animate
loaded partially 32223.01729244847 32223.017250061035 316
  0%|          | 0/6 [00:00<?, ?it/s]Error running sage attention: SM80 kernel is not available. make sure you GPUs with compute capability 8.0 or higher., using pytorch attention instead.
Error running sage attention: SM80 kernel is not available. make sure you GPUs with compute capability 8.0 or higher., using pytorch attention instead.

https://github.com/comfyanonymous/ComfyUI/issues/9671
https://github.com/comfyanonymous/ComfyUI/issues/7770