建立 MiniMax H3 影片
透過 CometAPI 使用文字、參考媒體或首尾影格建立 MiniMax H3 或 H3-Max 影片任務
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,以輪詢任務並下載完成的影片。
POST /v1/videos 使用 multipart/form-data。請將控制項作為表單欄位傳送,並針對每個媒體輸入重複傳送一次每個參考欄位。
選擇模型
將model 設為下列其中一個模型 ID。請從相符模型表格中選擇請求尺寸,請參閱 設定時長和尺寸.
| 模型 ID | 解析度等級 |
|---|---|
minimax-h3 | 768P, 2K |
minimax-h3-max | 480P, 768P |
選擇輸入模式
兩個模型都使用以下欄位。將model 設為您所選取的模型 ID。
| 目標 | 必填欄位 | 選填欄位 |
|---|---|---|
| 文字轉影片 | model, prompt | seconds, size |
| 參考圖片 | model, prompt,一或多個 input_reference URL 或檔案 | seconds, size |
| 參考影片 URL、資料 URI 或檔案 | model, prompt,一或多個 reference_videos 欄位 | seconds, size |
| 搭配圖片的參考音訊 | model, prompt, input_reference,一或多個 reference_audios 欄位 | seconds, size |
| 首尾影格 URL | model, prompt, first_frame | last_frame, seconds, size |
| 上傳的首尾影格 | model, prompt, first_frame 檔案 | last_frame 檔案, seconds, size |
使用參考圖片
透過input_reference 以可公開存取的 HTTPS URL 或上傳檔案傳送參考圖片。若要傳送多張圖片,請依圖片順序重複該欄位,每個欄位包含一個 URL 或檔案。
在此欄位中僅使用所有 URL 或所有檔案。請分別傳送每個 URL,不要將 URL 合併為以逗號分隔的值。
無論使用 URL 或上傳檔案,最多可傳送九張 PNG 或 JPEG 參考圖片。每張上傳圖片請維持在 20 MiB 以下。
在 Prompt 中,描述產生的影片應保留的視覺細節。
使用參考影片和音訊
以 multipart 文字值或上傳檔案的方式傳送reference_videos 和 reference_audios,並使用下列格式。
每個欄位中的每項輸入各重複一次,且該欄位只能使用文字值或只能使用檔案。請勿將輸入合併為以逗號分隔的值。
不同欄位可使用不同輸入類型,例如圖片 URL 搭配上傳的音訊檔案。
若要合併圖片、影片和音訊參考資料,請在同一個請求中傳送 input_reference、reference_videos 和 reference_audios。
| 欄位 | 輸入 | 格式 |
|---|---|---|
reference_videos | 可直接存取且公開可用的 HTTPS MP4 URL,或上傳的 MP4 檔案 | 採用 H.264 視訊的 MP4;AAC 音訊軌為選用 |
reference_videos | 文字欄位中的完整 Base64 資料 URI | data:video/mp4;base64,<BASE64_MP4> |
reference_audios | 可直接存取且公開可用的 HTTPS MP3 URL,或上傳的 MP3 檔案 | MP3 |
input_reference 將參考音訊與至少一張圖片配對。
描述產生的影片應遵循的動作、時間安排或聲音。
每個上傳的 MP4 必須不超過 50 MiB,每個上傳的 MP3 必須不超過 15 MiB。一個 MiB 為 1024 × 1024 位元組。
本頁頂端的請求範例顯示了搭配圖片的 MP4 URL、MP4 資料 URI 和 MP3 URL。
上傳參考影片
上傳 MP4 檔案以引導鏡頭結構和動作: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'
上傳搭配圖片的參考音訊
將參考圖片 URL 與上傳的 MP3 檔案配對: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'
設定首尾影格
為開頭圖片傳送first_frame,並可選擇為結尾圖片傳送一個 last_frame。
每個欄位可接受一個可直接存取且公開可用的 HTTPS PNG URL,或一個上傳的 PNG 檔案。每個上傳的 PNG 必須不超過 20 MiB(20 × 1024 × 1024 位元組).
請勿將影格欄位與參考圖片、影片或音訊欄位合併使用。請使用個別請求進行基於影格的產生。
使用影格輸入時,size 會選擇解析度層級。服務可根據提供的影格將最終輸出尺寸標準化。
請繼續以 size 的 WxH 形式傳送。
id。輪詢任務,直到 status 為 completed 或
failed。任務完成後,下載影片內容。設定時長與大小
對於兩種模型,請將seconds 設為介於 5 到 15 之間的整數。預設值為 5 秒。
請從表格中選擇適用於您模型的解析度和長寬比,然後傳送對應的 請求大小 值,並以 size 格式在 WxH 中傳送。
對於文字和參考媒體請求,size 可選擇解析度層級和畫面長寬比。
服務可根據請求的大小和提供的參考媒體,將最終輸出尺寸正規化。
minimax-h3 的大小
搭配 model=minimax-h3 使用以下請求大小:
| 解析度 | 長寬比 | 請求大小 |
|---|---|---|
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 |
minimax-h3-max 的大小
搭配 model=minimax-h3-max 使用以下請求大小:
| 解析度 | 長寬比 | 請求大小 |
|---|---|---|
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 |
任務流程
建立任務
id。輪詢任務
status 為 completed 或 failed。下載結果
completed 時,呼叫 下載 MiniMax H3 影片內容 以儲存 MP4 檔案。主體
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"
回應
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
}