Create an API key once to pre-fill a runnable submit + poll script.
#!/bin/bash
# Usage: chmod +x seedance2-5-flash-edit-kinovi.sh && ./seedance2-5-flash-edit-kinovi.sh
KINOVI_API_KEY="${KINOVI_API_KEY:?Set your API key: export KINOVI_API_KEY=your-api-key}"
# Submit task
RESPONSE=$(curl -s -X POST "https://kinovi.ai/api/v1/jobs/createTask" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $KINOVI_API_KEY" \
-d '{
"model": "seedance2-5-flash-edit",
"inputs": {
"prompt": "Transform the basic two-person martial arts footage in @Video 1 into a tense, unarmed exchange of probing moves before a melee-weapon duel.\n\nReplace the setting with a medieval stone castle terrace, a level ancient courtyard, an outdoor platform at a mountain fortress, or a simple stone-paved dueling arena. Use @Image 1 as the environment reference, with castle walls, wind, mist, distant mountain ridgelines, and flat stone ground.\n\nReplace the outfit of the man wearing dark clothing with the outfit in @Image 2, and replace the man wearing light clothing with the character in @Image 3. Keep the original movements unchanged and preserve the original timing and rhythm.\n\nUse AI effects only to enhance the environment and texture: wind-blown garments, light mist, small puffs of dust at points of contact, cool metallic reflections, subtle film grain, and epic cinematic color grading. Keep the overall atmosphere restrained, realistic, classical, and gritty. Synchronize the background music beats with the action.",
"videoUrls": [
"https://static.seedance2-pro.com/materials/20261116/1794820095991-7d1b14f6.mp4"
],
"imageUrls": [
"https://static.seedance2-pro.com/materials/20261116/1794820100524-606d0478.png",
"https://static.seedance2-pro.com/materials/20261116/1794820102797-cfb69702.png",
"https://static.seedance2-pro.com/materials/20261116/1794820104953-9f6cb5c5.png"
],
"outputResolution": "480p"
}
}')
TASK_ID=$(echo "$RESPONSE" | grep -o '"taskId":"[^"]*"' | cut -d'"' -f4)
echo "Task created: $TASK_ID"
# Poll until complete
while true; do
RESULT=$(curl -s "https://kinovi.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $KINOVI_API_KEY")
STATUS=$(echo "$RESULT" | grep -o '"status":"[^"]*"' | head -1 | cut -d'"' -f4)
case "$STATUS" in
success) echo "Done!" && echo "$RESULT" | python3 -m json.tool 2>/dev/null || echo "$RESULT"; break ;;
fail) echo "Failed: $RESULT"; exit 1 ;;
*) echo "Status: $STATUS — waiting..." && sleep 2 ;;
esac
done
// seedance2-5-flash-edit-kinovi.mjs — Usage: node seedance2-5-flash-edit-kinovi.mjs
const API_KEY = process.env.KINOVI_API_KEY ?? "your-api-key";
// 1. Submit task
const { taskId } = await fetch("https://kinovi.ai/api/v1/jobs/createTask", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: `Bearer ${API_KEY}` },
body: JSON.stringify({
"model": "seedance2-5-flash-edit",
"inputs": {
"prompt": "Transform the basic two-person martial arts footage in @Video 1 into a tense, unarmed exchange of probing moves before a melee-weapon duel.\n\nReplace the setting with a medieval stone castle terrace, a level ancient courtyard, an outdoor platform at a mountain fortress, or a simple stone-paved dueling arena. Use @Image 1 as the environment reference, with castle walls, wind, mist, distant mountain ridgelines, and flat stone ground.\n\nReplace the outfit of the man wearing dark clothing with the outfit in @Image 2, and replace the man wearing light clothing with the character in @Image 3. Keep the original movements unchanged and preserve the original timing and rhythm.\n\nUse AI effects only to enhance the environment and texture: wind-blown garments, light mist, small puffs of dust at points of contact, cool metallic reflections, subtle film grain, and epic cinematic color grading. Keep the overall atmosphere restrained, realistic, classical, and gritty. Synchronize the background music beats with the action.",
"videoUrls": [
"https://static.seedance2-pro.com/materials/20261116/1794820095991-7d1b14f6.mp4"
],
"imageUrls": [
"https://static.seedance2-pro.com/materials/20261116/1794820100524-606d0478.png",
"https://static.seedance2-pro.com/materials/20261116/1794820102797-cfb69702.png",
"https://static.seedance2-pro.com/materials/20261116/1794820104953-9f6cb5c5.png"
],
"outputResolution": "480p"
}
}),
}).then((r) => r.json());
console.log("Task created:", taskId);
// 2. Poll until complete
while (true) {
const data = await fetch(
`https://kinovi.ai/api/v1/jobs/recordInfo?taskId=${taskId}`,
{ headers: { Authorization: `Bearer ${API_KEY}` } },
).then((r) => r.json());
if (data.status === "success") {
console.log("Done!", JSON.stringify(data.output, null, 2));
break;
}
if (data.status === "fail") {
console.error("Failed:", data.error);
process.exit(1);
}
process.stdout.write(`Status: ${data.status} — waiting...\r`);
await new Promise((r) => setTimeout(r, 2000));
}
# seedance2-5-flash-edit-kinovi.py — Usage: python seedance2-5-flash-edit-kinovi.py
import os
import time
import requests
API_KEY = os.environ.get("KINOVI_API_KEY", "your-api-key")
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1. Submit task
task_id = requests.post(
"https://kinovi.ai/api/v1/jobs/createTask",
headers=HEADERS,
json={
"model": "seedance2-5-flash-edit",
"inputs": {
"prompt": "Transform the basic two-person martial arts footage in @Video 1 into a tense, unarmed exchange of probing moves before a melee-weapon duel.\n\nReplace the setting with a medieval stone castle terrace, a level ancient courtyard, an outdoor platform at a mountain fortress, or a simple stone-paved dueling arena. Use @Image 1 as the environment reference, with castle walls, wind, mist, distant mountain ridgelines, and flat stone ground.\n\nReplace the outfit of the man wearing dark clothing with the outfit in @Image 2, and replace the man wearing light clothing with the character in @Image 3. Keep the original movements unchanged and preserve the original timing and rhythm.\n\nUse AI effects only to enhance the environment and texture: wind-blown garments, light mist, small puffs of dust at points of contact, cool metallic reflections, subtle film grain, and epic cinematic color grading. Keep the overall atmosphere restrained, realistic, classical, and gritty. Synchronize the background music beats with the action.",
"videoUrls": [
"https://static.seedance2-pro.com/materials/20261116/1794820095991-7d1b14f6.mp4"
],
"imageUrls": [
"https://static.seedance2-pro.com/materials/20261116/1794820100524-606d0478.png",
"https://static.seedance2-pro.com/materials/20261116/1794820102797-cfb69702.png",
"https://static.seedance2-pro.com/materials/20261116/1794820104953-9f6cb5c5.png"
],
"outputResolution": "480p"
}
},
).json()["taskId"]
print(f"Task created: {task_id}")
# 2. Poll until complete
while True:
data = requests.get(
"https://kinovi.ai/api/v1/jobs/recordInfo",
params={"taskId": task_id},
headers=HEADERS,
).json()
if data["status"] == "success":
print("Done!", data["output"])
break
if data["status"] == "fail":
raise SystemExit(f"Failed: {data['error']}")
print(f"Status: {data['status']} — waiting...", end="\r")
time.sleep(2)