feat: add MiniMax image generation provider - #52712
ejimenezc93 wants to merge 1 commit into
Conversation
Adds an image_gen backend for MiniMax's Token Plan / Subscription API (POST https://api.minimax.io/v1/image_generation, model image-01). Features: - text-to-image - image-to-image via subject_reference (1 reference image) - signed response URLs cached locally via save_url_image - aspect ratio mapping (landscape/square/portrait -> 16:9/1:1/9:16) - MiniMax business-error handling (base_resp.status_code) - HTTP non-2xx error mapping - empty-prompt validation - model override via MINIMAX_IMAGE_MODEL or image_gen.minimax.model - base URL override via MINIMAX_BASE_URL (env-only, for tests) Auth: env var MINIMAX_API_KEY (Subscription Key, sk-cp-...) with fallback to MINIMAX_SUBSCRIPTION_KEY / MINIMAX_SUBS_KEY. Tests: 38 unit tests covering availability, config resolution, auth header, payload shape, success/error/cache-fallback paths, image-to-image reference handling, kwargs tolerance, and registry wiring. Verified end-to-end: provider.generate() returns success with cached local path against the live MiniMax API.
Duplicate of #25451 (the earliest open MiniMax |
|
Thanks for the MiniMax image-generation implementation and the dedicated provider tests. This automated hermes-sweeper review is closing the PR under the standing
Please publish or continue this as a standalone MiniMax image-generation plugin repository and share it in Automated hermes-sweeper review; closed as not planned under standing policy Closed as not-planned per standing maintainer policy ( |
Summary
Adds an
image_genbackend for the MiniMax Token Plan / Subscription API(
POST https://api.minimax.io/v1/image_generation, modelimage-01).Hermes ships with
fal,krea,openai,openai-codex,openrouter,and
xaifor image generation, but MiniMax Plus subscribers don't havea backend that consumes their bundled Token Plan credits.
Changes
plugins/image_gen/minimax/(__init__.py,plugin.yaml)tests/plugins/image_gen/test_minimax_provider.py(38 tests)Features
subject_reference(single reference image)save_url_imagelandscape/square/portrait→16:9/1:1/9:16)base_resp.status_code)MINIMAX_IMAGE_MODELorimage_gen.minimax.modelMINIMAX_BASE_URL(env-only, for tests)Auth
MINIMAX_API_KEYenv var (Subscription Key,sk-cp-...). Falls back toMINIMAX_SUBSCRIPTION_KEY/MINIMAX_SUBS_KEY.Verification
python -m pytest tests/plugins/image_gen/test_minimax_provider.py -v→ 38 passedpython -m py_compile plugins/image_gen/minimax/__init__.py tests/plugins/image_gen/test_minimax_provider.py→ OKprovider.generate(...)returns success with a cached local JPEGon Windows 11 / Python 3.11 / real MiniMax API.