
This ComfyUI workflow demonstrates fast, high-quality text-to-video and image-to-video generation using the Wan 2.2 5B model. It wires together the essential building blocks: UNETLoader loads the Wan2.2 diffusion backbone, CLIPLoader and CLIPTextEncode turn your positive and negative prompts into conditioning, and ModelSamplingSD3 configures the sampler so KSampler can produce temporally consistent latents. For pure text-to-video, the diffusion model starts from noise; for image-to-video, Wan22ImageToVideoLatent injects structure and motion cues from a source image to initialize or steer the sequence.
Once frames are synthesized in latent space, VAELoader brings in the Wan 2.2 VAE and VAEDecode turns latents into RGB frames. CreateVideo assembles those frames at your chosen FPS and length, and SaveVideo writes the final clip to disk. The workflow is organized into helpful groups: Step1 - Load models to point at wan2.2_ti2v_5B_fp16.safetensors and wan2.2_vae.safetensors, Step3 - Prompt to edit text conditioning, a Video Size & length group to set resolution and frame count, and a For i2v, use Ctrl + B to enable branch that converts a still image into a moving shot. It’s optimized for rapid prototyping—tweak prompts, steps, and sizes, then iterate quickly to explore ideas.
API
Use this workflow from code
Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.
Run it from TypeScript or Python with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.
// Install (beta)
npm i @comfyorg/sdk
// Run "Wan 2.2 5B Video Generation" (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_5B_ti2v_api.json");
const asset = client.assets.fromFile("input.png");
wf.setInput("56", "image", asset); // LoadImage
wf.setInput("6", "text", "your prompt here"); // CLIPTextEncode
const job = await client.run(wf);
await job.getOutputs("58")[0].toFile("output.png"); // SaveVideoThe SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API).
Comfy Cloud API access requires a plan with an API key.
FAQ













