
AI 媒體創作工具
在整合式工作區中建立 AI 圖片和影片
在 Flaq AI 上使用 Sand AI 的 Magi 2 API,讓靜態圖片動起來。描述鏡頭應如何運動,也可加入結束影格來引導畫面過渡。首個影格必填、結束影格可選,支援4–30秒。
// Step 1: Submit generation request
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
model_name: 'magi-2-image-to-video',
prompt: 'The camera slowly pulls back to reveal a waterfall and the forest around it',
duration: 8,
aspect_ratio: '16:9',
sound: false,
image_url: 'https://example.com/first-frame.jpg',
image_end_url: 'https://example.com/last-frame.jpg'
})
});
const { data } = await response.json();
const taskId = data.task_id;
// Step 2: Poll for results
const taskId = data.task_id;
const pollResult = async (taskId) => {
const res = await fetch(`https://api.flaq.ai/api/v1/video/${taskId}`, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
return res.json();
};
while (true) {
const pollResultData = await pollResult(taskId);
const status = pollResultData.data.task_status;
if (status === 'succeed') {
console.log(pollResultData.data.task_result.videos[0].url);
break;
}
if (status === 'failed') {
console.error(pollResultData.data.task_status_msg);
break;
}
await new Promise(resolve => setTimeout(resolve, 10000));
}
# Step 1: Submit generation request
import requests
response = requests.post(
'https://api.flaq.ai/api/v1/video/task',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
json={
'model_name': 'magi-2-image-to-video',
'prompt': 'The camera slowly pulls back to reveal a waterfall and the forest around it',
'duration': 8,
'aspect_ratio': '16:9',
'sound': False,
'image_url': 'https://example.com/first-frame.jpg',
'image_end_url': 'https://example.com/last-frame.jpg'
}
)
result = response.json()
task_id = result['data']['task_id']
# Step 2: Poll for results
task_id = response.json()['data']['task_id']
poll_url = f"https://api.flaq.ai/api/v1/video/{task_id}"
while True:
poll_result = requests.get(poll_url, headers={'Authorization': 'Bearer YOUR_API_KEY'}).json()
status = poll_result['data']['task_status']
if status == 'succeed':
print(poll_result['data']['task_result']['videos'][0]['url'])
break
if status == 'failed':
print(poll_result['data']['task_status_msg'])
break
time.sleep(10)
# Step 1: Submit generation request
curl -X POST https://api.flaq.ai/api/v1/video/task \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model_name": "magi-2-image-to-video",
"prompt": "The camera slowly pulls back to reveal a waterfall and the forest around it",
"duration": 8,
"aspect_ratio": "16:9",
"sound": false,
"image_url": "https://example.com/first-frame.jpg",
"image_end_url": "https://example.com/last-frame.jpg"
}'
# Step 2: Poll for results
# Replace {task_id} with the task_id returned from the submit response
curl -X GET "https://api.flaq.ai/api/v1/video/{task_id}" \
-H "Authorization: Bearer YOUR_API_KEY"
| 參數 | 價格 | 原價 | 折扣 |
|---|
在 Flaq AI 上,Sand AI Magi 2 圖片生成影片 API 可將指定的起始圖片轉成動作連貫、聲畫同步的影片片段。使用自然語言提示詞描述鏡頭如何發展,視需要加入結束圖片以引導收尾構圖,再選擇輸出片長和畫面比例。適用於產品展示、角色動作設計、行銷素材轉場和自動化視覺內容製作流程。
注意 每次請求都必須提供起始圖片並明確指定輸出時長。若提供結束影格,也須一併提供起始影格。兩張圖片均須透過可公開存取的 HTTPS 網址提供。費用依請求指定的片長按秒計算,所有圖片及提示詞皆須符合 Sand AI 的內容安全規範。
Magi 2 圖片生成影片與 Magi 2 文字生成影片
文字生成影片完全依據文字描述生成畫面。圖片生成影片以必填的起始圖片決定開場構圖,也可用結束影格引導收尾畫面。
Magi 2 圖片生成影片與 Magi 2 參考生成影片
圖片生成影片著重以必填的起始影格和選填的結束影格製作動畫。參考生成影片可選用多張圖片、影片片段及音軌,透過更多類型的素材引導生成。
Magi 2 圖片生成影片與 Seedance 2.5 圖片生成影片
Seedance 2.5 圖片生成影片可選擇輸出解析度,畫面比例由起始影格決定。Magi 2 圖片生成影片提供多種畫面比例,支援首尾影格引導,也可選用同步聲音。
Magi 2 圖片生成影片與 Kling 4.0 圖片生成影片
Kling 4.0 圖片生成影片可選擇 720p 或 1080p 輸出解析度,支援依序提供中間影格,也可指定結束影格。Flaq AI 上的 Magi 2 圖片生成影片著重以起始影格和選填的結束影格製作動畫,可選擇畫面比例,並可視需要生成原生同步音訊。
Magi 2 Image to Video 在 Flaq AI 上的即時參數、支援的輸入和能力。
影片、圖片、LLM、語音和 3D 模型共用一個點數餘額。購買的點數永不過期。如果任務因系統錯誤失敗,餘額不會被扣除。
在 Flaq AI 上使用 Sand AI 的 Magi 2 API,讓靜態圖片動起來。描述鏡頭應如何運動,也可加入結束影格來引導畫面過渡。首個影格必填、結束影格可選,支援4–30秒。
支援的任務:圖片轉影片。可用的輸入和設定包括 時長, 長寬比, 起始幀, 結束幀。請查看規格,了解其支援的值。
計費方式:每秒。上方價格表列出了費率及決定適用費率的設定。
如果任務因系統錯誤失敗,餘額不會被扣除。
請在請求中使用 magi-2-image-to-video 作為模型 ID。驗證和請求詳情請參閱 API 文件。
其他模型包括 Magi 2 Text to Video, Magi 2 Reference to Video。可在各模型頁面比較其支援的輸入、輸出設定和價格。
購買的點數不會過期。生成結果的商業使用須遵守 Flaq AI 服務條款及相應模型供應商的條款。
在瀏覽器中探索多種 AI 創作工具,快速完成圖片與影片工作流程,然後透過 Flaq AI 的生產級模型 API 擴展成功想法。Flaq AI 為所有模型提供統一 API 層,讓你的工作流程更容易使用和擴展。