
「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.
常見問題














