Generate videos using Wan 2.7 with three modes: text-to-video, image-to-video (first frame, keyframes, continuation, lip-sync), and reference-to-video (character/object consistency).

Model

alibaba/wan-2.7-video

Modes

ModeDescription
t2vGenerate video from a text prompt. Multi-shot via natural language.
i2vGenerate video from a first frame, first + last frames, or continue an existing video. Optional driving audio.
r2vGenerate video from reference images/videos. Use “Image 1”/“Video 1” identifiers in prompt.

Common Parameters

ParameterTypeRequiredDefaultDescription
modestringNo"t2v""t2v", "i2v", or "r2v"
promptstringDepends""Text prompt (max 5000 chars). Required for T2V and R2V
negative_promptstringNo""What to avoid (max 500 chars)
resolutionstringNo"1080P""720P" or "1080P"
durationintegerNo5Output duration in seconds (2-15)
prompt_extendbooleanNotrueLLM-based prompt rewriting. Improves short prompts but adds latency
watermarkbooleanNofalseAdd “AI Generated” watermark in lower-right corner
seedintegerNonullRandom seed (0-2147483647)

T2V Mode

Parameters

ParameterTypeRequiredDefaultDescription
audio_urlstringNonullAudio file URL. Formats: WAV, MP3. Duration: 2-30s. Max 15MB. Truncated to duration if longer
ratiostringNo"16:9"Aspect ratio: "16:9", "9:16", "1:1", "4:3", "3:4"

Multi-shot

Control shot structure using natural language in the prompt:
  • Single shot: “Generate a single-shot video”
  • Multi-shot: “Generate a multi-shot video” or describe shots with timestamps (e.g., “Shot 1 [0-3 seconds] wide shot: Rainy New York street at night”)
  • Default: If unspecified, the model interprets the prompt content

Example - Basic Text-to-Video

curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "alibaba/wan-2.7-video",
    "input": {
      "mode": "t2v",
      "prompt": "A kitten running in the moonlight",
      "resolution": "720P",
      "ratio": "16:9"
    }
  }'

Example - Multi-shot Narrative

curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "alibaba/wan-2.7-video",
    "input": {
      "mode": "t2v",
      "prompt": "A tense detective story. Shot 1 [0-3 seconds] wide shot: Rainy New York street at night. Shot 2 [3-6 seconds] medium shot: The detective enters an old building.",
      "resolution": "720P",
      "ratio": "16:9",
      "duration": 6
    }
  }'

Example - With Audio File

curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "alibaba/wan-2.7-video",
    "input": {
      "mode": "t2v",
      "prompt": "A cartoon kitten general stands bravely on a cliff",
      "audio_url": "https://example.com/epic.mp3",
      "resolution": "1080P",
      "ratio": "16:9",
      "duration": 10
    }
  }'

I2V Mode

Parameters

ParameterTypeRequiredDefaultDescription
first_frame_urlstringDependsnullFirst frame image URL. Formats: JPEG, JPG, PNG, BMP, WEBP. Resolution: 240-8000px. Max 20MB
last_frame_urlstringNonullLast frame image URL. Same format limits. Requires first_frame_url
video_urlstringDependsnullVideo to continue (MP4/MOV, 2-10s, max 100MB). Mutually exclusive with first_frame_url/last_frame_url
audio_urlstringNonullDriving audio URL for lip-sync / action timing. Formats: WAV, MP3. Duration: 2-30s. Max 15MB

Validation Rules

  • At least one of first_frame_url or video_url is required
  • last_frame_url requires first_frame_url
  • video_url (continuation) is mutually exclusive with first_frame_url / last_frame_url

Example - First Frame to Video

curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "alibaba/wan-2.7-video",
    "input": {
      "mode": "i2v",
      "prompt": "A kitten runs across the grass",
      "first_frame_url": "https://example.com/cat.png",
      "resolution": "720P",
      "duration": 10
    }
  }'

Example - First + Last Frame

curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "alibaba/wan-2.7-video",
    "input": {
      "mode": "i2v",
      "prompt": "A small black cat looks up at the sky curiously",
      "first_frame_url": "https://example.com/first.png",
      "last_frame_url": "https://example.com/last.png",
      "duration": 10,
      "prompt_extend": false
    }
  }'

Example - Video Continuation

Continue an existing video clip. If the input is 3s and duration is 15, the model generates 12s of new content. The final output is 15s.
curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "alibaba/wan-2.7-video",
    "input": {
      "mode": "i2v",
      "prompt": "A girl takes a selfie in the mirror, then leaves with her backpack",
      "video_url": "https://example.com/clip.mp4",
      "duration": 15
    }
  }'

R2V Mode

Parameters

ParameterTypeRequiredDefaultDescription
reference_image_urlsstring[]DependsnullReference images for characters/objects/scenes. Each must contain a single subject. Formats: JPEG, JPG, PNG, BMP, WEBP. Max 20MB each
reference_video_urlsstring[]DependsnullReference videos for characters. Each must contain a single subject. Formats: MP4, MOV. Duration: 1-30s. Max 100MB each
first_frame_urlstringNonullFirst frame image for scene control. Overrides ratio
reference_voice_urlstringNonullAudio URL for voice timbre override. Formats: WAV, MP3. Duration: 1-10s. Max 15MB
ratiostringNo"16:9"Aspect ratio: "16:9", "9:16", "1:1", "4:3", "3:4". Ignored when first_frame_url is set

Prompt Identifiers

Use “Image 1”, “Image 2” to reference images and “Video 1”, “Video 2” to reference videos. Images and videos are numbered separately based on array order. If there is only one reference, you can use “the reference image” or “the reference video”.

Validation Rules

  • At least 1 reference_image_urls or reference_video_urls is required
  • Total images + videos must not exceed 5

Example - Multi-Reference

curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "alibaba/wan-2.7-video",
    "input": {
      "mode": "r2v",
      "prompt": "Video 2 holds Image 3 and plays a soothing country ballad, while Video 1 smiles and watches",
      "reference_video_urls": [
        "https://example.com/person1.mp4",
        "https://example.com/person2.mp4"
      ],
      "reference_image_urls": [
        "https://example.com/guitar.png"
      ],
      "resolution": "720P",
      "duration": 10,
      "prompt_extend": false
    }
  }'

Example - Single Reference Image

curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "alibaba/wan-2.7-video",
    "input": {
      "mode": "r2v",
      "prompt": "The reference image character walks through a sunlit garden",
      "reference_image_urls": ["https://example.com/person.png"],
      "resolution": "1080P",
      "ratio": "16:9",
      "duration": 5
    }
  }'

Input Limits

AssetFormatsResolutionDurationFile Size
Audio (T2V / I2V driving)WAV, MP32-30s15MB
Voice timbre (R2V)WAV, MP31-10s15MB
First/last frame imageJPEG, JPG, PNG, BMP, WEBP240-8000px, ratio 1:8 to 8:120MB
Input video (I2V continuation)MP4, MOV240-4096px, ratio 1:8 to 8:12-10s100MB
Reference video (R2V)MP4, MOV240-4096px, ratio 1:8 to 8:11-30s100MB
Reference image (R2V)JPEG, JPG, PNG, BMP, WEBP240-8000px, ratio 1:8 to 8:120MB

Response

{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "abc123def456",
    "status": "pending"
  }
}