{"id":35140915,"url":"https://github.com/piexian/astrbot_plugin_gemini_image_generation","last_synced_at":"2026-04-26T12:01:19.447Z","repository":{"id":325696088,"uuid":"1101996564","full_name":"piexian/astrbot_plugin_gemini_image_generation","owner":"piexian","description":"图像生成插件，支持生图和改图，可以自动获取头像作为参考等。","archived":false,"fork":false,"pushed_at":"2026-04-26T03:30:29.000Z","size":15144,"stargazers_count":39,"open_issues_count":2,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-26T04:25:27.907Z","etag":null,"topics":["astrbot-plugin","doubao","gemimi","grok","image-generation","openai","xai-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piexian.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-22T16:18:51.000Z","updated_at":"2026-04-26T02:01:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/piexian/astrbot_plugin_gemini_image_generation","commit_stats":null,"previous_names":["piexian/astrbot_plugin_gemini_image_generation"],"tags_count":29,"template":false,"template_full_name":"Soulter/helloworld","purl":"pkg:github/piexian/astrbot_plugin_gemini_image_generation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piexian%2Fastrbot_plugin_gemini_image_generation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piexian%2Fastrbot_plugin_gemini_image_generation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piexian%2Fastrbot_plugin_gemini_image_generation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piexian%2Fastrbot_plugin_gemini_image_generation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piexian","download_url":"https://codeload.github.com/piexian/astrbot_plugin_gemini_image_generation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piexian%2Fastrbot_plugin_gemini_image_generation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32296259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astrbot-plugin","doubao","gemimi","grok","image-generation","openai","xai-api"],"created_at":"2025-12-28T11:16:40.257Z","updated_at":"2026-04-26T12:01:19.436Z","avatar_url":"https://github.com/piexian.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AstrBot Gemini 图像生成插件\n\n\u003cdiv align=\"center\"\u003e\n\n![Version](https://img.shields.io/badge/Version-v1.9.14-blue)\n![License](https://img.shields.io/badge/License-AGPL--3.0-orange)\n\n**强大的 AstrBot 图像生成插件，支持生图、改图、头像参考、表情包切分和 LLM 工具调用。**\n\n\u003c/div\u003e\n\n\u003e **升级提示**：v1.9.0 以后的配置文件格式不兼容 v1.8.x 及更早版本。升级后如遇配置模板显示错误，请查看 [配置迁移说明](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/docs/troubleshooting.md#配置迁移说明)。\n\n## 功能概览\n\n- **多模式图像生成**：纯文本生图、参考图改图、风格转换、手办化、表情包生成。\n- **快速预设**：头像、海报、壁纸、卡片、手机壁纸、手办化、表情包一键生成。\n- **智能参考图**：自动读取消息图片、引用图片、合并转发、群文件，以及用户头像和 @ 对象头像。\n- **多供应商支持**：Google Gemini、OpenAI 兼容、OpenAI Images、xAI Images、MiniMax、Zai、grok2api、豆包。\n- **LLM 工具集成**：支持自然语言触发生图，前台短等待，超时后自动转后台发送。\n- **表情包切分**：内置 SmartMemeSplitter v4，并提供手动网格、视觉识别、主体吸附等兜底路径。\n- **限流与缓存**：支持群白名单/黑名单、周期限流、KV 持久化、临时文件自动清理。\n\n## 快速安装\n\n### 前置要求\n\n- AstrBot 4.10+\n- Python 3.10+\n- NapCat（目前主要适配 NapCat 平台）\n\n### 安装方式\n\n**插件市场**：搜索 `Gemini 图像生成` 并安装。\n\n**链接安装**：在插件界面右下角点击加号，选择从链接安装，输入：\n\n```text\nhttps://github.com/piexian/astrbot_plugin_gemini_image_generation\n```\n\n依赖会按 [requirements.txt](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/requirements.txt) 自动安装。\n\n## 最小配置\n\n至少需要配置一个可用的图像模型供应商：\n\n| 配置项 | 说明 |\n|--------|------|\n| `api_settings.provider_id` | 生图模型提供商，从 AstrBot 提供商列表选择；豆包可不填 |\n| `api_settings.api_type` | API 类型：`google` / `openai` / `openai_images` / `xai` / `minimax` / `zai` / `grok2api` / `doubao` |\n\n常用配置入口：\n\n- [完整配置参考](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/docs/config.md)\n- [使用指南](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/docs/usage.md)\n- [故障排除](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/docs/troubleshooting.md)\n- [新增 API 供应商](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/docs/新增API供应商.md)\n\n## 常用命令\n\n| 命令 | 说明 | 示例 |\n|------|------|------|\n| `/生图` | 纯文本生成 | `/生图 一只可爱的橙色小猫` |\n| `/改图` | 基于参考图修改 | 发送图片 + `/改图 把头发改成红色` |\n| `/换风格` | 风格转换 | 发送图片 + `/换风格 水彩` |\n| `/快速 头像` | 头像模式 | `/快速 头像 商务风格` |\n| `/快速 海报` | 海报模式 | `/快速 海报 赛博朋克` |\n| `/快速 壁纸` | 壁纸模式 | `/快速 壁纸 未来城市` |\n| `/快速 卡片` | 卡片模式 | `/快速 卡片 商务名片` |\n| `/快速 手机` | 手机壁纸 | `/快速 手机 极简风格` |\n| `/快速 手办化` | 手办效果 | `/快速 手办化 [1/2] 动漫角色` |\n| `/快速 表情包` | 表情包 | `/快速 表情包 Q版可爱` |\n| `/切图` | 切割图片 | `/切图` 或 `/切图 4 4` |\n| `/生图帮助` | 查看帮助 | `/生图帮助` |\n\n更多参数、快速模式说明和 LLM 工具行为见 [使用指南](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/docs/usage.md)。\n\n## OpenAI Images 提示\n\n`openai_images` 供应商支持 OpenAI Images 原生端点。启用 `size_mode=custom` 后：\n\n| 调用路径 | `size` 取值 |\n|----------|-------------|\n| 普通生图/改图 | 直接使用配置中的 `custom_size` |\n| 快速模式 | 根据模式预设的 `resolution + aspect_ratio` 自动换算 |\n| LLM 工具调用 | LLM 显式传入 `size` 时以该值为准，否则使用配置中的 `custom_size` |\n\n尺寸格式为 `WxH`，支持 `x` 或 `×`，例如 `1024x1024`、`2048×1152`。详细限制和示例见 [OpenAI Images 配置](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/docs/config.md#openai_images_settingsopenai-images-api-专用配置)。\n\n## MiniMax 提示\n\n`minimax` 供应商支持 MiniMax 官方 `/v1/image_generation` 端点，模型默认 `image-01`：\n\n| 能力 | 说明 |\n|------|------|\n| 文生图 | 直接发送 prompt、长宽比、生成数量等参数 |\n| 图生图 | 通过 `subject_reference` 传入参考图，默认 `type=character` |\n| 多图生成 | `n` 支持 `1-9` |\n| 响应格式 | 默认 `base64` 并保存为本地图片，避免官方 URL 24 小时过期 |\n| 分辨率适配 | 全局 `resolution`（1K/2K/4K）自动映射；不支持的比例（如 4:5）会计算显式像素尺寸 |\n\n详细配置见 [MiniMax 配置](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/docs/config.md#minimax_settingsminimax-图片生成-api-专用配置)。\n\n## 项目结构\n\n```text\nastrbot_plugin_gemini_image_generation/\n├── main.py                 # 插件主入口\n├── _conf_schema.json       # 配置 Schema\n├── docs/                   # 配置、使用、故障排除和适配器文档\n├── templates/              # 帮助页面模板\n└── tl/                     # 核心模块和供应商适配器\n```\n\n`tl/` 目录接口索引见：[tl 模块接口说明](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/tl/README.md)。\n\n## 贡献\n\n欢迎提交 [Issue](https://github.com/piexian/astrbot_plugin_gemini_image_generation/issues) 和 [Pull Request](https://github.com/piexian/astrbot_plugin_gemini_image_generation/pulls)。\n\n新增 API 供应商请参考：[适配器开发指南](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/docs/新增API供应商.md)。\n\n### 致谢\n\n- [@MliKiowa](https://github.com/MliKiowa) - 图像切割算法\n- [@exynos967](https://github.com/exynos967) - 限流设置、手办化功能、OpenAI 兼容、Zai 供应商、快速模式配置\n- [@zouyonghe](https://github.com/zouyonghe) - 代理支持、保留参考图尺寸、空格参数支持\n- [@vmoranv](https://github.com/vmoranv) - 表情包提示词优化\n- [@itismygo](https://github.com/itismygo) - grok2api 适配\n- [@xunxiing](https://github.com/xunxiing) - OpenAI Images 端点支持、配置提示修复\n- [@Clhikari](https://github.com/Clhikari) - 快速生图修复\n- [@YukiRa1n](https://github.com/YukiRa1n) - GIF 支持、多项修复\n\n## 许可证\n\nAGPL-3.0 License - 详见 [LICENSE](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/LICENSE)。\n\n## 相关链接\n\n- [项目地址](https://github.com/piexian/astrbot_plugin_gemini_image_generation)\n- [更新日志](https://github.com/piexian/astrbot_plugin_gemini_image_generation/blob/master/CHANGELOG.md)\n- [问题反馈](https://github.com/piexian/astrbot_plugin_gemini_image_generation/issues)\n- [AstrBot](https://docs.astrbot.app/)\n- [Google Gemini API](https://ai.google.dev/)\n- [NapCat](https://napneko.github.io/)\n- [AstrBook 论坛插件](https://github.com/advent259141/astrbot_plugin_astrbook)\n- [grok2api](https://github.com/chenyme/grok2api)\n- [zaiis2api](https://github.com/Futureppo/zaiis2api)\n- [zai.is](https://zai.is)\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/image?repos=piexian/astrbot_plugin_gemini_image_generation\u0026type=date\u0026legend=top-left)](https://www.star-history.com/?repos=piexian%2Fastrbot_plugin_gemini_image_generation\u0026type=date\u0026legend=top-left)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiexian%2Fastrbot_plugin_gemini_image_generation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiexian%2Fastrbot_plugin_gemini_image_generation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiexian%2Fastrbot_plugin_gemini_image_generation/lists"}