跳到正文

宝玉:多服务图像生成

通过支持的图像服务组织文本生成图片、参考图片及批量任务,按环境准备 API 配置和模型参数。

开源精选内容生产53 个文件26,681 Stars浏览次数 0JimLiu/baoyu-skills MIT版本 1567581
开始使用

下载前阅读 SKILL.md 中的使用条件,并确认所用工具支持对应能力。

输入资料
提示词、尺寸与参考图片 所选服务的访问权限 阅读本节完整说明
交付内容
生成图片 可复查的任务参数 阅读本节完整说明
  1. 获取完整包,保留配套文件的目录结构。
  2. 按照原文准备所需工具、依赖与输入资料。
  3. 阅读对应使用步骤与输入输出说明,在自己的环境中验证结果。

使用提示摘自原文,配套文件保留来源版本;实际运行条件以各包说明为准。

正文

获取原文件

references/providers/agnes.md

Read when the user picks --provider agnes or sets default_model.agnes. Default model is agnes-image-2.5-flash.

Models

agnes-image-2.5-flash (only model)

  • Text-to-image and image-to-image (with --ref) in a single /images/generations endpoint
  • Supports reference images as public URLs or Data URI (base64)
  • Optimized for high information density, complex layouts, and rich details
  • Size rules: both dimensions divisible by 32 (720px exception), long edge ≤ 2048, total pixels ≤ ~4M
  • Default size: 1024x1024; custom --size supports arbitrary WxH within the above rules
  • --ar supported: computed as 2048-based size (long edge ≤ 2048, short edge proportional, both snapped to 32px); 1:1 special-cased to 1024x1024

Response Format

  • The sync API always returns a URL
  • Default (--response-format file): downloads the image and saves as .png
  • Pass --response-format url: writes the URL string to .txt instead

--n Behavior

The Agnes API returns a single image per request regardless of the n parameter. Passing --n > 1 triggers a local error from validateArgs before any API call is made.

Behavior Notes

  • API key required: AGNES_API_KEY
  • Base URL: https://apihub.agnes-ai.com/v1 (override with AGNES_BASE_URL)
  • Model override: AGNES_IMAGE_MODEL env
  • response_format is always embedded in extra_body (not at request top level)
  • Reference images: local files converted to Data URI base64 inline; remote URLs passed through
  • Rate limit defaults: concurrency=3, startIntervalMs=1100 (override via BAOYU_IMAGE_GEN_AGNES_CONCURRENCY / BAOYU_IMAGE_GEN_AGNES_START_INTERVAL_MS)
  • Timeout: 120s per request

Size Resolution

  • --size <WxH> wins over --ar
  • --ar maps to a concrete size using the algorithm: long edge ≤ 2048, short edge proportional, both dimensions snapped to 32px
  • --ar 1:1 is special-cased to 1024x1024

Common --ar Results

Aspect Ratio Result
1:1 1024x1024
16:9 2048x1152
4:3 2048x1536
3:2 2048x1376
21:9 2048x896
Unlisted ratio Computed on the fly (portrait mirror swaps width/height)

Official References

CONTACT HAONAN

联系haonan

医疗 AI · 产品与独立开发

刘浩南

关注医疗 AI 从 demo 到真实落地,聚焦产品化、商业化与院内工作流效率提升。

12年医疗产研经验,大湾区头部医疗AI公司前产品总监,独立开发者

医疗 AI 产品化医疗 AI 商业化院内工作流效率
刘浩南的微信联系二维码
微信扫一扫,联系 haonan