Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Generate images via OpenAI, Google, OpenRouter, DashScope, Jimeng, Seedream, and Replicate APIs with batch support.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/providers/agnes.md
1# Sapiens AI Agnes Image23Read when the user picks `--provider agnes` or sets `default_model.agnes`. Default model is `agnes-image-2.1-flash`.45## Models67**`agnes-image-2.1-flash`** (only model)89- Text-to-image and image-to-image (with `--ref`) in a single `/images/generations` endpoint10- Supports reference images as public URLs or Data URI (base64)11- Optimized for high information density, complex layouts, and rich details12- Size rules: both dimensions divisible by 32 (720px exception), long edge ≤ 2048, total pixels ≤ ~4M13- Default size: `1024x1024`; custom `--size` supports arbitrary WxH within the above rules14- `--ar` supported: computed as 2048-based size (long edge ≤ 2048, short edge proportional, both snapped to 32px); `1:1` special-cased to `1024x1024`1516## Response Format1718- The sync API always returns a URL19- Default (`--response-format file`): downloads the image and saves as `.png`20- Pass `--response-format url`: writes the URL string to `.txt` instead2122## `--n` Behavior2324The 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.2526## Behavior Notes2728- API key required: `AGNES_API_KEY`29- Base URL: `https://apihub.agnes-ai.com/v1` (override with `AGNES_BASE_URL`)30- Model override: `AGNES_IMAGE_MODEL` env31- `response_format` is always embedded in `extra_body` (not at request top level)32- Reference images: local files converted to Data URI base64 inline; remote URLs passed through33- Rate limit defaults: concurrency=3, startIntervalMs=1100 (override via `BAOYU_IMAGE_GEN_AGNES_CONCURRENCY` / `BAOYU_IMAGE_GEN_AGNES_START_INTERVAL_MS`)34- Timeout: 120s per request3536## Size Resolution3738- `--size <WxH>` wins over `--ar`39- `--ar` maps to a concrete size using the algorithm: long edge ≤ 2048, short edge proportional, both dimensions snapped to 32px40- `--ar 1:1` is special-cased to `1024x1024`4142### Common `--ar` Results4344| Aspect Ratio | Result |45|--------------|--------|46| `1:1` | `1024x1024` |47| `16:9` | `2048x1152` |48| `4:3` | `2048x1536` |49| `3:2` | `2048x1376` |50| `21:9` | `2048x896` |51| Unlisted ratio | Computed on the fly (portrait mirror swaps width/height) |5253## Official References5455- [Agnes AIGC API Hub](https://apihub.agnes-ai.com)56