Skip to content

HunyuanVideo generation

Tencent's HunyuanVideo open model, running on Civitai's Comfy workers. Text-to-video with LoRA support for custom subjects, styles, and motions.

json
{
  "$type": "videoGen",
  "input": {
    "engine": "hunyuan",
    "prompt": "...",
    "width": 854,
    "height": 480,
    "duration": 5
  }
}

HunyuanVideo is compute-intensive — always submit with wait=0.

Text-to-video

http
POST https://orchestration.civitai.com/v2/consumer/workflows?wait=0
Authorization: Bearer <your-token>
Content-Type: application/json

{
  "steps": [{
    "$type": "videoGen",
    "input": {
      "engine": "hunyuan",
      "prompt": "A majestic waterfall cascading down mossy rocks in a lush rainforest, slow motion",
      "width": 854,
      "height": 480,
      "duration": 5,
      "fps": 24,
      "steps": 40
    }
  }]
}
POST/v2/consumer/workflows
Set your Civitai API token via the Token button in the navbar to enable Try It.
Request body — edit to customize (e.g. swap the image URL or prompt)
Valid JSON

With LoRAs

Attach community LoRAs to bias subject, style, or motion. Format: { "air": "<AIR URN>", "strength": 0.0–1.0 }:

json
{
  "engine": "hunyuan",
  "prompt": "A character from the LoRA walking through a neon-lit city at night",
  "width": 854,
  "height": 480,
  "duration": 5,
  "fps": 24,
  "steps": 40,
  "loras": [
    { "air": "urn:air:hyv1:lora:civitai:123456@789012", "strength": 0.8 }
  ]
}
POST/v2/consumer/workflows
Set your Civitai API token via the Token button in the navbar to enable Try It.
Request body — edit to customize (e.g. swap the image URL or prompt)
Valid JSON

Using a custom model checkpoint

The default model is the base HunyuanVideo checkpoint. Override with any Civitai-hosted HunyuanVideo checkpoint using its AIR URN:

json
{
  "engine": "hunyuan",
  "model": "urn:air:hyv1:checkpoint:civitai:<modelId>@<versionId>",
  "prompt": "...",
  "width": 854,
  "height": 480,
  "duration": 5
}

Parameters

FieldDefaultNotes
engine— ✅"hunyuan"
prompt— ✅Generation prompt.
model(base HunyuanVideo)AIR URN for an alternative checkpoint.
width480Output width in pixels. Larger → slower and more expensive.
height480Output height in pixels.
duration51–30 seconds.
fps25Frame rate. Common values: 24, 25, 30.
steps4010–50 diffusion steps. More steps = higher quality, longer runtime.
cfgScale40–100. Guidance scale — lower is more creative.
loras[][]Array of { air, strength } LoRA attachments.
seedrandomInteger for reproducibility.
Use casewidthheightNotes
Fast / prototype480480Square, minimal cost.
Landscape 480p85448016:9, good balance.
Portrait 480p4808549:16 for mobile.
Landscape 720p1280720High quality; significantly slower.

Resolution and cost

Cost scales approximately with pixel count × duration × steps. Doubling the resolution (~4× pixel area) increases cost roughly 4×. Use whatif=true to preview exact cost before committing.

Cost

HunyuanVideo cost depends on width × height × duration × fps × steps. The formula uses GPU-second estimation with a 5× markup, rounded to the nearest 25 Buzz (minimum 100 Buzz).

Use whatif=true to get an exact preview:

bash
curl -s "https://orchestration.civitai.com/v2/consumer/workflows?whatif=true" \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{"steps":[{"$type":"videoGen","input":{"engine":"hunyuan","prompt":"...","width":854,"height":480,"duration":5,"steps":40}}]}'

Approximate ranges (854×480, 24 fps):

DurationStepsApprox. Buzz
3 s20~200–400
5 s40~500–1 000
10 s40~1 000–2 000

Actual cost varies with GPU load and model.

Reading the result

json
{
  "status": "succeeded",
  "steps": [{
    "name": "0",
    "$type": "videoGen",
    "status": "succeeded",
    "output": {
      "video": { "id": "blob_...", "url": "https://.../signed.mp4" }
    }
  }]
}

Blob URLs are signed and expire — refetch the workflow or call GetBlob for a fresh URL.

Long-running jobs

HunyuanVideo is compute-heavy. Expect 5–30 minutes depending on resolution, duration, and steps. Use wait=0 + polling or webhooks:

  • Webhooks (recommended): type: ["workflow:succeeded", "workflow:failed"] — see Results & webhooks
  • Polling: GET /v2/consumer/workflows/{workflowId} every 30–60 s

Troubleshooting

SymptomLikely causeFix
400 with "steps out of range"Value outside 10–50Clamp to 10–50.
400 with "duration out of range"Value outside 1–30Clamp to 1–30.
Very long queue waitLarge resolution / many stepsReduce width/height or steps for iteration; scale up for final renders.
Step failed, reason = "no_provider_available"No Comfy worker with HunyuanVideo warmRetry shortly.
Output looks blurry at high resolutionToo few stepsIncrease steps to 40–50 for larger resolutions.

Civitai Developer Documentation