JimLiu-baoyu-skills/skills
Jim Liu 宝玉 67a45a57a0
Improve baoyu-imagine Replicate compatibility (#125)
* Align Replicate image behavior with the models we actually support

Replicate image generation in baoyu-imagine no longer assumes that every model
accepts the nano-banana request schema. The Replicate provider now defaults to
google/nano-banana-2, routes supported model families through family-specific
builders and validators, blocks misleading multi-output requests before they
reach the API, and updates user-facing docs/config guidance to match the actual
contract.

Constraint: Replicate model families expose different input schemas
Constraint: Current Replicate path only saves one output image per request
Constraint: Must not change non-Replicate providers
Rejected: Keep one nano-banana-style payload for all Replicate models | triggers remote schema errors on Seedream and Wan
Rejected: Continue accepting multi-image Replicate requests and save only the first result | silently drops outputs
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Add a family-specific validator and input builder before exposing more Replicate model IDs or multi-output flags
Tested: npm test
Tested: node --test skills/baoyu-imagine/scripts/providers/replicate.test.ts skills/baoyu-imagine/scripts/main.test.ts
Not-tested: Live Replicate API calls against production models
Co-authored-by: justnode <justnode@users.noreply.github.com>

* Preserve Replicate compatibility when shared defaults leak across providers

Addressed the new PR review findings by teaching baoyu-imagine to track
where aspect-ratio defaults came from, mirroring the earlier imageSize fix,
so unsupported Replicate models can still run prompt-only requests when the
value was inherited from shared config. Also corrected Seedream 4.5 custom
size encoding to use the API's custom width/height schema instead of sending
literal WxH strings.

Constraint: Shared EXTEND defaults still need to apply globally for providers that support them
Constraint: Seedream 4.5 custom sizes must follow Replicate's documented custom size schema
Rejected: Ignore all aspect ratios for unknown Replicate models | would hide explicit unsupported CLI/task input
Rejected: Keep Seedream custom sizes as literal strings | validated locally but fails against the provider API
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Any future inherited-default validation for provider-specific flags should record the source explicitly before rejecting it
Tested: node --import tsx --test skills/baoyu-imagine/scripts/main.test.ts skills/baoyu-imagine/scripts/providers/replicate.test.ts
Tested: npm test
Not-tested: Live Replicate API calls for Seedream 4.5 custom-size requests

---------

Co-authored-by: justnode <justnode@users.noreply.github.com>
2026-04-12 01:16:32 -05:00
..
baoyu-article-illustrator fix(baoyu-article-illustrator): omit model field from batch tasks when unspecified 2026-04-11 21:02:18 -05:00
baoyu-comic feat(baoyu-comic): add four-panel preset, minimalist art style, and flexible image workflow 2026-04-07 01:31:32 -05:00
baoyu-compress-image Merge pull request #69 from liby/feat/xdg-config-path 2026-03-08 22:19:52 -05:00
baoyu-cover-image feat(baoyu-cover-image): add macaron palette and hand-drawn-edu style preset 2026-04-08 17:58:29 -05:00
baoyu-danger-gemini-web chore: sync vendor baoyu-chrome-cdp across CDP skills 2026-04-01 02:11:56 -05:00
baoyu-danger-x-to-markdown chore: sync vendor baoyu-chrome-cdp across CDP skills 2026-04-01 02:11:56 -05:00
baoyu-diagram feat: add baoyu-diagram skill and baoyu-article-illustrator ink-notes style (v1.99.0) 2026-04-11 20:54:32 -05:00
baoyu-format-markdown feat(baoyu-format-markdown): optimize title generation and auto-generate dual summaries 2026-03-17 01:59:10 -05:00
baoyu-image-cards fix(baoyu-image-cards): rename palette Zone labels to prevent text rendering in images 2026-04-09 13:20:14 -05:00
baoyu-image-gen chore(baoyu-image-gen): add deprecation notice redirecting to baoyu-imagine 2026-03-26 09:51:48 -05:00
baoyu-imagine Improve baoyu-imagine Replicate compatibility (#125) 2026-04-12 01:16:32 -05:00
baoyu-infographic feat(baoyu-infographic): add hand-drawn-edu style with macaron palette 2026-04-08 22:06:50 -05:00
baoyu-markdown-to-html chore: update bun.lock files 2026-03-31 18:24:26 -05:00
baoyu-post-to-wechat fix(baoyu-post-to-wechat): detect actual image format from buffer magic bytes 2026-04-05 13:36:51 -05:00
baoyu-post-to-weibo chore: sync vendor baoyu-chrome-cdp across CDP skills 2026-04-01 02:11:56 -05:00
baoyu-post-to-x chore: sync vendor baoyu-chrome-cdp across CDP skills 2026-04-01 02:11:56 -05:00
baoyu-slide-deck fix(baoyu-slide-deck): add pptxgenjs dependency and detect image format by magic bytes 2026-04-09 10:00:29 -05:00
baoyu-translate refactor(baoyu-translate): simplify translation prompts and workflow 2026-03-26 23:02:28 -05:00
baoyu-url-to-markdown chore(baoyu-url-to-markdown): sync vendor baoyu-fetch with login auto-detect 2026-04-01 02:12:04 -05:00
baoyu-xhs-images feat(baoyu-xhs-images): add sketch-notes style, palette system, and new presets 2026-04-10 10:58:29 -05:00
baoyu-youtube-transcript feat(baoyu-youtube-transcript): auto-retry with yt-dlp on empty InnerTube transcript 2026-04-03 23:35:42 -05:00