مرجع API
من الصورة إلى الفيديو
أنشئ فيديوهات من الصور ووسائط المرجع باستخدام Seedance 2.0 Open API.
في هذا الوضع، تقوم بتمرير رابط وسيط عام واحد أو أكثر عبر mediaUrls.
Endpoint
POST /api/open/v1/video/generationsأنواع المراجع المدعومة
| Type | Common formats | Typical usage |
|---|---|---|
| صورة | .jpg, .jpeg, .png, .webp, .gif, .bmp | الإطار الأول، والإطار الأخير، ومرجع الأسلوب |
| فيديو | .mp4, .mov, .m4v | مرجع الحركة والكاميرا |
| صوت | .mp3, .wav | مرجع الإيقاع أو التوقيت |
مثال على الطلب
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations \
--header 'Authorization: Bearer sd2_live_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2.0",
"prompt": "A young woman blows out birthday candles, warm indoor lighting, shallow depth of field",
"mediaUrls": [
"https://example.com/photo.jpg"
],
"aspectRatio": "16:9",
"duration": 5,
"resolution": "720p"
}'استجابة ناجحة
{
"success": true,
"requestId": "req_1234567890",
"status": "queued",
"creditsCharged": 64
}حقول الطلب
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | إحدى القيم التالية: seedance-2.0, seedance-2.0-fast, seedance-1.5-pro. |
prompt | string | Yes | وصف بلغة طبيعية يشرح الفيديو المطلوب. |
mediaUrls | string[] | Yes | من رابط إلى خمسة روابط عامة لوسائط مرجعية. |
aspectRatio | string | No | إحدى القيم: 16:9, 9:16, 1:1. |
duration | integer | No | يدعم seedance-2.0 و seedance-2.0-fast من 4 إلى 15 ثانية؛ بينما يدعم seedance-1.5-pro 5 أو 10 ثوانٍ. |
resolution | string | No | إحدى القيم: 480p, 720p, 1080p. |
webhookUrl | string | No | عنوان callback الذي يستقبل النتيجة النهائية. |
metadata | object | No | بيانات تعريف مخصصة يتم حفظها مع الطلب. |
التحقق من النتيجة
curl https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890 \
--header 'Authorization: Bearer sd2_live_your_api_key'{
"success": true,
"requestId": "req_1234567890",
"status": "succeeded",
"model": "seedance-2.0",
"prompt": "A river flowing through an autumn forest, aerial view, cinematic motion",
"duration": 5,
"aspectRatio": "16:9",
"output": {
"type": "video",
"url": "https://pub-your-bucket.r2.dev/open-api-results/req_1234567890.mp4"
},
"error": null
}إلغاء المهمة
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890/cancel \
--header 'Authorization: Bearer sd2_live_your_api_key'{
"success": true,
"requestId": "req_1234567890",
"status": "cancelled"
}ملاحظات
- يدعم
mediaUrlsحتى5عناصر. - استخدم روابط HTTPS عامة يمكن الوصول إليها.
- إذا لم تكن بحاجة إلى وسائط مرجعية، فاستخدم من النص إلى الفيديو.