从写代码,到创作下一幕

探索 字节跳动 - 火山方舟 的 AI 编程与视频创作活动。

火山方舟 Agent Plan 与 Coding Plan 活动,价格 ¥9.9 起

Agent Plan & Coding Plan

一站体验多款热门模型,为 AI 编程与智能体开发提供更多选择。新用户可联系(微信: goo_lvyouyou)免费体验 9.9 agent plan。

查看套餐优惠
Seedance 2.5 视频创作活动:30 秒视频、多模态参考、局部编辑

Seedance 2.5

让创意,跃然成片。探索 30 秒视频、多模态参考与局部编辑,把脑海中的画面变成下一支作品。

探索视频创作

模型能力

将文件引用为输入

查看 Markdown

只要 Imagine 端点接受公开 URL 或 Base64 编码的图像/视频,就可以改为传入 file_id(来自你的 Files API 存储)。文件会由服务端从你的私有存储中获取,因此:

  • 无需耗费带宽重复上传同一张图像,这对迭代编辑循环很有帮助。

  • 原始文件会保持私有(作为输入使用时无需将其设为公开)。

  • 既适用于上传的文件,也适用于先前 Imagine 调用生成的资产(通过 storage_options)。

引用的文件必须是端点所要求的正确内容类型(图像:PNG/JPEG/WebP;视频:MP4),并且必须已完整上传。


编辑已存储的图像

curl -s -X POST https://api.x.ai/v1/images/edits \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-image-2.0",
    "prompt": "Add a party hat to the dog",
    "image": { "file_id": "file_7de029f4-eb66-42ee-87f8-b2a9d9e7466a" },
    "response_format": "url"
  }'

使用多张已存储图像进行编辑

# Each images entry independently carries url or file_id — mix kinds within a single request.
curl -s -X POST https://api.x.ai/v1/images/edits \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-image-2.0",
    "prompt": "Blend these two scenes into one cohesive composition",
    "images": [
      { "file_id": "file_7de029f4-eb66-42ee-87f8-b2a9d9e7466a" },
      { "url": "https://example.com/scene-b.jpg" }
    ],
    "response_format": "url"
  }'

使用已存储首帧生成视频

curl -s -X POST https://api.x.ai/v1/videos/generations \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-video-1.5",
    "prompt": "Pan across the scene as the sky darkens",
    "duration": 5,
    "image": { "file_id": "file_7de029f4-eb66-42ee-87f8-b2a9d9e7466a" }
  }'

编辑已存储的视频

curl -s -X POST https://api.x.ai/v1/videos/edits \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-video",
    "prompt": "Add rain and a moody atmosphere",
    "video": { "file_id": "file_5be118c3-da55-31dd-76e7-a1b8c8d6355b" }
  }'

使用多张已存储图像进行参考图转视频

# Each reference_images entry independently carries url or file_id — mix kinds within a single request.
curl -s -X POST https://api.x.ai/v1/videos/generations \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-video-1.5",
    "prompt": "A woman in this dress walks down a city street at night",
    "duration": 5,
    "reference_images": [
      { "file_id": "file_5be118c3-da55-31dd-76e7-a1b8c8d6355b" },
      { "url": "https://example.com/dress.jpg" }
    ]
  }'


最后更新:2026 年 11 月 2 日