Skip to main content
Glama

Gemini Omni 1.1 Flash API — Python 封装

Powered by MuAPI License: MIT Python 3.9+

一个专注于 MuAPI 上的 Google Gemini Omni Flash 的 Python SDK 和 MCP 服务器。它支持文生视频、图生视频、视频编辑、可复用的语音档案、可复用的角色档案,以及异步任务轮询。

Google 于 2026 年 8 月 27 日宣布了 Gemini Omni 1.1 Flash 更新——新增场景扩展(最多 10 秒的分析上下文,累计最长 40 秒)、首/末帧关键帧控制、360p 草稿分辨率模式、4K 超分辨率,以及最多 3 秒的视频参考输入。详情请参阅 muapi.ai/gemini-omni-1.1-flash。该客户端封装了当前 MuAPI 上已上线的 Gemini Omni Flash 端点;上述 1.1 专属控制功能正在逐步推出,尚未被此 SDK 公开——随着 MuAPI 添加这些功能,本 README 和代码将一并更新。

相关项目

Related MCP server: PixVerse MCP

安装

git clone https://github.com/Anil-matcha/Gemini-Omni-1.1-Flash-API.git
cd Gemini-Omni-1.1-Flash-API
pip install -r requirements.txt
cp .env.example .env

.env 中设置 MUAPI_API_KEY。仅当您使用与默认 MuAPI 基础 URL 不同的兼容提供商时,才设置 GEMINI_OMNI_API_BASE_URL

快速开始

from gemini_omni_api import GeminiOmniAPI

api = GeminiOmniAPI()
job = api.text_to_video(
    "A street musician plays a violin on a rainy Paris evening, raindrops tap "
    "the cobblestones, a slow melancholic melody, distant café chatter.",
    duration=8,
    resolution="1080p",
    aspect_ratio="16:9",
)

result = api.wait_for_completion(job["request_id"])
print(result)

图生视频

job = api.image_to_video(
    prompt="The subject slowly turns to face the camera as golden-hour light sweeps across the scene.",
    image_urls=["https://example.com/reference.jpg"],
    aspect_ratio="9:16",
    duration=8,
)

视频编辑

job = api.video_edit(
    prompt="Restyle the entire clip as a hand-drawn Studio Ghibli animation, keep the original camera motion.",
    video_url="https://example.com/source.mp4",
    trim_start=0,
    trim_end=10,
    resolution="1080p",
)

语音与角色档案

voice = api.create_audio_profile("Narrator", preset_voice="warm-male-1", style_description="calm, deliberate pacing")
character = api.create_character_profile("Host", image_url="https://example.com/host.jpg")

job = api.text_to_video(
    "The host welcomes viewers to the show.",
    audio_ids=[voice["audioId"]],
    character_ids=[character["characterId"]],
)

API 接口

方法

用途

text_to_video()

根据文本提示生成带同步音频的视频。

image_to_video()

使用文本提示为 1-7 张参考图片制作动画。

video_edit()

对源剪辑进行风格重设、灯光重调、主体替换或对白重写。

create_audio_profile()

从预设语音创建可复用的语音档案;返回 audioId

create_character_profile()

从参考图片创建可复用的角色档案;返回 characterId

upload_file()

上传本地参考文件。

get_result() / wait_for_completion()

获取异步任务的输出。

text_to_video()image_to_video()video_edit() 接受 duration(4/6/8/10 秒)、resolution720p1080p4k)、aspect_ratio16:99:16)、最多 3 个 audio_ids、最多 3 个 character_ids 以及 seed

MCP 服务器

将 Gemini Omni 工具暴露给支持 MCP 的客户端:

python mcp_server.py

该服务器提供 text_to_videoimage_to_videovideo_editcreate_audio_profilecreate_character_profileget_task_status 工具。

状态:1.1 更新正在逐步推出

Google 于 2026 年 8 月 27 日宣布了 Gemini Omni 1.1 Flash。目前它正在通过 Google AI Studio、Gemini Enterprise Agent Platform、Google Flow 和 Gemini 应用逐步推出。MuAPI 正在为新的 1.1 控制功能(场景扩展、关键帧、360p 草稿模式、4K 超分辨率、视频参考输入)逐步开放 API 访问——本 SDK 目前针对 MuAPI 上可用的 Gemini Omni Flash 端点,并将在 1.1 端点上线后随之更新。

端点兼容性

该客户端使用 GEMINI_OMNI_API_BASE_URL 下的 gemini-omni-text-to-videogemini-omni-image-to-videogemini-omni-video-editgemini-omni-audiogemini-omni-character 路径。如果您的提供商对端点使用了不同的命名,请传入该提供商兼容的基础 URL,或在使用前调整这个小客户端模块。

许可证

MIT

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

0Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

View all related MCP servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Anil-matcha/Gemini-Omni-1.1-Flash-API'

If you have feedback or need assistance with the MCP directory API, please join our Discord server