进阶 docs.leonardo.ai 2026-11-22 15:11:20 · 0 阅读

第40章 Gemini Omni 1.1 Flash 视频生成指南

Gemini Omni 1.1 Flash 本指南介绍如何通过 Leonardo.AI REST API 使用 Gemini Omni 1.1 Flash 模型生成视频。

请求示例

curl --request POST \ --url https://cloud.leonardo.ai/api/rest/v2/generations \ --header 'accept: application/json' \ --header 'authorization: Bearer ' \ --header 'content-type: application/json' \ --data ' { "model": "google/gemini-omni-1.1-flash-preview", "public": false, "parameters": { "prompt": "The koala plays with the cat", "guidances": { "start_frame": [ { "image": { "id": "", "type": "UPLOADED" } } ], "end_frame": [ { "image": { "id": "", "type": "UPLOADED" } } ] }, "duration": 5, "quantity": 1, "motion_has_audio": true, "width": 1280, "height": 720 } } '

API 请求端点、Headers、参数

端点 https://cloud.leonardo.ai/api/rest/v2/generations

Headers --header "accept: application/json" \ --header "authorization: Bearer " \ --header "content-type: application/json"

Body 参数

参数 | 类型 | 说明 duration | number | 生成视频的时长(秒)。可设为 3、4、5、6、7、8、9 或 10,默认 5。 guidances.end_frame | array | 最多 1 项。每项包含 image.id 和 image.type(UPLOADED、GENERATED、VARIATION、URL 或 BASE64)。设置生成视频的结尾帧。 guidances.image_reference | array | 最多 10 项。引用图片来引导视频生成。每项包含 image.id 和 image.type(UPLOADED、GENERATED、VARIATION、URL 或 BASE64)。可选的 order 字段用于设置引导顺序。 guidances.start_frame | array | 最多 1 项。每项包含 image.id 和 image.type(UPLOADED、GENERATED、VARIATION、URL 或 BASE64)。设置生成视频的起始帧。 guidances.video_reference_base | array | 最多 3 项。待编辑的基础视频。每项包含 video.id、video.type(UPLOADED 或 GENERATED)和 video.duration,时长不得超过 10 秒。 height | number | 设置输出视频的高度(像素)。 model | string | 指定生成所用模型,设为 google/gemini-omni-1.1-flash-preview。 motion_has_audio | boolean | 控制生成的视频是否包含音频,默认 true。 prompt | string | 生成视频内容的文字描述,最长 2500 字符。 public | boolean | 控制生成的视频是公开(true)还是私有(false)。 quantity | number | 生成输出的数量,设为 1,默认 1。 width | number | 设置输出视频的宽度(像素)。

分辨率

API 支持以下宽高比组合的 width 和 height 参数:

分辨率 | 宽高比 | 像素值(宽 x 高) 360p | 16:9(横屏) | 640x360 360p | 9:16(竖屏) | 360x640 720p | 16:9(横屏) | 1280x720 720p | 9:16(竖屏) | 720x1280 1080p | 16:9(横屏) | 1920x1080 1080p | 9:16(竖屏) | 1080x1920 4K | 16:9(横屏) | 3840x2160 4K | 9:16(竖屏) | 2160x3840

width 和 height 必须成对设置为上表中的某个组合,或一起省略。

更新于 3 个月前。这个页面对你有帮助吗?

评论 (0)