i2v-longvideo-chain

Local Intel Arc A770 (16GB) image-to-video support: for running end-to-end image-to-video (I2V) tasks locally on Intel Arc A770 (XPU) using the ComfyUI + ComfyUI-WanVideoWrapper (KJ) stack, typically targeting 9–10 second videos. Covers model selection, VRAM allocation, workflow connections, end-frame stitching methods validated for longer videos, and troubleshooting guidance for issues like subject drift or out-of-memory (OOM) during single runs. Trigger phrases include: A770 I2V, ComfyUI image-to-video, 10s dance video, running Wan2.2 I2V on Intel Arc, making longer videos, frame stitching.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "i2v-longvideo-chain" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-e275a7f19ab31930a9879d99516ea2d623dc5671925cf62b6e686e4524218f02. Verify the upstream source and version against https://skillhub.cn/skills/user_283a17af/comfuyi-intel-arc-a770-longvideo before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Local Intel Arc A770 (16GB) image-to-video support: for running end-to-end image-to-video (I2V) tasks locally on Intel Arc A770 (XPU) using the ComfyUI + ComfyUI-WanVideoWrapper (KJ) stack, typically targeting 9–10 second videos. Covers model selection, VRAM allocation, workflow connections, end-frame stitching methods validated for longer videos, and troubleshooting guidance for issues like subject drift or out-of-memory (OOM) during single runs. Trigger phrases include: A770 I2V, ComfyUI image-to-video, 10s dance video, running Wan2.2 I2V on Intel Arc, making longer videos, frame stitching.

0 Downloads

Introduction source: third_party · user_283a17af · 1.0.1 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: i2v-longvideo-chain
description: This skill should be used when the user wants to run image-to-video (I2V) generation end-to-end on a local Intel Arc A770 16GB (XPU) + ComfyUI + ComfyUI-WanVideoWrapper (KJ) stack, especially when the goal is a practical 9-10 second clip and a single pass hits subject drift or OOM. It covers model selection, VRAM allocation, workflow wiring, the validated end-frame chaining method for long videos, and the troubleshooting playbook. Trigger phrases include "A770 I2V", "ComfyUI image to video", "10 second dance video", "Wan2.2 I2V on Intel Arc", "make a longer video", or "chain the frames".
metadata:
  version: 1.0.2
  agent_created: true

A770 图生视频端到端指南(I2V Long-Video Chaining)

0. 什么时候用 / 什么时候别用

✅ 适合用本技能的场景:

条件 说明
显存有限(≤16GB,尤其 Intel Arc A770 / XPU) 无法一次性生成长视频,需要分段
想要 5~10 秒 的连续图生视频 单段直出会丢人物或 OOM,本技能用链式突破
已有 Wan2.2 14B I2V + ComfyUI-WanVideoWrapper 环境 或愿意按 §1 下载配置
用一张图驱动一个人物/主体做连续动作(跳舞、转身等) I2V 单图驱动的典型用法

❌ 不适合 / 别用本技能:

情况 更好的选择
只要 2~3 秒短片 直接单段生成即可,不必链式(见 §3)
显存充足(≥24GB)想一次直出长视频 直接调大 num_frames,无需分段拼接
需要文生视频(无首帧图) 用 T2V 工作流,本技能是 I2V
追求极致画质长视频且能重搭环境 可评估 LTX-Video 等原生长视频模型

一句话触发判断:显存不够 + 想要超过 3 秒的图生视频 → 用本技能的首尾帧链式。


环境替换清单(部署到你的机器时改这 5 处)

  • <COMFY_ROOT> → 你的 ComfyUI 安装根目录(示例:E:/ComfyUI-aki-v3-IntelArc)
  • <LAUNCH_BAT> → 你本机的启动脚本(示例:Launch_ComfyUI_Direct.bat;不同名请换)
  • <SUBJECT> → 你的首帧图片名(示例:林黛玉.png)
  • <BASENAME> → 输出文件前缀(示例:LinDaiyu_Dance_I2V_3s)
  • ffmpeg 用 <COMFY_ROOT>/python/Lib/site-packages/imageio_ffmpeg/binaries/ffmpeg-win-x86_64-v7.1.exe

本技能实测基于 Intel Arc A770 16GB + 绘世(aki) IntelArc 整合包;换设备/换整合包时,仅 <COMFY_ROOT> 与 <LAUNCH_BAT> 两处不同,其余流程通用。

快速上手(三条命令)

不想手动啃 JSON 的话,用附带脚本走捷径:

# 1) 下载 5 个权重(断点续传、进度条、大小校验;国内加 --mirror https://hf-mirror.com)
python scripts/download_models.py --comfy-root <COMFY_ROOT>

# 2) 交互式生成 config.json,并把一份工作流的首帧/分辨率/帧数/end_image 一次改好
python scripts/setup.py --workflow <你的工作流.json>

# 3) 手动用 <LAUNCH_BAT> 启动 ComfyUI → Load 工作流 → Queue Prompt 跑第一段

之后每续一段:python scripts/next_segment.py --completed N --config config.json --workflow <wf.json>, 全部段跑完:python scripts/concat_segments.py --segs _segs/seg1.mp4 ... --out out_9s.mp4 --ffmpeg <ffmpeg>。

详细原理与逐节点参数见下文各章。


1. 前置条件:模型、显存、环境

1.1 必须下载的模型文件(均来自 Comfy-Org 官方重打包)

模型 作用 文件名 大小量级 存放路径
Wan2.2 14B I2V high_noise 主采样(高噪声段) wan2.2_i2v_high_noise_14B_fp8_scaled.safetensors fp8 约 8 GB models/diffusion_models/
Wan2.2 14B I2V low_noise 主采样(低噪声段) wan2.2_i2v_low_noise_14B_fp8_scaled.safetensors fp8 约 8 GB models/diffusion_models/
CLIP Vision 提取首帧 clip_fea 作 I2V 条件 clip_vision_h.safetensors ~1.2 GB models/clip_vision/
文本编码器(umt5) 编码 prompt(Wan2.2 用 umt5,非 t5xxl) umt5_xxl_fp8_e4m3fn_scaled.safetensors fp8 约 5 GB models/text_encoders/
WanVideo VAE 视频 latent 编解码 wan_2.1_vae.safetensors ~300 MB models/vae/

官方仓库与直链(仓库根:https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged):

# 模型(diffusion_models)
https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/diffusion_models/wan2.2_i2v_high_noise_14B_fp8_scaled.safetensors
https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/diffusion_models/wan2.2_i2v_low_noise_14B_fp8_scaled.safetensors
# 文本编码器(text_encoders)
https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors
# VAE(vae)
https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/vae/wan_2.1_vae.safetensors
# clip_vision(若仓库含,否则从 Wan2.1 重打包仓库取同名文件)
https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_Repackaged/resolve/main/split_files/clip_vision/clip_vision_h.safetensors

迅雷可直链下载;文件大小以 HuggingFace 页面为准(fp8 量化版远小于 fp16)。 若你的 KJ 工作流节点显示 t5xxl 而非 umt5,以工作流实际加载的文件名为准——两者都是 Wan 文本编码器的 fp8 变体。

1.2 A770 16GB 显存分配

占用来源 大小 可调?
Wan2.2 14B I2V fp8 权重 磁盘 ~16 GB;运行时一次激活 ~2-3 GB 用 BlockSwap 分块卸载到 CPU/XPU 内存
Attention KV cache(关键) 随 frames × resolution² 增长 不可卸载,只能降分辨率/帧数
umt5 + clip_vision + VAE ~6-7 GB 基本固定,必须加载
系统/ComfyUI 开销 ~1 GB 不可调

结论:A770 16GB 能跑通 14B I2V 的关键不是显存大,而是 BlockSwap 把模型权重切块换出,同时 attention KV 靠降帧数和分辨率 控制。2 秒(33 帧 @512×960)稳跑;3 秒(49 帧 @448×832)是单段上限;5 秒(81 帧)开始丢人物;10 秒直出基本不可能。

1.3 环境要求

  • 启动方式:只能用你本机的启动脚本(<LAUNCH_BAT>,如 Launch_ComfyUI_Direct.bat)手动启动 ComfyUI。不要尝试 python main.py、不要注入 oneAPI setvars.bat、不要自动重启。
  • 官方 I2V 示例工作流获取:ComfyUI 菜单 Workflow → Browse Templates → Video → "Wan2.2 14B I2V"(需更新 ComfyUI 到最新版);或到 Comfy-Org example_workflows 仓库下载 JSON。本技能基于该官方示例改造,保留其主干节点。
  • 节点依赖:ComfyUI-WanVideoWrapper(KJ)、comfyui-kjnodes(ImageResizeKJv2)、ComfyUI-VideoHelperSuite(VHS_VideoCombine)。
  • ffmpeg:优先用 ComfyUI 自带的 imageio_ffmpeg/binaries/ffmpeg-win-x86_64-v7.1.exe(替换清单中的路径),系统 ffmpeg 可能读不出这些 mp4。

2. 工作流搭建:节点与连线

基础工作流建议从官方 Wan2.2 14B I2V 示例改,保留以下主干:

LoadImage
   │ IMAGE
   ▼
ImageResizeKJv2 (448×832, crop/center)
   │ IMAGE
   ├───────────► CLIPVisionLoader ──► CLIPVisionEncode ──►
   │                                                         │
   ▼                                                         ▼
WanVideoImageToVideoEncode ◄────────────────────────────── clip_fea
   │
   ▼ latent
WanVideoSampler (high_noise, steps=20, start=0, end=12)
   │
   ▼
WanVideoSampler (low_noise, steps=20, start=12, end=20/-1)
   │
   ▼
WanVideoDecode
   │
   ▼
VHS_VideoCombine (fps=16, save_metadata=false)

2.1 每个节点关键参数

节点 关键参数 推荐值 说明
LoadImage image 当前段首帧 第 1 段用 <SUBJECT>,后续用 <SUBJECT>_segN.png
ImageResizeKJv2 width/height 448 / 832 16:9 竖版;可按原图比例微调
CLIPVisionLoader clip_name clip_vision_h.safetensors 需匹配 clip_vision 目录
WanVideoImageToVideoEncode num_frames 49(≈3s) 单段上限,更长会丢人物
WanVideoImageToVideoEncode end_image 断开 接回首帧会导致动作冻结
WanVideoImageToVideoEncode start_latent_strength 1.0 首帧约束强度
WanVideoSampler high_noise steps/start/end 20 / 0 / 12 前 60% 去噪
WanVideoSampler low_noise steps/start/end 20 / 12 / -1 后 40% 去噪;end=-1 表示最后一步
WanVideoBlockSwap blocks_to_swap 30 让 XPU 能卸载分块;插件原生只认 CUDA,需改 model.py
VHS_VideoCombine filename_prefix <BASENAME>_segN 每段唯一前缀
VHS_VideoCombine save_metadata false 设为 true 时 ffmpeg 封装会崩
VHS_VideoCombine fps 16 与 num_frames 一起决定时长

完整参数表见 references/workflow_params.md。


3. 端到端生成流程(2-3 秒单段)

3.1 跑通第一段

  1. 确认模型、clip_vision、umt5、VAE 全部就位(§1.1)。
  2. 启动 ComfyUI:用 <LAUNCH_BAT> 手动启动。
  3. 在 ComfyUI 浏览器里 Load 你的 I2V 工作流(如官方示例改造版)。
  4. LoadImage 选首帧(如 <SUBJECT>)。
  5. 检查分辨率 448×832、num_frames=49、两个 Sampler 都是 20 步、end_image 未连接。
  6. 点 Queue Prompt,等待约 20 分钟。
  7. 成品落在 ComfyUI/temp/<BASENAME>_00001.mp4。
  8. 立刻备份:复制到工作目录 _segs/seg1.mp4。

3.2 验证第一段真的出片了

检查项 方法 合格标准
文件存在 ls ComfyUI/temp/<BASENAME>_00001.mp4 有 mp4,且 > 200 KB
时长/帧率 ffmpeg -i <mp4> 看 Duration/Stream ~3.06s,448×832(或你的分辨率),16fps
人物全程在线 抽帧:ffmpeg -ss 0/1/2/3 -i <mp4> -frames:v 1 f.jpg 第 0~3 秒 JPG 大小相近(如 40-60KB)且都能看到人物
动作幅度 看码率 正常约 1300–2900 kb/s;若 < 1000 kb/s 且抽帧大小骤降,可能冻结

若 3 秒也丢人物(抽帧中段 JPG < 30KB 且无人物),说明帧数/分辨率还要降,或 seed/prompt 要调。参考 §6 决策树。


4. 长视频:首尾帧链式拼接(9-10 秒)

4.1 为什么必须链式

方案 结果 原因
单段 5s(81 帧) ❌ 人物 1 秒后消失 首帧条件随帧数衰减,不是 OOM
单段 10s(161 帧) ❌ OOM attention KV cache 超出 16GB,不可卸载
首尾帧链式 3×3s ✅ 9s 连续 每段都在 3s 上限内,人物全程在线
首尾帧链式 4×2.5s ✅ 10.24s 截 10s 更多次 Queue,但达到真正 10s

4.2 链式流程

对第 N 段(N ≥ 2):

  1. 运行脚本抽出第 N-1 段末帧作为第 N 段首帧:
    python scripts/next_segment.py --completed <N-1> --basename <BASENAME> \
        --img-base <SUBJECT_BASE> --workflow <workflow.json> \
        --video-dir <workdir>/_segs --input-dir <COMFY_ROOT>/input \
        --ffmpeg <COMFY_ROOT>/python/Lib/site-packages/imageio_ffmpeg/binaries/ffmpeg-win-x86_64-v7.1.exe

    其中 <SUBJECT_BASE> 是首帧图名去掉扩展名(如 林黛玉)。脚本会生成 <COMFY_ROOT>/input/<SUBJECT_BASE>_segN.png,并把工作流 LoadImage 和输出前缀改成第 N 段。

  2. 用户在 ComfyUI 浏览器里 重新 Load 工作流,确认 LoadImage 显示 <SUBJECT_BASE>_segN.png。
  3. 点 Queue Prompt。
  4. 跑完后立刻备份:cp ComfyUI/temp/<BASENAME>_segN_00001.mp4 <workdir>/_segs/segN.mp4。
  5. 重复直到凑够段数。

4.3 拼接所有段

python scripts/concat_segments.py \
    --segs _segs/seg1.mp4 _segs/seg2.mp4 _segs/seg3.mp4 \
    --out LinDaiyu_Dance_I2V_9s.mp4 --fps 16

拼接逻辑:去掉每段非末尾段的最后一帧(因为它等于下一段首帧),避免接缝重复。3×49 帧 = 147 帧,去掉 2 帧重叠 = 145 帧 ≈ 9.06s。


5. 排错手册(权重最高的部分)

现象 根因 解法
人物 1 秒后消失 num_frames ≥ 81,首帧条件衰减 降到 49 帧(3s),用链式
视频几乎没动/像静态图 end_image 接回首帧 断开 end_image
生成极慢(35~40 分钟) 步数 25 + 双图编码 改回 20 步,断开 end_image
ComfyUI 启动失败/卡死 用了 python main.py 或 setvars.bat 只用 <LAUNCH_BAT> 手动启动
API 提交返回 400 WanVideoWrapper 节点 widget 顺序与 /object_info 不匹配 不要自动提交,让用户点 Queue
找不到生成的视频 VHS 写到 temp/,被清理 每段跑完立刻复制到 _segs/
ffprobe/ffmpeg 读不出 mp4 用了系统 ffmpeg 或 Git-Bash /e/ 路径 用 ComfyUI 自带 ffmpeg 7.1 + Windows 原生路径 E:/...
拼接处顿挫/撕裂 用 loop 或硬拼重复帧 用首尾帧链式,或 ping-pong(动作来回)
队列跑的不是预期段 忘了重新 Load 工作流 F5 刷新/重新 Load,确认 LoadImage 显示新的 _segN.png
Python 脚本语法错误 字符串 stray quote 写完脚本后跑 py_compile 检查
模型加载报 device mismatch WanVideoWrapper 原生 CUDA 假设 改 wanvideo/modules/model.py:拼接前 y=[v.to(x[0].device) ...],BlockSwap 去掉 CUDA-only 判断
分辨率调高后 OOM attention KV 超过 16GB 降到 448×832 或 384×704,同时减少帧数

脚本前提(可靠性声明):next_segment.py 假设工作流中 LoadImage 是第一个被遍历到的该类节点、VideoCombine 节点用 dict 存 filename_prefix。若你的工作流结构不同,脚本可能找不到节点——此时手动改工作流首帧与前缀即可,流程不变。


6. 调参与决策树

详见 references/tuning_and_pitfalls.md。快速决策:

目标时长?
├─ 2–3s   → 单段,49 帧,448×832,20 步
├─ 5–9s   → 链式 2–3 段
└─ 10s    → 链式 3 段(9s)或 4×2.5s(10.24s 截 10s)

人物漂移?     → 降 num_frames 到 49
动作太弱?     → 换 seed、prompt 里加 "dancing gracefully, large sleeve movements"
OOM?          → 降分辨率到 384×704,同时减帧
视频冻结?     → 断开 end_image
速度慢一倍?   → 检查 steps 是否 25,改回 20

7. 实测效果基准(照此判断是否成功)

本技能已实际在 A770 16GB 上产出 9.06 秒连续林黛玉舞蹈(3 段 × 3 秒链式拼接)。 用下面这组实测数据当"及格线",抽帧后对号入座即可判断你的结果对不对:

指标 正常(人物全程在、动作明显) 异常(需重跑/调参)
单段码率 1300–2900 kb/s < 1000 kb/s → 冻结(多半 end_image 没断开)
抽帧 JPG 大小(-q:v 2) 各秒都 40–60 KB,肉眼可见人物 连续两帧 < 30 KB → 人物已丢失
单段时长 49 帧 @16fps ≈ 3.06s 明显更短 → 帧数设错
9s 成品 145 帧、~1400 kb/s、接缝无跳变 接缝顿挫 → 检查是否去重叠帧
单段耗时 3s 段约 20 分钟 翻倍 → 检查 steps 是否误设 25

参考素材:assets/expected_results.md 记录了实测三段与 9s 成品的完整数值。

8. 脚本与参考文件

  • scripts/download_models.py — 自动下载 5 个权重(断点续传 / 进度 / 大小校验 / 镜像)
  • scripts/setup.py — 交互式生成 config.json 并一键改好工作流(降低手改 JSON 门槛)
  • scripts/next_segment.py — 抽末帧 + 改工作流首帧/前缀(支持 --config,详细错误诊断)
  • scripts/concat_segments.py — 多段去重叠拼接(帧数自动探测,详细错误诊断)
  • references/workflow_params.md — 完整节点参数表、设备能力表、ffmpeg 命令
  • references/tuning_and_pitfalls.md — VRAM 三池模型、帧数策略、步数调参、10s 路径对照表、完整踩坑清单、决策树
  • assets/expected_results.md — 实测效果基准数值(判断成功与否的参照,含抽帧命令与大小基准)

Current listing version

1.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value82/100

Areas to improve

  • description写错位置 Reported severity: Minor

    顶层 frontmatter 已包含 description,但 skill_body 内部重复了相同内容

    Recommendation: 移除 skill_body 内部的重复 description,保持唯一性

Highlights

  • 针对 Intel Arc A770 16GB 用户的 I2V 长视频生成痛点提供端到端解决方案
  • 涵盖模型选择、显存分配、工作流搭建、链式拼接方法和排错手册
  • 实测验证 9.06 秒连续视频生成能力,具备明确实用价值
Trigger Precision95/100

Highlights

  • 触发短语精准完整,覆盖多种变体(A770 I2V、ComfyUI 图像转视频、10 秒舞蹈视频等)
  • 边界清晰,用户可快速判断是否适用
Structure and Standards92/100

Areas to improve

  • 文档过长 Reported severity: Minor

    skill_body 内容约 450 行,超出推荐长度

    Recommendation: 考虑将部分细节(如完整参数表、实测数据)移至 references 文件,保持主文档简洁

Highlights

  • 结构清晰,包含前置条件、工作流搭建、生成流程、长视频链式、排错手册等完整章节
  • 提供快速上手命令和端到端示例,frontmatter 完整
Execution Reliability88/100

Areas to improve

  • 缺少When to Use章节 Reported severity: Minor

    未显式标注 When to Use 章节,但已有等效内容

    Recommendation: 将“0. 什么时候用 / 什么时候别用”显式标注为 When to Use 以符合规范

Highlights

  • 工具来源明确(HuggingFace 官方重打包),参数正确
  • 覆盖主要异常(OOM、人物漂移、视频冻结、ffmpeg 路径问题等)
  • 提供交互式脚本降低操作门槛,不可逆操作有确认机制
Evidence Verifiability (mean of the first four)89/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • huggingface.co

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.