> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-recommend-assets-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ComfyUI Wan2.2 Fun Inp 首尾フレーム制御による動画生成の例

> 本記事では、ComfyUI を用いて Wan2.2 Fun Inp の首尾フレーム制御による動画生成の例を実行する方法について説明します。

**Wan2.2-Fun-Inp** は、Alibaba PAI チームが開発・公開した首尾フレーム制御型動画生成モデルです。ユーザーは**開始フレーム画像と終了フレーム画像**を入力することで、それらの間を滑らかに遷移する中間動画を生成できます。これにより、クリエイターはより高度な創造的コントロールを実現できます。本モデルは **Apache 2.0 ライセンス**のもとで公開されており、商用利用も可能です。

**主な特徴**：

* **首尾フレーム制御機能**：開始フレームと終了フレームの画像を入力し、その間の自然な遷移動画を生成。動画の一貫性と創作の自由度を向上
* **高品質動画生成**：Wan2.2 アーキテクチャを基盤とし、映画レベルの高精細動画を出力
* **マルチ解像度対応**：512×512、768×768、1024×1024 など複数の解像度での動画生成をサポートし、さまざまな用途に対応

**モデルバージョン**：

* **14B 高性能版**：モデルサイズは32GB以上。高品質な結果を提供しますが、大量のVRAMを必要とします

関連するモデル重みおよびコードリポジトリは以下の通りです：

* [🤗Wan2.2-Fun-Inp-14B](https://huggingface.co/alibaba-pai/Wan2.2-Fun-A14B-InP)
* コードリポジトリ：[VideoX-Fun](https://github.com/aigc-apps/VideoX-Fun)

## ComfyOrg Wan2.2 Fun InP & Control YouTube ライブ配信アーカイブ動画

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/YcAerNYIvho?si=Zh8tzRwI_OTAFx3m" title="ComfyUI Selection Toolbox New Features" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

## Wan2.2 Fun Inp 首尾フレーム制御動画生成ワークフローの例

<Tip>
  <Tabs>
    <Tab title="Portable or self deployed users">
      Make sure your ComfyUI is updated.

      * [Download ComfyUI](https://www.comfy.org/download)
      * [Update Guide](/installation/update_comfyui)

      Workflows in this guide can be found in the [Workflow Templates](/interface/features/template).
      If you can't find them in the template, your ComfyUI may be outdated. (Desktop version's update will delay sometime)

      If nodes are missing when loading a workflow, possible reasons:

      1. You are not using the latest ComfyUI version (Nightly version)
      2. Some nodes failed to import at startup
    </Tab>

    <Tab title="Desktop or Cloud users">
      * The Desktop is base on ComfyUI stable release, it will auto-update when there is a new Desktop stable release available.
      * [Cloud](https://cloud.comfy.org) will update after ComfyUI stable release.

      So, if you find any core node missing in this document, it might be because the new core nodes have not yet been released in the latest stable version. Please wait for the next stable release.
    </Tab>
  </Tabs>
</Tip>

本ワークフローには以下の2つのバージョンが含まれています：

1. lightx2v が提供する [Wan2.2-Lightning](https://huggingface.co/lightx2v/Wan2.2-Lightning) の4ステップLoRAを活用した高速化バージョン（動画の動きに若干の損失が出る可能性あり）
2. 加速用LoRAを含まない、標準の fp8\_scaled バージョン

以下は、RTX4090D（24GB VRAM）GPUを用いたテスト結果（解像度：640×640、フレーム数：81）です。

| モデルタイプ                  | VRAM使用率 | 初回生成時間 | 2回目以降の生成時間 |
| ----------------------- | ------- | ------ | ---------- |
| fp8\_scaled             | 83%     | ≈ 524秒 | ≈ 520秒     |
| fp8\_scaled + 4ステップLoRA | 89%     | ≈ 138秒 | ≈ 79秒      |

LoRAによる高速化効果は非常に顕著ですが、動画のダイナミクスに若干の劣化が生じる場合があります。そのため、本ワークフローでは、高速化LoRAを有効化したバージョンをデフォルトで提供しています。他のバージョン（非LoRA版）を使用したい場合は、該当ノードを選択して **Ctrl+B** ショートカットで有効化してください。

### 1. ワークフローファイルのダウンロード

ComfyUI を最新版に更新した後、メニュー `Workflow` → `Browse Templates` → `Video` から「**Wan2.2 Fun Inp**」を選択してワークフローを読み込んでください。

または、ComfyUI を最新版に更新した上で、以下のリンクからワークフローファイルをダウンロードし、ComfyUI の画面にドラッグ＆ドロップして読み込んでください。

<a className="prose" target="_blank" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/refs/heads/main/templates/video_wan2_2_14B_animate.json" style={{ display: 'inline-block', backgroundColor: '#0078D6', color: '#ffffff', padding: '10px 20px', borderRadius: '8px', borderColor: "transparent", textDecoration: 'none', fontWeight: 'bold'}}>
  <p className="prose" style={{ margin: 0, fontSize: "0.8rem" }}>JSON形式ワークフローをダウンロード</p>
</a>

<a className="prose" target="_blank" href="https://cloud.comfy.org/?template=video_wan2_2_14B_fun_inpaint&utm_source=docs" style={{ display: 'inline-block', backgroundColor: '#28A745', color: '#FFFFFF', padding: '10px 20px', borderRadius: '8px', borderColor: "transparent", textDecoration: 'none', fontWeight: 'bold'}}>
  <p className="prose" style={{ margin: 0, fontSize: "0.8rem" }}>Comfy Cloud で実行</p>
</a>

以下の画像を開始フレームおよび終了フレームの素材としてご使用ください。

![Wan2.2 Fun Control ComfyUI ワークフロー 開始フレーム素材](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/video/wan/wan2.2_fun_inp/start_image.png)
![Wan2.2 Fun Control ComfyUI ワークフロー 終了フレーム素材](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/video/wan/wan2.2_fun_inp/end_image.png)

### 2. モデルの準備

**Diffusion モデル**

* [wan2.2\_fun\_inpaint\_high\_noise\_14B\_fp8\_scaled.safetensors](https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/diffusion_models/wan2.2_fun_inpaint_high_noise_14B_fp8_scaled.safetensors)
* [wan2.2\_fun\_inpaint\_low\_noise\_14B\_fp8\_scaled.safetensors](https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/diffusion_models/wan2.2_fun_inpaint_low_noise_14B_fp8_scaled.safetensors)

**Lightning LoRA（任意：高速化用）**

* [wan2.2\_i2v\_lightx2v\_4steps\_lora\_v1\_high\_noise.safetensors](https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/loras/wan2.2_i2v_lightx2v_4steps_lora_v1_high_noise.safetensors)
* [wan2.2\_i2v\_lightx2v\_4steps\_lora\_v1\_low\_noise.safetensors](https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/loras/wan2.2_i2v_lightx2v_4steps_lora_v1_low_noise.safetensors)

**VAE**

* [wan\_2.1\_vae.safetensors](https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/vae/wan_2.1_vae.safetensors)

**テキストエンコーダー**

* [umt5\_xxl\_fp8\_e4m3fn\_scaled.safetensors](https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors)

```
ComfyUI/
├───📂 models/
│   ├───📂 diffusion_models/
│   │   ├─── wan2.2_fun_inpaint_high_noise_14B_fp8_scaled.safetensors
│   │   └─── wan2.2_fun_inpaint_low_noise_14B_fp8_scaled.safetensors
│   ├───📂 loras/
│   │   ├─── wan2.2_i2v_lightx2v_4steps_lora_v1_high_noise.safetensors
│   │   └─── wan2.2_i2v_lightx2v_4steps_lora_v1_low_noise.safetensors
│   ├───📂 text_encoders/
│   │   └─── umt5_xxl_fp8_e4m3fn_scaled.safetensors 
│   └───📂 vae/
│       └── wan_2.1_vae.safetensors
```

### 3. ワークフローの手順ガイド

<img src="https://mintcdn.com/dripart-docs-recommend-assets-api/19pHMF3x9dkLUPc9/images/tutorial/video/wan/wan2_2/wan_2.2_14b_fun_inp.jpg?fit=max&auto=format&n=19pHMF3x9dkLUPc9&q=85&s=64352fbf66f4469e05e193f3329a811f" alt="ワークフロー手順図" width="4182" height="2048" data-path="images/tutorial/video/wan/wan2_2/wan_2.2_14b_fun_inp.jpg" />

<Note>
  本ワークフローはLoRAを用いた構成です。対応するDiffusionモデルとLoRAが正しく一致していることを確認してください。
</Note>

1. **High noise** モデルおよび **LoRA** の読み込み
   * `Load Diffusion Model` ノードが `wan2.2_fun_inpaint_high_noise_14B_fp8_scaled.safetensors` を読み込んでいることを確認
   * `LoraLoaderModelOnly` ノードが `wan2.2_i2v_lightx2v_4steps_lora_v1_high_noise.safetensors` を読み込んでいることを確認
2. **Low noise** モデルおよび **LoRA** の読み込み
   * `Load Diffusion Model` ノードが `wan2.2_fun_inpaint_low_noise_14B_fp8_scaled.safetensors` を読み込んでいることを確認
   * `LoraLoaderModelOnly` ノードが `wan2.2_i2v_lightx2v_4steps_lora_v1_low_noise.safetensors` を読み込んでいることを確認
3. `Load CLIP` ノードが `umt5_xxl_fp8_e4m3fn_scaled.safetensors` を読み込んでいることを確認
4. `Load VAE` ノードが `wan_2.1_vae.safetensors` を読み込んでいることを確認
5. 開始フレームおよび終了フレームの画像をそれぞれアップロード
6. 「Prompt」グループ内にプロンプトを入力
7. `WanFunInpaintToVideo` ノードで解像度および動画長を調整
   * `width` および `height` パラメータを調整（デフォルト値は `640`）。小さめのサイズを設定していますが、必要に応じて変更可能です。
   * `length`（総フレーム数）を調整。現在のワークフローのFPSは16です。たとえば5秒間の動画を生成したい場合は、`5 × 16 = 80` と設定してください。
8. `Run` ボタンをクリックするか、ショートカットキー `Ctrl（macOSの場合はCmd） + Enter` を押して動画生成を実行
