facebook twitter hatena line email

AI/ComfyUI/FramePack

提供: 初心者エンジニアの簡易メモ
移動: 案内検索

FramePackとは

低スペックpcでも動くAI動画生成ツール

ComfyUIにFramePackインストール

  1. ComfyUIを開いく
  2. 上部Managerボタンを押す
  3. CustomNodesManagerを開く
  4. 以下文字列を検索しインストールして、ComfyUIを再起動
ComfyUI-KJNodes
ComfyUI-VideoHelperSuite
ComfyUI_essentials
ComfyUI-FramePackWrapper


FramePackWrapper_Plusインストール

cd /d/src/comfyui
cd comfyui/custom_nodes
git clone https://github.com/ShmuelRonen/ComfyUI-FramePackWrapper_Plus
cd comfyui/
python3 -m venv .venv
source .venv/bin/activate
cd custom_nodes/ComfyUI-FramePackWrapper_Plus
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt

safetensorsをダウンロード

(AppleSiliconの場合は、FramePackI2V_HY_bf16.safetensors側を)

https://huggingface.co/Kijai/HunyuanVideo_comfy/blob/main/FramePackI2V_HY_bf16.safetensors

or

https://huggingface.co/Kijai/HunyuanVideo_comfy/blob/main/FramePackI2V_HY_fp8_e4m3fn.safetensors

上記を、ComfyUI/models/diffusion_models へ配置する

https://huggingface.co/Kijai/HunyuanVideo_comfy/blob/main/hunyuan_video_vae_bf16.safetensors

上記を、ComfyUI/models/vae へ配置する

https://huggingface.co/Comfy-Org/HunyuanVideo_repackaged/blob/main/split_files/text_encoders/clip_l.safetensors

上記を、ComfyUI/models/clip へ配置する

https://huggingface.co/Comfy-Org/sigclip_vision_384/blob/main/sigclip_vision_patch14_384.safetensors

上記を、ComfyUI/models/clip_vision へ配置する

https://huggingface.co/chatpig/llava-llama3/blob/00ed546a5666a4600c3fe931ee409357b4ffb7b2/llava_llama3_fp16.safetensors

上記を、ComfyUI/models/text_encoders へ配置する

ワークフローjson例

https://raw.githubusercontent.com/TTPlanetPig/TTP_Comfyui_FramePack_SE/refs/heads/main/examples/TTP_FramePack_Start_End_Image_example.json

https://teal-ai.com/wp-content/uploads/2025/06/framepack_workflow.json

framepack_workflow.json側、実行確認済み。

ワークフロー実行

上の実行するボタンを押す。進捗率は、タイトルバー出る。

例のワークフロー実行で、ComfyUI-FramePackWrapper_Plusのところで、エラーが出る場合

エラー詳細 Cannot execute because a node is missing the class_type property.: Node ID '#65'

以下ファイルの一部を修正

ComfyUI-FramePackWrapper_Plus/diffusers_helper/memory.py

変更前

gpu = torch.device(f'cuda:{torch.cuda.current_device()}')

変更後

import torch

if torch.cuda.is_available():
    gpu = torch.device(f'cuda:{torch.cuda.current_device()}')
elif torch.backends.mps.is_available():
    gpu = torch.device("mps")
else:
    gpu = torch.device("cpu")

'active_bytes.all.current'エラーが出るとき

以下ファイルを変更する ComfyUI-FramePackWrapper_Plus/diffusers_helper/memory.py

変更前

memory_stats = torch.cuda.memory_stats(device)
bytes_active = memory_stats['active_bytes.all.current']
bytes_reserved = memory_stats['reserved_bytes.all.current']
bytes_free_cuda, _ = torch.cuda.mem_get_info(device)
bytes_inactive_reserved = bytes_reserved - bytes_active
bytes_total_available = bytes_free_cuda + bytes_inactive_reserved
return bytes_total_available / (1024 ** 3)

変更後

    # CUDA が利用可能な場合(Windows+NVIDIA環境)
    if torch.cuda.is_available():
        memory_stats = torch.cuda.memory_stats(device)
        bytes_active = memory_stats.get('active_bytes.all.current', 0)
        bytes_reserved = memory_stats.get('reserved_bytes.all.current', 0)
        bytes_free_cuda, _ = torch.cuda.mem_get_info(device)
        bytes_inactive_reserved = bytes_reserved - bytes_active
        bytes_total_available = bytes_free_cuda + bytes_inactive_reserved
        return bytes_total_available / (1024 ** 3)

    # Apple Silicon (MPS) 向け:safe fallback
    elif torch.backends.mps.is_available():
        # PyTorch MPS にはメモリ統計APIがないので、仮に16GB固定などを返す
        try:
            import psutil
            total_ram_gb = psutil.virtual_memory().available / (1024 ** 3)
            return total_ram_gb
        except Exception:
            return 16.0  # fallback: 16GBと仮定

    # CPU fallback
    else:
        try:
            import psutil
            total_ram_gb = psutil.virtual_memory().available / (1024 ** 3)
            return total_ram_gb
        except Exception:
            return 8.0

"Trying to convert Float8_e4m3fn to the MPS backend but it does not have support for that dtype."エラーが出るとき

$ vi ~/.zshrc
alias comfy="/Applications/ComfyUI.app/Contents/MacOS/ComfyUI --force-fp16"
$ source ~/.zshrc
$ comfy
08:39:04.264 › Starting app v0.5.2
08:39:04.267 › Initializing Sentry
08:39:04.291 › App already running. Exiting...
08:39:04.291 › Queueing event desktop:app_quit with properties { reason: {}, exitCode: 0 }

AppleSiliconのpcの場合は、 ワークフローのModelの FramePackWrapper_Plusのe4m3をやめる。

-FramePackl2V_HY_fp8_e4m3fn...
+FramePackl2V_HY_fp16.safeten...
-quantization:fp8_e4m3fn
+quantization:disabled

参考:https://note.com/aicu/n/n072491018e0c

ffmpegがないエラーが出る場合

エラー詳細

VHS_VideoCombine
ffmpeg is required for video outputs and could not be found.
In order to use video outputs, you must either:
- Install imageio-ffmpeg with pip,
- Place a ffmpeg executable in /System/Volumes/Data/d/src/comfyui, or
- Install ffmpeg and add it to the system path.

対応方法:ffmpegインストール(macの場合)

% brew install ffmpeg
% ffmpeg -version
ffmpeg version 8.0 Copyright (c) 2000-2025 the FFmpeg developers

imageio-ffmpegエラーが出る場合

cd comfyui/
source .venv/bin/activate
python3 -m pip install imageio-ffmpeg

参考

ComfyUIにFramePackをインストール https://teal-ai.com/comfyui-framepack/