
This ComfyUI workflow turns short text prompts into coherent, multi‑frame videos using Tencent’s Hunyuan Video model. It starts by loading the model stack in Step1 - Load models: DualCLIPLoader provides the text encoders, CLIPTextEncode converts your positive and negative prompts into embeddings, and UNETLoader brings in the Hunyuan Video UNet weights. ModelSamplingSD3 configures the sampler for Hunyuan’s SD3‑style noise schedule, while FluxGuidance applies classifier‑free guidance during denoising. Step2 - Video size uses EmptyHunyuanLatentVideo to define width, height, frame count/fps, and duration, and RandomNoise seeds the initial latent video. The Custom sampler section (SamplerCustomAdvanced with KSamplerSelect and BasicScheduler) then iteratively denoises the video latents into a structured animation.
After sampling, the pipeline decodes latents back to RGB frames using VAELoader with VAEDecodeTiled (recommended by default for most GPUs) or VAEDecode, then assembles and writes the result via CreateVideo and SaveVideo. The workflow is designed for practical iteration: adjust prompt wording in Step3 - Prompt, tweak steps and guidance for fidelity and motion, and manage memory with VAEDecodeTiled and fp8 weight_dtype in UNETLoader when needed. For details and tips specific to Hunyuan Video, see the linked documentation.
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 "Hunyuan Video Text to Video" (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("hunyuan_video_text_to_video_api.json");
wf.setInput("44", "text", "your prompt here"); // CLIPTextEncode
const job = await client.run(wf);
await job.getOutputs("80")[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













