
“Wan 2.1 文生视频”工作流可将文本提示转化为动态视频内容,采用Wan 2.1模型。流程中,ComfyUI的KSampler、CLIPTextEncode、VAEDecode等节点负责解析文本描述并生成对应视频序列。通过CLIPLoader和UNETLoader节点,确保文本提示被准确编码和解码为视觉表现,VAELoader和EmptyHunyuanLatentVideo节点则管理潜视频空间和视频生成过程。最终输出由CreateVideo和SaveVideo节点将生成帧合成为完整视频文件。
该工作流特别适合内容创作者和数字艺术家,能根据叙述描述快速原型化视频概念。Wan 2.1模型支持高质量视频生成,对复杂提示有细致解读。流程结构化的模型加载和视频尺寸配置,便于用户高效从文本到视频,适合实验和专业视频生成项目。
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.1 文生视频" (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("text_to_video_wan_api.json");
wf.setInput("6", "text", "a fox moving quickly in a beautiful winter scenery nature trees mountains daytime tracking camera"); // CLIPTextEncode
const job = await client.run(wf);
await job.getOutputs("50")[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.
常见问题














