All Products
Search
Document Center

Alibaba Cloud Model Studio:Wan - image-to-video - first frame

Last Updated:Mar 13, 2026

Model Wan image-to-video menghasilkan video yang mulus dari first-frame image dan text prompt.

Referensi: Panduan pengguna

Cakupan

Untuk memastikan pemanggilan API berhasil, model, URL endpoint, dan kunci API harus berada di wilayah yang sama. Pemanggilan lintas-wilayah akan gagal.

Catatan

Kode contoh dalam topik ini berlaku untuk wilayah Singapura.

Panggilan HTTP

Tugas image-to-video memakan waktu—biasanya 1 hingga 5 menit—sehingga API menggunakan pemanggilan asinkron dua langkah: Buat tugas → Polling hasil.

Langkah 1: Buat tugas

Singapura

POST https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

Virginia

POST https://dashscope-us.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

Beijing

POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

Catatan
  • Setelah tugas dibuat, gunakan task_id yang dikembalikan untuk menanyakan hasilnya. task_id berlaku selama 24 jam. Jangan membuat tugas duplikat. Sebagai gantinya, gunakan polling untuk mengambil hasilnya.

  • Untuk tutorial pemula, lihat Gunakan Postman atau cURL.

Parameter permintaan

Narasi multi-shot

Fitur ini hanya didukung oleh model wan2.6.

Aktifkan dengan mengatur "prompt_extend": true dan "shot_type":"multi".

curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.6-i2v-flash",
    "input": {
        "prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "img_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png",
        "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
    },
    "parameters": {
        "resolution": "720P",
        "prompt_extend": true,
        "duration": 10,
        "shot_type":"multi"
    }
}'

Dubbing otomatis

Fitur ini hanya didukung oleh model wan2.6 dan wan2.5.

Jika Anda tidak menyediakan input.audio_url, model secara otomatis menghasilkan musik latar atau efek suara yang sesuai berdasarkan konten video.

curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.5-i2v-preview",
    "input": {
        "prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "img_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
    },
    "parameters": {
        "resolution": "480P",
        "prompt_extend": true,
        "duration": 10
    }
}'

Sediakan file audio

Fitur ini hanya didukung oleh model wan2.6 dan wan2.5.

Untuk menentukan musik latar atau narasi suara untuk video Anda, masukkan URL file audio kustom Anda di parameter input.audio_url.

curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.5-i2v-preview",
    "input": {
        "prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "img_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png",
        "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
    },
    "parameters": {
        "resolution": "480P",
        "prompt_extend": true,
        "duration": 10
    }
}'

Hasilkan video tanpa suara

Hanya model-model berikut yang mendukung pembuatan video tanpa suara:

  • wan2.6-i2v-flash: Untuk menghasilkan video tanpa suara, Anda harus secara eksplisit mengatur parameters.audio = false.

  • model wan2.2 dan wan2.1: Video tanpa suara dihasilkan secara default. Tidak diperlukan parameter tambahan.

curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.2-i2v-plus",
    "input": {
        "prompt": "A cat running on the grass",
        "img_url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"
    },
    "parameters": {
        "resolution": "480P",
        "prompt_extend": true
    }
}'

Gunakan prompt negatif

Gunakan parameter negative_prompt untuk mencegah munculnya “flowers” dalam video yang dihasilkan.

curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.2-i2v-plus",
    "input": {
        "prompt": "A cat running on the grass",
        "negative_prompt": "flowers",
        "img_url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"
    },
    "parameters": {
        "resolution": "480P",
        "prompt_extend": true
    }
}'
Headers

Content-Type string (Wajib)

Tipe konten dari permintaan. Harus berupa application/json.

Authorization string (Required)

Kredensial autentikasi menggunakan kunci API Model Studio.

Contoh: Bearer sk-xxxx

X-DashScope-Async string (Wajib)

Mengaktifkan pemrosesan asinkron. Harus diatur ke enable karena permintaan HTTP hanya mendukung pemrosesan asinkron.

Penting

Mengembalikan error "current user api does not support synchronous calls" jika tidak disertakan.

Body permintaan

model string (Required)

Nama model. Untuk informasi selengkapnya mengenai model dan harga, lihat Model pricing.

Contoh: wan2.6-i2v-flash.

input object (Required)

Informasi input dasar, seperti prompt.

Properties

prompt string (Optional)

Prompt teks yang menjelaskan elemen dan karakteristik visual yang ingin Anda sertakan dalam gambar yang dihasilkan.

Bahasa Tiongkok dan Inggris didukung. Setiap karakter Tiongkok atau huruf dihitung sebagai satu karakter. Teks yang melebihi batas akan dipotong secara otomatis. Batas panjang bervariasi tergantung versi model:

  • Model wan2.6 dan wan2.5: hingga 1.500 karakter.

  • Model wan2.2 dan wan2.1: hingga 800 karakter.

Contoh: Seekor anak kucing berlari di atas rumput.

Untuk tips penulisan prompt, lihat Text-to-video/image-to-video prompt guide.

negative_prompt string (Optional)

Negative prompt yang menjelaskan konten yang ingin dikecualikan dari video. Ini membantu membatasi hasil video.

Bahasa Tiongkok dan Inggris didukung. Panjang maksimum adalah 500 karakter. Teks yang melebihi batas akan dipotong secara otomatis.

Contoh: low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions.

img_url string (Required)

URL atau data yang dikodekan Base64 dari gambar frame pertama.

Batasan gambar:

  • Format: JPEG, JPG, PNG (tanpa alpha channel), BMP, WEBP.

  • Resolusi: Lebar dan tinggi gambar harus antara 240 hingga 8.000 piksel.

  • Ukuran file: Maksimal 10 MB.

Format input yang didukung:

  1. URL publik:

    • Protokol HTTP atau HTTPS didukung.

    • Contoh: https://cdn.translate.alibaba.com/r/wanx-demo-1.png.

  2. String gambar yang dikodekan Base64:

    • Format data: data:{MIME_type};base64,{base64_data}.

    • Contoh: data:image/png;base64,GDU7MtCZzEbTbmRZ...... (disingkat karena panjang).

    • Untuk detail selengkapnya, lihat Input image.

audio_url string (Optional)

Model yang didukung: wan2.6 dan wan2.5.

URL file audio. Model menggunakan audio ini untuk menghasilkan video.

Format input yang didukung:

  1. URL publik:

    • Protokol HTTP dan HTTPS didukung.

    • Contoh: https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/xxx.mp3.

Batasan audio:

  • Format: wav, mp3.

  • Durasi: 3–30 detik.

  • Ukuran file: Maksimal 15 MB.

  • Penanganan kelebihan durasi: Jika durasi audio melebihi nilai duration (5 atau 10 detik), sistem akan memotongnya secara otomatis menjadi 5 atau 10 detik pertama. Sisa bagian tersebut akan dibuang. Jika durasi audio lebih pendek daripada durasi video, bagian video yang melebihi panjang audio akan menjadi video tanpa suara. Misalnya, jika audio berdurasi 3 detik dan video berdurasi 5 detik, 3 detik pertama video output memiliki suara, sedangkan 2 detik terakhirnya diam.

Contoh: https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3.

parameters object (Opsional)

Parameter pemrosesan video, termasuk resolusi, durasi, penulisan ulang prompt, dan Watermark.

Properties

resolution string (Opsional)

Penting

Parameter resolution secara langsung memengaruhi biaya. Untuk model yang sama, biayanya adalah sebagai berikut: 1080P > 720P > 480P. Sebelum memanggil operasi ini, konfirmasi model pricing.

Menentukan tingkat resolusi video yang dihasilkan. Model menyesuaikan output ke jumlah piksel total yang serupa berdasarkan tingkat yang dipilih. Rasio aspek video akan mendekati rasio aspek gambar input (img_url). Untuk informasi selengkapnya, lihat FAQ.

Nilai default dan nilai Enumerasi yang tersedia untuk parameter ini bergantung pada parameter model. Aturannya adalah sebagai berikut:

  • wan2.6-i2v-flash: Opsi: 720P, 1080P. Default: 1080P.

  • wan2.6-i2v: Opsi: 720P, 1080P. Default: 1080P.

  • wan2.6-i2v-us: Opsi: 720P, 1080P. Default: 1080P.

  • wan2.5-i2v-preview: Opsi: 480P, 720P, 1080P. Default: 1080P.

  • wan2.2-i2v-flash: Opsi: 480P, 720P. Default: 720P.

  • wan2.2-i2v-plus: Opsi: 480P, 1080P. Default: 1080P.

  • wan2.1-i2v-turbo: Nilai yang valid adalah 480P dan 720P. Nilai default-nya adalah 720P.

  • wan2.1-i2v-plus: Nilai yang valid adalah 720P. Nilai default-nya adalah 720P.

Contoh: 1080P.

duration integer (Opsional)

Penting

Durasi secara langsung memengaruhi biaya. Penagihan dilakukan per detik. Durasi yang lebih panjang berarti biaya lebih tinggi. Sebelum memanggil operasi ini, konfirmasi model pricing.

Durasi video yang dihasilkan dalam satuan detik. Nilai yang valid untuk parameter ini bergantung pada parameter model:

  • wan2.6-i2v-flash: Bilangan bulat dari 2 hingga 15. Default: 5.

  • wan2.6-i2v: Bilangan bulat dari 2 hingga 15. Default: 5.

  • wan2.6-i2v-us: Opsi: 5, 10, 15. Default: 5.

  • wan2.5-i2v-preview: Opsi: 5, 10. Default: 5.

  • wan2.2-i2v-plus: Tetap 5 detik. Nilai ini tidak dapat diubah.

  • wan2.2-i2v-flash: Tetap 5 detik. Nilai ini tidak dapat diubah.

  • wan2.1-i2v-plus diatur ke 5 detik dan tidak dapat dimodifikasi.

  • wan2.1-i2v-turbo: Nilai yang valid adalah 3, 4, atau 5, dengan nilai default 5.

Contoh: 5.

prompt_extend boolean (Opsional) Default ke true

Apakah akan mengaktifkan penulisan ulang prompt. Jika diaktifkan, LLM akan menulis ulang prompt input. Hal ini dapat meningkatkan kualitas generasi secara signifikan untuk prompt yang lebih pendek, tetapi juga meningkatkan waktu pemrosesan.

  • true

  • false

Contoh: true

shot_type string (Opsional)

Model yang didukung: model seri wan2.6.

Menentukan apakah video yang dihasilkan terdiri dari satu shot kontinu atau beberapa shot yang berganti-ganti.

Kondisi aktivasi: Parameter ini hanya berlaku jika "prompt_extend": true.

Prioritas parameter: shot_type > prompt. Misalnya, jika Anda mengatur shot_type ke "single", model akan menghasilkan video satu shot meskipun prompt berisi frasa “generate a multi-shot video”.

Nilai yang valid:

  • single: (Default) Menghasilkan video satu lensa.

  • multi: Menghasilkan video dari beberapa Kamera.

Contoh: single.

Catatan

Gunakan parameter ini untuk mengontrol struktur narasi secara ketat, seperti satu shot untuk demo Produk atau beberapa shot untuk film pendek.

audio boolean (Opsional)

Penting

Pengaturan audio secara langsung memengaruhi biaya. Video dengan suara dan video tanpa suara memiliki harga berbeda. Sebelum memanggil operasi ini, konfirmasi model pricing.

Model yang didukung: wan2.6-i2v-flash.

Menentukan apakah akan menghasilkan video dengan suara.

Prioritas parameter: audio > audio_url. Jika audio=false, output-nya adalah video tanpa suara meskipun audio_url disediakan. Penagihan mengikuti laju untuk video tanpa suara.

Nilai yang valid:

  • true: Ini adalah nilai default, yang menghasilkan video dengan audio.

  • false: Menghasilkan video tanpa suara.

Contoh: true.

watermark boolean (Opsional)

Menentukan apakah akan menambahkan Watermark bertuliskan “AI Generated” di pojok kanan bawah video.

  • false: Nilai default. Tidak ada Watermark yang ditambahkan.

  • true: Menambahkan Watermark.

Contoh: false.

seed integer (Opsional)

Seed bilangan acak. Nilainya harus berada dalam rentang [0, 2147483647].

Jika Anda tidak menentukan parameter ini, sistem akan menghasilkan seed secara acak. Untuk meningkatkan kemampuan mereproduksi hasil yang dihasilkan, tentukan nilai seed tetap.

Perlu diperhatikan bahwa karena sifat probabilistik dari generasi model, penggunaan seed yang sama tidak menjamin hasil identik setiap kali.

Contoh: 12345.

Parameter respons

Respons berhasil

Simpan task_id untuk menanyakan status dan hasil task.

{
    "output": {
        "task_status": "PENDING",
        "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
    },
    "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

Respons error

Pembuatan task gagal. Lihat kode kesalahan untuk mengatasi masalah tersebut.

{
    "code": "InvalidApiKey",
    "message": "No API-key provided.",
    "request_id": "7438d53d-6eb8-4596-8835-xxxxxx"
}

output object

Informasi output task.

Properti

task_id string

ID dari task. Dapat digunakan untuk menanyakan task hingga 24 jam.

task_status string

Status tugas.

Enumeration

  • PENDING

  • RUNNING

  • SUCCEEDED

  • FAILED

  • CANCELED

  • UNKNOWN: Task tidak ada atau status tidak diketahui

request_id string

Identifier unik untuk permintaan. Gunakan untuk pelacakan dan troubleshooting masalah.

code string

Kode kesalahan. Dikembalikan hanya ketika permintaan gagal. Lihat kode kesalahan untuk detailnya.

message string

Pesan kesalahan detail. Dikembalikan hanya ketika permintaan gagal. Lihat kode kesalahan untuk detailnya.

Langkah 2: Kueri hasil

Singapore

GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id}

Virginia

GET https://dashscope-us.aliyuncs.com/api/v1/tasks/{task_id}

Beijing

GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}

Catatan
  • Saran polling: Pembuatan video dapat memakan waktu beberapa menit. Gunakan mekanisme polling dengan interval kueri yang wajar, misalnya 15 detik, untuk mengambil hasilnya.

  • Transisi status task: PENDING → RUNNING → SUCCEEDED atau FAILED.

  • URL hasil: Setelah task berhasil, URL video akan dikembalikan. URL tersebut berlaku selama 24 jam. Setelah Anda mendapatkan URL-nya, segera unduh dan simpan video tersebut ke layanan penyimpanan permanen, seperti Object Storage Service (OSS).

  • Masa berlaku task_id: 24 jam. Setelah periode ini, Anda tidak dapat lagi melakukan kueri terhadap hasilnya, dan API akan mengembalikan status task sebagai UNKNOWN.

Parameter permintaan

Hasil Kueri Tugas

Ganti {task_id} dengan nilai task_id yang dikembalikan oleh pemanggilan API sebelumnya. task_id berlaku untuk kueri dalam rentang 24 jam.

curl -X GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"
Header

Authorization string (Wajib)

Kredensial otentikasi menggunakan kunci API Model Studio.

Contoh: Bearer sk-xxxx

Parameter path URL

task_id string (Wajib)

ID dari task yang akan dikueri.

Parameter respons

Task berhasil

URL video hanya disimpan selama 24 jam, lalu secara otomatis di-purge. Segera simpan video yang dihasilkan.

{
    "request_id": "2ca1c497-f9e0-449d-9a3f-xxxxxx",
    "output": {
        "task_id": "af6efbc0-4bef-4194-8246-xxxxxx",
        "task_status": "SUCCEEDED",
        "submit_time": "2025-09-25 11:07:28.590",
        "scheduled_time": "2025-09-25 11:07:35.349",
        "end_time": "2025-09-25 11:17:11.650",
        "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "video_url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.mp4?Expires=xxx"
    },
    "usage": {
        "duration": 10,
        "input_video_duration": 0,
        "output_video_duration": 10,
        "video_count": 1,
        "SR": 720
    }
}

Task gagal

Jika task gagal, task_status diatur menjadi FAILED beserta kode kesalahan dan pesannya. Lihat kode kesalahan untuk menyelesaikan masalah tersebut.

{
    "request_id": "e5d70b02-ebd3-98ce-9fe8-759d7d7b107d",
    "output": {
        "task_id": "86ecf553-d340-4e21-af6e-a0c6a421c010",
        "task_status": "FAILED",
        "code": "InvalidParameter",
        "message": "The size is not match xxxxxx"
    }
}

Kueri task kedaluwarsa

task_id berlaku selama 24 jam. Setelah periode ini, kueri akan gagal dan mengembalikan pesan kesalahan berikut.

{
    "request_id": "a4de7c32-7057-9f82-8581-xxxxxx",
    "output": {
        "task_id": "502a00b1-19d9-4839-a82f-xxxxxx",
        "task_status": "UNKNOWN"
    }
}

output object

Informasi output task.

Properti

task_id string

ID task. Dapat digunakan untuk mengkueri task hingga 24 jam.

task_status string

Status tugas.

Enumerasi

  • PENDING

  • RUNNING

  • SUCCEEDED

  • FAILED

  • CANCELED

  • UNKNOWN: Task tidak ada atau status tidak diketahui

Transisi status selama polling:

  • PENDING → RUNNING → SUCCEEDED atau FAILED

  • Kueri pertama biasanya mengembalikan PENDING atau RUNNING

  • Status SUCCEEDED menyertakan URL video yang dihasilkan dalam respons

  • Status FAILED memerlukan pemeriksaan pesan kesalahan dan percobaan ulang

submit_time string

Waktu saat task diajukan. Waktu dalam UTC+8. Format: YYYY-MM-DD HH:mm:ss.SSS.

scheduled_time string

Waktu saat task mulai berjalan. Waktu dalam UTC+8. Format: YYYY-MM-DD HH:mm:ss.SSS.

end_time string

Waktu saat task selesai. Waktu dalam UTC+8. Format: YYYY-MM-DD HH:mm:ss.SSS.

video_url string

URL video yang dihasilkan. Hanya dikembalikan ketika task_status bernilai SUCCEEDED.

URL berlaku selama 24 jam. Gunakan untuk mengunduh video dalam format MP4 dengan encoding H.264.

orig_prompt string

Prompt input asli. Ini adalah nilai dari parameter permintaan prompt.

actual_prompt string

Jika prompt_extend=true, sistem akan menulis ulang prompt input secara cerdas. Bidang ini mengembalikan prompt yang dioptimalkan untuk proses generasi.

  • Jika prompt_extend=false, bidang ini tidak dikembalikan.

  • Catatan: Model wan2.6 tidak pernah mengembalikan bidang ini, terlepas dari nilai prompt_extend.

code string

Kode kesalahan. Hanya dikembalikan jika permintaan gagal. Lihat kode kesalahan untuk detailnya.

message string

Pesan kesalahan detail. Hanya dikembalikan jika permintaan gagal. Lihat kode kesalahan untuk detailnya.

usage object

Statistik output. Hanya hasil yang berhasil yang dihitung.

Properti

Parameter yang dikembalikan untuk model seri wan2.6

input_video_duration integer

Durasi video input dalam detik. Video input saat ini tidak didukung, sehingga nilainya tetap 0.

output_video_duration integer

Hanya dikembalikan untuk model wan2.6.

Durasi video output dalam detik. Sama dengan nilai input.duration.

duration integer

Total durasi video, digunakan untuk penagihan.

Rumus penagihan: duration=input_video_duration+output_video_duration.

SR integer

Hanya dikembalikan untuk model wan2.6. Tingkat resolusi video yang dihasilkan. Contoh: 720.

video_count integer

Jumlah video yang dihasilkan. Tetap bernilai 1.

audioboolean

Hanya dikembalikan untuk model wan2.6-i2v-flash. Menunjukkan apakah video output memiliki suara.

Parameter yang dikembalikan untuk model seri wan2.2 dan wan2.5

duration integer

Durasi video yang dihasilkan dalam detik. Nilai valid: 5 dan 10.

Rumus penagihan: Biaya = Durasi video dalam detik × Harga satuan.

SR integer

Resolusi video yang dihasilkan. Nilai valid: 480, 720, dan 1080.

video_count integer

Jumlah video yang dihasilkan. Tetap bernilai 1.

Parameter yang dikembalikan untuk model seri wan2.1

video_duration integer

Durasi video yang dihasilkan dalam detik. Nilai valid: 3, 4, dan 5.

Rumus penagihan: Biaya = Durasi video dalam detik × Harga satuan.

video_ratio string

Rasio aspek video yang dihasilkan. Tetap bernilai standard.

video_count integer

Jumlah video yang dihasilkan. Tetap bernilai 1.

request_id string

Identifier unik untuk permintaan. Gunakan untuk pelacakan dan troubleshooting masalah.

Panggilan SDK DashScope

Nama parameter SDK sebagian besar sesuai dengan API HTTP. Struktur parameter mengikuti konvensi spesifik bahasa.

Karena tugas image-to-video memakan waktu—biasanya 1 hingga 5 menit—SDK membungkus alur panggilan HTTP asinkron dan mendukung pemanggilan sinkron maupun asinkron.

Waktu pemrosesan aktual bergantung pada panjang antrian dan eksekusi layanan. Tunggu hasilnya dengan sabar.

Memanggil SDK Python

Penting

Pastikan versi SDK Python DashScope Anda minimal 1.25.8 sebelum menjalankan kode berikut.

Jika versinya terlalu lama, kesalahan seperti “url error, please check url!” dapat terjadi. Perbarui SDK seperti dijelaskan dalam Instal SDK.

Atur base_http_api_url berdasarkan wilayah model:

Singapura

dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'

Virginia

dashscope.base_http_api_url = 'https://dashscope-us.aliyuncs.com/api/v1'

Beijing

dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'

Kode contoh

Panggilan sinkron

Panggilan sinkron memblokir hingga video dihasilkan. Contoh ini menunjukkan tiga metode input gambar: URL publik, enkripsi Base64, dan jalur file lokal.

Contoh permintaan
import base64
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import mimetypes
import dashscope

# Berikut adalah endpoint untuk wilayah Singapura. Untuk informasi lebih lanjut, lihat: https://www.alibabacloud.com/help/en/model-studio/image-to-video-api-reference
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'


# Jika Anda belum mengonfigurasi variabel lingkungan DASHSCOPE_API_KEY, ganti baris berikut dengan kunci API Model Studio Anda: api_key="sk-xxx"
# Untuk mendapatkan kunci API, kunjungi: https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")

# --- Fungsi bantu: Untuk enkripsi Base64 ---
# Format: data:{MIME_type};base64,{base64_data}
def encode_file(file_path):
    mime_type, _ = mimetypes.guess_type(file_path)
    if not mime_type or not mime_type.startswith("image/"):
        raise ValueError("Format gambar tidak didukung atau tidak dikenali")
    with open(file_path, "rb") as image_file:
        encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
    return f"data:{mime_type};base64,{encoded_string}"

"""
Metode input gambar:
Contoh ini menunjukkan tiga cara untuk memberikan gambar input.

1. URL publik: Cocok untuk gambar yang dapat diakses publik.
2. File lokal: Cocok untuk pengembangan dan pengujian lokal.
3. Enkripsi Base64: Cocok untuk gambar pribadi atau skenario yang memerlukan transmisi terenkripsi.
"""

# [Metode 1] Gunakan URL gambar yang dapat diakses publik
# Contoh: Gunakan URL gambar publik
img_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"

# [Metode 2] Gunakan file lokal (mendukung jalur absolut dan relatif)
# Persyaratan format: file:// + jalur file
# Contoh (jalur absolut):
# img_url = "file://" + "/path/to/your/img.png"    # Linux/macOS
# img_url = "file://" + "C:/path/to/your/img.png"  # Windows
# Contoh (jalur relatif):
# img_url = "file://" + "./img.png"                # Jalur relatif terhadap direktori skrip saat ini

# [Metode 3] Gunakan gambar terenkripsi Base64
# img_url = encode_file("./img.png")

# Atur URL audio
audio_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"

def sample_call_i2v():
    # Panggilan sinkron yang mengembalikan hasil langsung.
    print('please wait...')
    rsp = VideoSynthesis.call(api_key=api_key,
                              model='wan2.6-i2v-flash',
                              prompt='A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.',
                              img_url=img_url,
                              audio_url=audio_url,
                              resolution="720P",
                              duration=10,
                              prompt_extend=True,
                              watermark=False,
                              negative_prompt="",
                              seed=12345)
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print("video_url:", rsp.output.video_url)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))


if __name__ == '__main__':
    sample_call_i2v()
Contoh respons
video_url berlaku selama 24 jam. Segera unduh.
{
    "status_code": 200,
    "request_id": "2794c7a3-fe8c-4dd4-a1b7-xxxxxx",
    "code": null,
    "message": "",
    "output": {
        "task_id": "c15d5b14-07c4-4af5-b862-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
        "submit_time": "2026-01-22 23:24:46.527",
        "scheduled_time": "2026-01-22 23:24:46.565",
        "end_time": "2026-01-22 23:25:59.978",
        "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise."
    },
    "usage": {
        "video_count": 1,
        "video_duration": 0,
        "video_ratio": "",
        "duration": 10,
        "input_video_duration": 0,
        "output_video_duration": 10,
        "audio": true,
        "SR": 720
    }
}

Panggilan asinkron

Contoh ini menunjukkan panggilan asinkron. Mengembalikan ID tugas segera. Anda harus melakukan polling untuk hasil atau menunggu hingga selesai.

Contoh permintaan
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

# Berikut adalah endpoint untuk wilayah Singapura. Untuk mendapatkan endpoint wilayah lain, kunjungi: https://www.alibabacloud.com/help/en/model-studio/image-to-video-api-reference
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'


# Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan kunci API Model Studio Anda: api_key="sk-xxx"
# Dapatkan kunci API Anda: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")

# Gunakan URL gambar yang dapat diakses publik
img_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"

# Atur URL audio
audio_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"


def sample_async_call_i2v():
    # Panggilan asinkron, mengembalikan task_id
    rsp = VideoSynthesis.async_call(api_key=api_key,
                                    model='wan2.6-i2v-flash',
                                    prompt='A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.',
                                    img_url=img_url,
                                    audio_url=audio_url,
                                    resolution="720P",
                                    duration=10,
                                    prompt_extend=True,
                                    watermark=False,
                                    negative_prompt="",
                                    seed=12345)
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print("task_id: %s" % rsp.output.task_id)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))

    # Dapatkan informasi tentang tugas asinkron.
    status = VideoSynthesis.fetch(task=rsp, api_key=api_key)
    if status.status_code == HTTPStatus.OK:
        print(status.output.task_status)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (status.status_code, status.code, status.message))

    # Tunggu hingga tugas asinkron selesai.
    rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print(rsp.output.video_url)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))


if __name__ == '__main__':
    sample_async_call_i2v()
Contoh respons

1. Contoh respons untuk pembuatan tugas

{
    "status_code": 200,
    "request_id": "6dc3bf6c-be18-9268-9c27-xxxxxx",
    "code": "",
    "message": "",
    "output": {
        "task_id": "686391d9-7ecf-4290-a8e9-xxxxxx",
        "task_status": "PENDING",
        "video_url": ""
    },
    "usage": null
}

2. Contoh respons untuk menanyakan hasil tugas

video_url berlaku selama 24 jam. Segera unduh.
{
    "status_code": 200,
    "request_id": "2794c7a3-fe8c-4dd4-a1b7-xxxxxx",
    "code": null,
    "message": "",
    "output": {
        "task_id": "c15d5b14-07c4-4af5-b862-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
        "submit_time": "2026-01-22 23:24:46.527",
        "scheduled_time": "2026-01-22 23:24:46.565",
        "end_time": "2026-01-22 23:25:59.978",
        "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise."
    },
    "usage": {
        "video_count": 1,
        "video_duration": 0,
        "video_ratio": "",
        "duration": 10,
        "input_video_duration": 0,
        "output_video_duration": 10,
        "audio": true,
        "SR": 720
    }
}

Pemanggilan SDK Java

Penting

Pastikan versi SDK Java DashScope Anda minimal 2.22.6 sebelum menjalankan kode berikut.

Jika versinya terlalu lama, kesalahan seperti “url error, please check url!” dapat terjadi. Perbarui SDK seperti dijelaskan dalam Instal SDK.

Atur baseHttpApiUrl berdasarkan wilayah model:

Singapura

Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";

Virginia

Constants.baseHttpApiUrl = "https://dashscope-us.aliyuncs.com/api/v1";

Beijing

Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";

Kode contoh

Panggilan sinkron

Panggilan sinkron memblokir hingga video dihasilkan. Contoh ini menunjukkan tiga metode input gambar: URL publik, enkripsi Base64, dan jalur file lokal.

Contoh permintaan
// Copyright (c) Alibaba, Inc. and its affiliates.

import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;

 
public class Image2Video {

    static {
        // URL wilayah Singapura. Dapatkan URL: https://www.alibabacloud.com/help/en/model-studio/image-to-video-api-reference
        Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
    }

    // Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan kunci API Model Studio Anda: apiKey="sk-xxx"
    // Dapatkan kunci API Anda: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");
    
    /**
     * Metode input gambar: Pilih salah satu dari tiga berikut
     *
     * 1. Gunakan URL publik - Cocok untuk gambar yang dapat diakses publik
     * 2. Gunakan file lokal - Cocok untuk pengembangan dan pengujian lokal
     * 3. Gunakan enkripsi Base64 - Cocok untuk gambar pribadi atau skenario yang memerlukan transmisi terenkripsi
     */

    // [Metode 1] URL publik
    static String imgUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png";

    // [Metode 2] Jalur file lokal (file://+jalur absolut)
    // static String imgUrl = "file://" + "/your/path/to/img.png";    // Linux/macOS
    // static String imgUrl = "file://" + "/C:/your/path/to/img.png";  // Windows

    // [Metode 3] Enkripsi Base64
    // static String imgUrl = Image2Video.encodeFile("/your/path/to/img.png");
    
    // Atur URL audio
    static String audioUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3";

    public static void image2video() throws ApiException, NoApiKeyException, InputRequiredException {
        // Atur parameter
        Map<String, Object> parameters = new HashMap<>();
        parameters.put("prompt_extend", true);
        parameters.put("watermark", false);
        parameters.put("seed", 12345);

        VideoSynthesis vs = new VideoSynthesis();
        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.6-i2v-flash")
                        .prompt("A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.")
                        .imgUrl(imgUrl)
                        .audioUrl(audioUrl)
                        .duration(10)
                        .parameters(parameters)
                        .resolution("720P")
                        .negativePrompt("")
                        .build();
        System.out.println("please wait...");
        VideoSynthesisResult result = vs.call(param);
        System.out.println(JsonUtils.toJson(result));
    }
    
     /**
     * Enkode file menjadi string Base64
     * @param filePath Jalur file
     * @return String Base64 dalam format: data:{MIME_type};base64,{base64_data}
     */
    public static String encodeFile(String filePath) {
        Path path = Paths.get(filePath);
        if (!Files.exists(path)) {
            throw new IllegalArgumentException("File tidak ada: " + filePath);
        }
        // Deteksi tipe MIME
        String mimeType = null;
        try {
            mimeType = Files.probeContentType(path);
        } catch (IOException e) {
            throw new IllegalArgumentException("Tidak dapat mendeteksi tipe file: " + filePath);
        }
        if (mimeType == null || !mimeType.startsWith("image/")) {
            throw new IllegalArgumentException("Format gambar tidak didukung atau tidak dikenali");
        }
        // Baca konten file dan enkode
        byte[] fileBytes = null;
        try{
            fileBytes = Files.readAllBytes(path);
        } catch (IOException e) {
            throw new IllegalArgumentException("Tidak dapat membaca konten file: " + filePath);
        }
    
        String encodedString = Base64.getEncoder().encodeToString(fileBytes);
        return "data:" + mimeType + ";base64," + encodedString;
    }
    

    public static void main(String[] args) {
        try {
            image2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}
Contoh respons
video_url berlaku selama 24 jam. Segera unduh.
{
    "request_id": "87c091bb-7a3c-4904-8501-xxxxxx",
    "output": {
        "task_id": "413ed6e4-5f3a-4f57-8d58-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
        "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "submit_time": "2026-01-22 23:25:45.729",
        "scheduled_time": "2026-01-22 23:25:45.771",
        "end_time": "2026-01-22 23:26:44.942"
    },
    "usage": {
        "video_count": 1,
        "duration": 10.0,
        "input_video_duration": 0.0,
        "output_video_duration": 10.0,
        "SR": "720"
    },
    "status_code": 200,
    "code": "",
    "message": ""
}

Panggilan asinkron

Contoh ini menunjukkan panggilan asinkron. Mengembalikan ID tugas segera. Anda harus melakukan polling untuk hasil atau menunggu hingga selesai.

Contoh permintaan
// Copyright (c) Alibaba, Inc. and its affiliates.

import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisListResult;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.task.AsyncTaskListParam;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;

import java.util.HashMap;
import java.util.Map;

public class Image2Video {

    static {
        // URL berikut untuk wilayah Singapura. Untuk referensi API, kunjungi: https://www.alibabacloud.com/help/en/model-studio/image-to-video-api-reference
        Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
    }

    // Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan kunci API Model Studio Anda: api_key="sk-xxx"
    // Dapatkan kunci API Anda: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");
    // Atur URL gambar input.
    static String imgUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png";

    // Atur URL audio.
    static String audioUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3";

    public static void image2video() throws ApiException, NoApiKeyException, InputRequiredException {
        // Atur parameter.
        Map<String, Object> parameters = new HashMap<>();
        parameters.put("prompt_extend", true);
        parameters.put("watermark", false);
        parameters.put("seed", 12345);

        VideoSynthesis vs = new VideoSynthesis();
        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.6-i2v-flash")
                        .prompt("A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.")
                        .imgUrl(imgUrl)
                        .audioUrl(audioUrl)
                        .duration(10)
                        .parameters(parameters)
                        .resolution("720P")
                        .negativePrompt("")
                        .build();
        // Panggilan asinkron
        VideoSynthesisResult task = vs.asyncCall(param);
        System.out.println(JsonUtils.toJson(task));
        System.out.println("please wait...");

        // Dapatkan hasilnya.
        VideoSynthesisResult result = vs.wait(task, apiKey);
        System.out.println(JsonUtils.toJson(result));
    }

    // Dapatkan daftar tugas.
    public static void listTask() throws ApiException, NoApiKeyException {
        VideoSynthesis is = new VideoSynthesis();
        AsyncTaskListParam param = AsyncTaskListParam.builder().build();
        param.setApiKey(apiKey);
        VideoSynthesisListResult result = is.list(param);
        System.out.println(result);
    }

    // Ambil hasil tugas tunggal.
    public static void fetchTask(String taskId) throws ApiException, NoApiKeyException {
        VideoSynthesis is = new VideoSynthesis();
        // Jika DASHSCOPE_API_KEY diatur sebagai variabel lingkungan, apiKey bisa null.
        VideoSynthesisResult result = is.fetch(taskId, apiKey);
        System.out.println(result.getOutput());
        System.out.println(result.getUsage());
    }

    public static void main(String[] args) {
        try {
            image2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}
Contoh respons

1. Contoh respons untuk pembuatan tugas

{
    "request_id": "5dbf9dc5-4f4c-9605-85ea-xxxxxxxx",
    "output": {
        "task_id": "7277e20e-aa01-4709-xxxxxxxx",
        "task_status": "PENDING"
    }
}

2. Contoh respons untuk menanyakan hasil tugas

video_url berlaku selama 24 jam. Segera unduh.
{
    "request_id": "87c091bb-7a3c-4904-8501-xxxxxx",
    "output": {
        "task_id": "413ed6e4-5f3a-4f57-8d58-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
        "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "submit_time": "2026-01-22 23:25:45.729",
        "scheduled_time": "2026-01-22 23:25:45.771",
        "end_time": "2026-01-22 23:26:44.942"
    },
    "usage": {
        "video_count": 1,
        "duration": 10.0,
        "input_video_duration": 0.0,
        "output_video_duration": 10.0,
        "SR": "720"
    },
    "status_code": 200,
    "code": "",
    "message": ""
}

Batasan

  • Validitas data: Baik task_id maupun URL video hanya disimpan selama 24 jam. Setelah kedaluwarsa, tidak dapat ditanyakan atau diunduh.

  • Moderasi konten: Konten input (seperti prompt, gambar) dan video output menjalani pemeriksaan keamanan konten. Pelanggaran mengembalikan kesalahan seperti “IPInfringementSuspect” atau “DataInspectionFailed”. Lihat Pesan kesalahan.

Kode kesalahan

Jika pemanggilan model gagal dan mengembalikan pesan kesalahan, lihat Pesan kesalahan untuk troubleshooting.

FAQ

T: Bagaimana cara menghasilkan video dengan rasio aspek tertentu (misalnya, 3:4)?

J: Rasio aspek video output ditentukan oleh gambar first-frame input (img_url). Namun, rasio eksak (misalnya, tepat 3:4) tidak dijamin—penyimpangan kecil dapat terjadi.

  • Mengapa terjadi penyimpangan:

    Model menggunakan rasio gambar input Anda sebagai garis dasar dan menghitung resolusi valid terdekat berdasarkan total piksel target (ditentukan oleh resolution). Karena lebar dan tinggi harus kelipatan 16, dilakukan penyesuaian kecil. Jadi meskipun rasio output tidak tepat 3:4, akan sangat mendekati.

    • Contoh: Gambar input 750×1000 (rasio aspek 3:4 = 0,75), dengan resolution = "720P" (target ~920.000 piksel) menghasilkan output 816×1104 (rasio aspek ≈ 0,739, ~900.000 piksel).

  • Praktik terbaik:

    • Kontrol input: Gunakan gambar dengan rasio aspek target Anda sebagai first frame.

    • Pasca-pemrosesan: Jika rasio ketat diperlukan, potong atau tambahkan padding pada video yang dihasilkan menggunakan alat editing.

T: Bagaimana cara mendapatkan daftar putih nama domain untuk penyimpanan video?

J: Video yang dihasilkan model disimpan di OSS. API mengembalikan URL publik sementara. Untuk mengonfigurasi daftar putih firewall untuk URL unduhan ini, perhatikan hal berikut: Penyimpanan dasar dapat berubah secara dinamis. Topik ini tidak menyediakan daftar putih nama domain OSS tetap untuk mencegah masalah akses akibat informasi yang kedaluwarsa. Jika Anda memiliki persyaratan kontrol keamanan, hubungi manajer akun Anda untuk mendapatkan daftar nama domain OSS terbaru.