
This ComfyUI tutorial workflow demonstrates how to generate controllable videos with Wan2.2 Fun Control (14B), guided by pose, depth, and edge inputs. At its core, the Wan22FunControlToVideo node fuses your text prompt from CLIPTextEncode with one or more control streams derived from a reference video. The model stack loads via UNETLoader and VAELoader, while CLIPLoader and CLIPTextEncode provide multilingual text conditioning. Sampling runs through ModelSamplingSD3 with KSamplerAdvanced to balance quality, speed, and control strength. Finally, VAEDecode reconstructs frames and SaveVideo exports the result.
You can preprocess control videos directly in the graph: LoadVideo and GetVideoComponents ingest your footage, Canny extracts edges, and optional custom nodes (comfyui_controlnet_aux and ComfyUI-DepthAnythingV2) add pose/depth maps. CreateVideo sets resolution, frame count, and FPS to match Wan2.2’s training regime (multi-resolution 512/768/1024, 81 frames at 16 FPS). The Start_image group lets you anchor the first frame with LoadImage for a consistent subject/look. An optional LoraLoaderModelOnly applies the Wan2.2 Lighting LoRA for faster renders at the cost of reduced motion dynamics. This gives you a flexible, reproducible pipeline for video-to-video generation with reliable structure preservation and style control.
API
從程式碼使用此工作流
每個 Comfy 工作流都是一個 JSON 圖。下方的 payload 就是此工作流,與 ComfyUI 執行時完全相同 — 你可以從此 URL 取得、放入版本控制,或在 ComfyUI 載入並逐節點執行。
使用 Comfy SDK 以 TypeScript 或 Python 執行。相同程式碼可用於 Comfy Cloud 或你自架的 ComfyUI — 只需更改 base URL。
// Install (beta)
npm i @comfyorg/sdk
// Run "Wan 2.2 14B Fun Control" (TypeScript)
import { Comfy } from "@comfyorg/sdk";
const client = new Comfy({ apiKey: "comfyui-..." });
// This workflow, exported in API format (see note below)
const wf = await client.workflows.fromFile("video_wan2_2_14B_fun_control_api.json");
const asset = client.assets.fromFile("input.png");
wf.setInput("145", "image", asset); // LoadImage
wf.setInput("179", "text", "your prompt here"); // CLIPTextEncode
const job = await client.run(wf);
await job.getOutputs("170")[0].toFile("output.png"); // SaveVideoSDK 需使用 API 格式的工作流:請在 ComfyUI 開啟此工作流,並使用 檔案 → 匯出工作流(API)。
常見問題













