EMO模型可基於人物肖像圖片和人聲音頻,產生人臉動態視頻。
本文檔僅適用於“中國(北京)”地區。如需使用模型,需使用“中國(北京)”地區的API Key
效果樣本
輸入樣本 | 輸出樣本 |
人物肖像:
人聲音頻: | 使用動作風格強度:參數 |
更多效果樣本請參見模型效果樣本。
請確保上傳的圖片、音頻檔案來源符合相關法律法規,且已獲得相應內容的使用許可。
前提條件
輸入映像必須先通過EMO映像檢測API檢測,並獲得對應人臉地區(face_bbox)和動態地區(ext_bbox)的範圍值作為入參。
HTTP調用
步驟1:建立任務擷取任務ID
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/video-synthesis建立任務後,系統將立即返回一個
task_id,用於“步驟2”查詢任務結果。task_id自建立起有效期間為24小時。
請求參數 | |
要求標頭(Headers) | |
X-DashScope-Async 非同步處理配置參數。HTTP請求只支援非同步,必須設定為 重要 缺少此要求標頭將報錯:“current user api does not support synchronous calls”。 | |
Authorization 請求身份認證。介面使用阿里雲百鍊API Key進行身份認證。樣本值:Bearer sk-xxxx。 | |
Content-Type 請求內容類型。此參數必須設定為 | |
請求體(Request Body) | |
model 模型名稱。樣本值:emo-v1。 | |
input 輸入的基本資料。 | |
parameters |
響應參數 | 響應成功樣本響應異常樣本 |
output 任務輸出資訊。 | |
request_id 請求唯一標識。可用於請求明細溯源和問題排查。 | |
code 請求失敗時返回的錯誤碼,詳情請參見狀態代碼說明。 | |
message 請求失敗時返回的詳細錯誤資訊,詳情請參見狀態代碼說明。 |
步驟2:根據任務ID查詢結果
使用上一步擷取的 task_id,輪詢任務狀態和結果。請將 URL 中的{task_id} 替換為您的實際任務ID。
GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}task_id 有效期間:自建立起有效期間24小時,逾時後將無法查詢結果,介面將返回任務狀態為
UNKNOWN。任務狀態流轉:一般正常處理的任務流轉狀態為 PENDING(排隊中)→ RUNNING(處理中)→ SUCCEEDED(成功)/ FAILED(失敗)。
任務結果擷取:視頻產生過程約需數分鐘,查詢介面預設QPS為20。建議採用輪詢機制,並設定合理的查詢間隔(如 15 秒)來擷取結果。
video_url 有效期間:自任務成功時刻起有效期間為 24 小時。建議在擷取連結後立即下載並轉存至永久儲存(如阿里雲 OSS)。
請求參數 | |
要求標頭(Headers) | |
Authorization 請求身份認證。介面使用阿里雲百鍊API Key進行身份認證。樣本值:Bearer sk-xxxx。 | |
URL路徑參數(Path parameters) | |
task_id 需要查詢任務的task_id。樣本值:a8532587-fa8c-4ef8-82be-xxxxxx。 |
響應參數 | 響應成功樣本響應異常樣本 |
request_id 請求唯一標識。可用於請求明細溯源和問題排查。 | |
output 任務輸出資訊。 | |
usage |
計費與限流
模型名稱 | 單價 | 任務下發介面QPS限制 | 同時處理中任務數量 |
emo-v1 | 後付費,按照輸出視頻的實際時間長度計費:
| 5 | 1 (超出任務將排隊) |
狀態代碼說明
大模型服務平台通用狀態代碼請查閱:錯誤資訊。
本模型還有如下特定錯誤碼:
HTTP返回碼 | 錯誤碼(code) | 錯誤資訊(message) | 含義說明 |
400 | InvalidParameter | The request is missing required parameters or in a wrong format, please check the parameters that you send. | 入參格式不對。 |
400 | InvalidParameter | The style_level is invalid. | style_level不在枚舉範圍內。 |
400 | InvalidParameter.DataInspection | Unable to download the media resource during the data inspection process. | 下載圖片或音頻檔案逾時。 如果您從海外發起調用,由於跨境網路不穩定,可能會導致下載資源逾時。您可以將檔案儲存體到國內的 OSS 中,再發起模型調用。您也可以使用臨時儲存空間上傳檔案。 |
400 | InvalidURL | The request URL is invalid, please check the request URL is available and the request image format is one of the following types: JPEG, JPG, PNG, BMP, and WEBP. | 輸入圖片下載失敗,請檢查網路或者輸入格式。支援以下格式:JPEG, JPG, PNG, BMP, and WEBP。 |
400 | InvalidURL | Required URL is missing or invalid, please check the request URL. | 輸入的URL不正確或缺失。 |
400 | InvalidURL | The input audio is longer than 60s! | 輸入的音頻檔案超過最大時間長度60秒。 |
400 | InvalidURL | File size is larger than 15MB. | 輸入的音頻檔案超過最大限制15MB。 |
400 | InvalidURL | File type is not supported. Allowed types are: .wav, .mp3. | 輸入的音頻格式不合規,當前支援wav、mp3。 |
400 | InvalidFile.Content | The input image has no human body. Please upload other image with single person. | 輸入圖片中沒有人。請輸入包含人物的圖片。 |
400 | InvalidFile.Content | The input image has multi human bodies. Please upload other image with single person. | 輸入圖片中有多人。請輸入只包含單個人的圖片。 |
400 | InvalidFile.BodyProportion | The proportion of the detected person in the picture is too large or too small, please upload other image. | 輸入圖片中人物佔比不符合要求。 |
400 | InvalidFile.Resolution | The image resolution is invalid, please make sure that the largest length of image is smaller than 7000, and the smallest length of image is larger than 400. | 映像解析度無效。映像要求最小邊長≥400像素,最大邊長≤7000像素。 |
400 | InvalidFile.Value | The value of the image is invalid, please upload other clearer image. | 輸入圖片過暗不符合要求。請輸入更清晰的圖片。 |
400 | InvalidFile.FrontBody | The pose of the detected person is invalid, please upload other image with the front view. | 上傳圖片中人物背身不符合要求。請上傳人物正面視角的圖片。 |
400 | InvalidFile.FullFace | The pose of the detected face is invalid, please upload other image with whole face. | 上傳圖片中人物面部姿態不符合要求,請輸入面部可見的圖片。 |
400 | InvalidFile.FacePose | The pose of the detected face is invalid, please upload other image with the expected orientation. | 上傳圖片中人物面部姿態不符合要求,請輸入面部朝向無嚴重位移的圖片。 |
