
Text to Image
Create AI images from text prompts
Use Google's Gemini Omni 1.2 Flash API on Flaq AI to edit source footage with a prompt while keeping the original clip's duration and framing in the output.
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-video-edit',
prompt: 'A small ball rolls into the scene and captures the attention of the cat',
video_url: 'https://example.com/source-video.mp4',
resolution: '1080p'
})
});
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));
}
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-video-edit',
'prompt': 'A small ball rolls into the scene and captures the attention of the cat',
'video_url': 'https://example.com/source-video.mp4',
'resolution': '1080p'
}
)
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)
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-video-edit",
"prompt": "A small ball rolls into the scene and captures the attention of the cat",
"video_url": "https://example.com/source-video.mp4",
"resolution": "1080p"
}'
# 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"
| Parameters | Price | Original Price | Discount |
|---|
Gemini Omni 1.2 Flash Video Edit API uses an existing video and a text instruction to generate an edited version on Flaq AI. Use written direction to explore changes to an existing scene. This workflow gives developers a way to add instruction-based video revisions to creative applications and review processes.
Prompt-Guided Video Revision: Apply written edit instructions to existing footage to create a revised version of the scene.
Scene Appearance Changes: Request changes to a background, lighting, or weather through natural-language instructions.
Edits within the Source Format: Revise visual content while retaining the source clip's duration and aspect ratio.
Input: Provide a short source video and a prompt specifying the edit. Keep the clip within the supported input duration range, including the provider's minimum-length guidance; consult the API documentation for current limits.
Edit Direction: State the desired change and identify details that should remain, so the instruction communicates the intended scope of the revision.
Output Settings: Select the output resolution. Duration and aspect ratio are determined by the source video and cannot be set independently.
Output: Retrieve the edited video when the processing task finishes.
Billing: Usage is billed at the selected output resolution by source-video duration, rounded to the nearest whole second with a minimum billable duration of 3 seconds.
Short-Clip Revision Workflows: Add prompt-based revision requests to an internal video review tool.
Campaign Background Variations: Request a different setting for an existing campaign scene and review the result against the creative brief.
Product Scene Lighting Exploration: Request a lighting change in a short product scene and compare the generated result with the source.
Creative Brief Evaluation: Test whether a proposed change communicates the desired idea before planning further editing work.
Note Prepare the source clip with the timing and proportions needed for the result. Billing rounds the source duration for charging purposes; this does not set or extend the actual output duration. Review the edited result to check that it matches the requested change.
Compared with Text-to-Video: Video Edit requires existing footage. Text-to-Video generates a new clip from a written scene description and lets the caller choose its duration and orientation.
Compared with Image-to-Video: Image-to-Video animates a starting image and can use an optional ending image. Video Edit instead takes a complete source clip as the material to revise.
Compared with Reference-to-Video: Reference-to-Video uses images or short video references to guide a new generation. Video Edit uses the supplied clip as the editing input, and that clip determines output timing and proportions.
Explore several AI creation tools for quick image and video workflows in your browser, then scale successful ideas with Flaq AI's production-ready model APIs. Flaq AI provides a unified API layer for all models, making it easy to use and scale your workflows.

Create AI images from text prompts

Create AI images from images and text prompts

Create AI videos from text prompts

Animate images into AI videos

Create AI images and videos in one unified workspace

Create consistent videos from reference media

Build visual AI image and video workflows on an infinite canvas