dreamina-seedance-2-0-mini-260615を使用してください。バージョンの接尾辞もIDの一部です。
全フィールドの定義:Dreamina API。
モデルのパラメータと制限
| 設定 | 値 |
|---|---|
model | dreamina-seedance-2-0-mini-260615 |
| 入力モード | テキスト、最初のフレームの画像、最初と最後のフレームの画像、またはマルチモーダル参照。 |
metadata.content | 必須の入力配列。テキストのみを入力として生成する場合はテキスト項目を含め、promptと整合する内容にしてください。 |
metadata.duration | 4~15 / -1秒。-1を指定すると長さを自動的に選択します。 |
metadata.resolution | 480p、720p。デフォルトは720p。 |
metadata.ratio | 21:9, 16:9, 4:3, 1:1, 3:4, 9:16, adaptive |
| 音声 | metadata.generate_audioのデフォルトはtrue。falseにすると無音の動画を生成します。 |
| 形式 | mp4 |
| フレームレート | 24 fps |
model、prompt、assetはルートに配置し、プロバイダーのフィールドはすべてmetadata内に配置します。メディア入力の例ではasset=trueを設定してください。- フレームのロールと
reference_*のロールは別の入力モードです。組み合わせないでください。 - ratioのデフォルトはadaptiveです。対応する具体的な比率も選択できます。
- マルチモーダル参照では、画像を最大9枚、動画を最大3本、音声クリップを最大3つ使用できます。音声参照には、同じリクエスト内に画像または動画の参照が必要です。
例
呼び出し前にMIXROUTE_API_KEYを設定し、画像・動画・音声のプレースホルダーを、アクセス可能なソースメディアに置き換えてください。
テキストから動画を生成
curl --request POST "https://api.mixroute.ai/v1/video/generations" \
--header "Authorization: Bearer $MIXROUTE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "dreamina-seedance-2-0-mini-260615",
"prompt": "A ceramic mug slowly rotates on a white tabletop in soft daylight.",
"asset": false,
"metadata": {
"content": [
{
"type": "text",
"text": "A ceramic mug slowly rotates on a white tabletop in soft daylight."
}
],
"duration": 4,
"resolution": "480p",
"ratio": "1:1",
"generate_audio": false,
"watermark": false
}
}'
Python
import json
import os
import requests
payload = json.loads(r'''
{
"model": "dreamina-seedance-2-0-mini-260615",
"prompt": "A ceramic mug slowly rotates on a white tabletop in soft daylight.",
"asset": false,
"metadata": {
"content": [
{
"type": "text",
"text": "A ceramic mug slowly rotates on a white tabletop in soft daylight."
}
],
"duration": 4,
"resolution": "480p",
"ratio": "1:1",
"generate_audio": false,
"watermark": false
}
}
''')
response = requests.post(
"https://api.mixroute.ai/v1/video/generations",
headers={"Authorization": "Bearer " + os.environ["MIXROUTE_API_KEY"]},
json=payload,
timeout=60,
)
response.raise_for_status()
result = response.json()
if result.get("code") not in (None, 0, 200, "0", "200", "success"):
raise RuntimeError(result.get("message") or result)
print(result)
最初のフレーム画像
curl --request POST "https://api.mixroute.ai/v1/video/generations" \
--header "Authorization: Bearer $MIXROUTE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "dreamina-seedance-2-0-mini-260615",
"prompt": "A ceramic mug slowly rotates on a white tabletop in soft daylight.",
"asset": true,
"metadata": {
"content": [
{
"type": "text",
"text": "A ceramic mug slowly rotates on a white tabletop in soft daylight."
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/first-frame.png"
},
"role": "first_frame"
}
],
"duration": 4,
"resolution": "480p",
"ratio": "adaptive",
"generate_audio": false,
"watermark": false
}
}'
動画の参照
curl --request POST "https://api.mixroute.ai/v1/video/generations" \
--header "Authorization: Bearer $MIXROUTE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "dreamina-seedance-2-0-mini-260615",
"prompt": "A ceramic mug slowly rotates on a white tabletop in soft daylight.",
"asset": true,
"metadata": {
"content": [
{
"type": "text",
"text": "A ceramic mug slowly rotates on a white tabletop in soft daylight."
},
{
"type": "video_url",
"video_url": {
"url": "https://example.com/reference.mp4"
},
"role": "reference_video"
}
],
"duration": 4,
"resolution": "480p",
"ratio": "1:1",
"generate_audio": false,
"watermark": false
}
}'
画像と音声の参照
curl --request POST "https://api.mixroute.ai/v1/video/generations" \
--header "Authorization: Bearer $MIXROUTE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "dreamina-seedance-2-0-mini-260615",
"prompt": "A ceramic mug slowly rotates on a white tabletop in soft daylight.",
"asset": true,
"metadata": {
"content": [
{
"type": "text",
"text": "A ceramic mug slowly rotates on a white tabletop in soft daylight."
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/reference.png"
},
"role": "reference_image"
},
{
"type": "audio_url",
"audio_url": {
"url": "https://example.com/reference.mp3"
},
"role": "reference_audio"
}
],
"duration": 4,
"resolution": "480p",
"ratio": "1:1",
"generate_audio": true,
"watermark": false
}
}'