
文字生成圖像
根據文字提示詞建立 AI 圖像
使用 Google Gemini Omni 1.2 Flash API,以照片、短片或兩者作為參考生成影片。為想要製作的場景選擇畫幅與長度。須至少提供一項參考素材,輸出可設為 3–15 秒,長度不受參考片段限制。
在 Best Image AI 上,Gemini Omni 1.2 Flash 參考素材生成影片 API 可依據提示詞與提供的視覺參考素材產生新影片。 你可以在文字說明中附上圖片、短片,或同時使用兩者。如果專案中已有可供新場景參考的視覺素材, 就能用這種方式產生影片,並分別選擇輸出片長、解析度與畫面方向。
參考畫面外觀: 透過角色、產品或風格參考圖,引導新場景的視覺呈現。
參考動作: 除了以文字描述場景,也能透過短片展示想呈現的動作。
結合圖片與影片參考: 在同一份創作說明中納入靜態圖片與動作範例, 共同引導新影片的生成。
依提示詞生成: 描述想呈現的場景,並說明提供的素材與該場景有何關聯。
輸入: 提供提示詞,以及至少一張參考圖片或一段參考影片。可單獨使用其中一種素材, 也可以在同一個請求中搭配使用。
準備參考素材: 圖片與影片的數量須分別符合各自的限制,參考影片請使用短片。 請查閱 API 文件,確認目前的素材數量與參考片長限制。
輸出設定: 選擇橫向或直向構圖、解析度,以及支援範圍內的生成片長。 輸出片長不取決於參考短片的長度。
輸出: 處理完成後,即可取得新產生的影片。
計費: 依所選解析度及請求的輸出片長按秒計費。 參考影片不另行收費。
製作提案樣片: 將場景說明與選定的圖片或短片搭配使用, 製作影片概念樣片供團隊檢視。
再利用行銷素材: 將既有行銷活動的圖片納入創作說明,用來產生新的影片場景。
參考圖板工作流程: 讓創意團隊從素材庫挑選參考素材, 並與生成提示詞一併提交。
探索動態畫面構想: 將參考短片與文字說明搭配使用,嘗試新的鏡頭序列, 無須修改參考短片本身。
注意 必須提供參考素材。請在提示詞中說明每項素材的用途,區分期望生成的內容與提供的範例。 請分別確認參考影片的片長與請求的生成片長。
與文字生成影片相比: 參考素材生成影片除了提示詞,還需要視覺素材。 若創作說明無須搭配圖片或短片,可使用文字生成影片。
與圖片生成影片相比: 圖片生成影片會使用一張圖片作為起始影格,也可另外指定一張圖片作為結束影格。 參考素材生成影片則使用圖片與短片作為新場景的參考。
與影片編輯相比: 影片編輯會修改原始影片,輸出片長與畫面比例都取決於原始影片。 使用參考素材生成影片時,呼叫端可自行選擇新短片的長度與畫面方向, 兩者皆不受參考影片限制。
在瀏覽器中探索多種 AI 創作工具,快速完成圖像和影片工作流程,再透過 Best Image AI 可用於正式環境的模型 API 擴展成功創意。Best Image AI 為所有模型提供統一 API 層,讓工作流程的使用和擴展更輕鬆。
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: 'gemini-omni-1.2-flash-reference-to-video',
prompt: 'Use the references to create a cinematic shot of a small boat approaching from the distance',
aspect_ratio: '16:9',
resolution: '1080p',
duration: 12,
images: ['https://example.com/boat-reference.jpg'],
videos: ['https://example.com/motion-reference.mp4']
})
});
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[].);
;
}
(status === ) {
.(pollResultData..);
;
}
( (resolve, ));
}
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': 'gemini-omni-1.2-flash-reference-to-video',
'prompt': 'Use the references to create a cinematic shot of a small boat approaching from the distance',
'aspect_ratio': '16:9',
'resolution': '1080p',
'duration': 12,
'images': ['https://example.com/boat-reference.jpg'],
'videos': ['https://example.com/motion-reference.mp4']
}
)
result = response.json()
task_id = result['data']['task_id']
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": "gemini-omni-1.2-flash-reference-to-video",
"prompt": "Use the references to create a cinematic shot of a small boat approaching from the distance",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 12,
"images": ["https://example.com/boat-reference.jpg"],
"videos": ["https://example.com/motion-reference.mp4"]
}'
# 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"
# 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)