Buat video MiniMax H3
Buat tugas video MiniMax H3 atau H3-Max dengan teks, media referensi, atau frame pertama dan terakhir melalui CometAPI
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=minimax-h3' \
--form-string 'prompt=A paper boat glides across a still pond, daylight, locked camera, no text.' \
--form-string 'seconds=5' \
--form-string 'size=2544x1456'{
"id": "<task_id>",
"task_id": "<task_id>",
"object": "video",
"model": "minimax-h3",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}id yang dikembalikan untuk memeriksa tugas dan mengunduh video yang telah selesai.
POST /v1/videos menggunakan multipart/form-data. Kirim kontrol sebagai field formulir dan ulangi setiap field referensi sekali untuk setiap input media.
Pilih model
Aturmodel ke salah satu ID model berikut. Pilih ukuran permintaan dari tabel model yang sesuai di Atur durasi dan ukuran.
| ID model | Tingkat resolusi |
|---|---|
minimax-h3 | 768P, 2K |
minimax-h3-max | 480P, 768P |
Pilih mode input
Kedua model menggunakan field di bawah ini. Aturmodel ke ID model yang Anda pilih.
| Tujuan | Field wajib | Field opsional |
|---|---|---|
| Teks ke video | model, prompt | seconds, size |
| Gambar referensi | model, prompt, satu atau beberapa URL atau file input_reference | seconds, size |
| URL, URI data, atau file video referensi | model, prompt, satu atau beberapa field reference_videos | seconds, size |
| Audio referensi dengan gambar | model, prompt, input_reference, satu atau beberapa field reference_audios | seconds, size |
| URL frame pertama dan terakhir | model, prompt, first_frame | last_frame, seconds, size |
| Frame pertama dan terakhir yang diunggah | model, prompt, first_frame file | last_frame file, seconds, size |
Gunakan gambar referensi
Kirim gambar referensi melaluiinput_reference sebagai URL HTTPS yang dapat diakses publik atau file yang diunggah. Untuk beberapa gambar, ulangi field sesuai urutan gambar, dengan satu URL atau file per field.
Gunakan semua URL atau semua file dalam field ini. Kirim setiap URL secara terpisah, bukan menggabungkan URL menjadi nilai yang dipisahkan koma.
Anda dapat mengirim hingga sembilan gambar referensi PNG atau JPEG, baik menggunakan URL maupun file yang diunggah. Pertahankan ukuran setiap gambar yang diunggah pada atau di bawah 20 MiB.
Dalam Prompt, jelaskan detail visual yang harus dipertahankan oleh video yang dihasilkan.
Gunakan video dan audio referensi
Kirimreference_videos dan reference_audios sebagai nilai teks multipart atau file yang diunggah, menggunakan format di bawah ini.
Ulangi setiap field satu kali untuk setiap input, dengan hanya menggunakan nilai teks atau hanya file dalam field tersebut. Jangan gabungkan input menjadi nilai yang dipisahkan koma.
Field yang berbeda dapat menggunakan jenis input yang berbeda, seperti URL gambar dengan file audio yang diunggah.
Untuk menggabungkan referensi gambar, video, dan audio, kirim input_reference, reference_videos, dan reference_audios dalam permintaan yang sama.
| Field | Input | Format |
|---|---|---|
reference_videos | URL MP4 HTTPS langsung yang dapat diakses secara publik atau file MP4 yang diunggah | MP4 dengan video H.264; trek audio AAC bersifat opsional |
reference_videos | URI data Base64 lengkap dalam field teks | data:video/mp4;base64,<BASE64_MP4> |
reference_audios | URL MP3 HTTPS langsung yang dapat diakses secara publik atau file MP3 yang diunggah | MP3 |
input_reference.
Jelaskan gerakan, waktu, atau suara yang harus diikuti oleh video yang dihasilkan.
Jaga agar setiap MP4 yang diunggah berukuran 50 MiB atau kurang dan setiap MP3 yang diunggah berukuran 15 MiB atau kurang. Satu MiB adalah 1024 × 1024 byte.
Contoh permintaan di bagian atas halaman ini menampilkan URL MP4, URI data MP4, dan URL MP3 yang dipasangkan dengan gambar.
Unggah video referensi
Unggah file MP4 untuk memandu struktur pengambilan gambar dan gerakan:curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=minimax-h3' \
--form-string 'prompt=Follow the uploaded reference video shot structure and motion. No text.' \
--form-string 'seconds=5' \
--form-string 'size=1344x768' \
--form 'reference_videos=@/path/to/reference.mp4;type=video/mp4'
Unggah audio referensi dengan gambar
Pasangkan URL gambar referensi dengan file MP3 yang diunggah:curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=minimax-h3' \
--form-string 'prompt=Animate the reference image and synchronize the motion with the uploaded reference audio. No text.' \
--form-string 'seconds=5' \
--form-string 'size=1344x768' \
--form-string 'input_reference=https://your-image-host/reference.png' \
--form 'reference_audios=@/path/to/reference.mp3;type=audio/mpeg'
Tetapkan frame pertama dan terakhir
Kirimfirst_frame untuk gambar pembuka dan, secara opsional, satu last_frame untuk gambar penutup.
Setiap field menerima satu URL PNG HTTPS langsung yang dapat diakses secara publik atau satu file PNG yang diunggah. Jaga agar setiap PNG yang diunggah berukuran 20 MiB atau kurang (20 × 1024 × 1024 byte).
Jangan gabungkan field frame dengan field gambar, video, atau audio referensi. Gunakan permintaan terpisah untuk pembuatan berbasis frame.
Dengan input frame, size memilih tingkat resolusi. Layanan dapat menormalkan dimensi output akhir berdasarkan frame yang diberikan.
Tetap kirim size dalam bentuk WxH.
id yang dikembalikan. Poll task hingga status bernilai completed atau
failed. Ketika task selesai, unduh konten video.Atur durasi dan ukuran
Untuk kedua model, tetapkanseconds ke bilangan bulat dari 5 hingga 15. Defaultnya adalah 5 detik.
Pilih resolusi dan rasio aspek dari tabel untuk model Anda, lalu kirim nilai Ukuran permintaan yang sesuai sebagai size dalam format WxH.
Untuk permintaan teks dan media referensi, size memilih tingkat resolusi dan rasio aspek framing.
Layanan dapat menormalkan dimensi output akhir berdasarkan ukuran yang diminta dan media referensi yang disediakan.
Ukuran untuk minimax-h3
Gunakan ukuran permintaan berikut dengan model=minimax-h3:
| Resolusi | Rasio aspek | Ukuran permintaan |
|---|---|---|
768P | 21:9 | 1536x672 |
768P | 16:9 | 1344x768 |
768P | 4:3 | 1024x768 |
768P | 1:1 | 768x768 |
768P | 3:4 | 768x1024 |
768P | 9:16 | 768x1344 |
2K | 21:9 | 2912x1280 |
2K | 16:9 | 2544x1456 |
2K | 4:3 | 1920x1440 |
2K | 1:1 | 1440x1440 |
2K | 3:4 | 1440x1920 |
2K | 9:16 | 1440x2560 |
Ukuran untuk minimax-h3-max
Gunakan ukuran permintaan berikut dengan model=minimax-h3-max:
| Resolusi | Rasio aspek | Ukuran permintaan |
|---|---|---|
480P | 21:9 | 1120x480 |
480P | 16:9 | 864x480 |
480P | 4:3 | 640x480 |
480P | 1:1 | 480x480 |
480P | 3:4 | 480x640 |
480P | 9:16 | 480x864 |
768P | 21:9 | 1792x768 |
768P | 16:9 | 1360x768 |
768P | 4:3 | 1024x768 |
768P | 1:1 | 768x768 |
768P | 3:4 | 768x1024 |
768P | 9:16 | 768x1360 |
Alur tugas
Buat tugas
id yang dikembalikan.Polling tugas
status bernilai completed atau failed.Unduh hasilnya
completed, panggil Mengunduh konten video MiniMax H3 untuk menyimpan file MP4.Body
Requested size in WxH form. For text and reference-media requests, size selects the resolution tier and framing aspect ratio. With first or last frames, size selects the resolution tier. Use the matching model table: minimax-h3 uses 768P or 2K; minimax-h3-max uses 480P or 768P. For example, use 1344x768 for H3 at 768P, 864x480 for H3-Max at 480P, or 1360x768 for H3-Max at 768P. The service can normalize the final output dimensions.
^[1-9][0-9]*x[1-9][0-9]*$"1536x672"
"1344x768"
"1024x768"
"768x768"
"768x1024"
"768x1344"
"2912x1280"
"2544x1456"
"1920x1440"
"1440x1440"
"1440x1920"
"1440x2560"
"1120x480"
"864x480"
"640x480"
"480x480"
"480x640"
"480x864"
"1792x768"
"1360x768"
"768x1360"
PNG or JPEG reference images. Repeat input_reference with one publicly accessible HTTPS image URL or uploaded image file per field. Send up to nine reference images, whether you use URLs or uploaded files. Use all URLs or all files within this field. Do not combine URLs into a comma-separated value. Keep each uploaded image at or below 20 MiB. Do not combine this field with first_frame or last_frame. Across images, videos, and audio, send at most 12 reference inputs. Each reference video or audio clip must be 2–15 seconds; keep the combined video duration and combined audio duration at or below 15 seconds each. Submit images in the order you want to reference them in the prompt.
^https://Reference video inputs. Repeat reference_videos with a direct publicly accessible HTTPS MP4 URL or an uploaded MP4 file. Use only text values or only files within this field. Each uploaded file can be up to 50 MiB. Send no more than three video inputs. A complete data:video/mp4;base64,... URI is also accepted as a text value. Use MP4 with H.264 video; an AAC audio track is optional. Do not combine this field with first_frame or last_frame. Across images, videos, and audio, send at most 12 reference inputs. Each reference video or audio clip must be 2–15 seconds; keep the combined video duration and combined audio duration at or below 15 seconds each.
1 - 3 elements^(https://|data:video/mp4;base64,)"https://your-media-host/reference.mp4"
Reference audio inputs. Repeat reference_audios with a direct publicly accessible HTTPS MP3 URL or an uploaded MP3 file. Use only text values or only files within this field. Each uploaded file can be up to 15 MiB. Send no more than three audio inputs. Pair reference audio with at least one reference image. Do not combine this field with first_frame or last_frame. Across images, videos, and audio, send at most 12 reference inputs. Each reference video or audio clip must be 2–15 seconds; keep the combined video duration and combined audio duration at or below 15 seconds each.
1 - 3 elements^https://"https://your-media-host/reference.mp3"
Opening frame input as one direct publicly accessible HTTPS PNG URL or one uploaded PNG file at or below 20 MiB (20 x 1024 x 1024 bytes). Do not combine frame fields with reference media fields.
^https://"https://your-image-host/first-frame.png"
Optional ending frame input, used with first_frame, as one direct publicly accessible HTTPS PNG URL or one uploaded PNG file at or below 20 MiB (20 x 1024 x 1024 bytes). Do not combine frame fields with reference media fields.
^https://"https://your-image-host/last-frame.png"
Respons
Task created. Store the returned id and use it in retrieve and content requests.
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
--form-string 'model=minimax-h3' \
--form-string 'prompt=A paper boat glides across a still pond, daylight, locked camera, no text.' \
--form-string 'seconds=5' \
--form-string 'size=2544x1456'{
"id": "<task_id>",
"task_id": "<task_id>",
"object": "video",
"model": "minimax-h3",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}