Julien Talbot
|
a5e4a86ebe
|
feat(xai): add xAI image generation provider (grok-imagine-image)
Add xAI as a plugin-based image generation backend using grok-imagine-image.
Follows the existing ImageGenProvider ABC pattern used by OpenAI and FAL.
Changes:
- plugins/image_gen/xai/__init__.py: xAI provider implementation
- Uses xAI /images/generations endpoint
- Supports text-to-image and image editing with reference images
- Multiple aspect ratios (1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3)
- Multiple resolutions (1K, 2K)
- Base64 output saved to cache
- Config via config.yaml image_gen.xai section
- plugins/image_gen/xai/plugin.yaml: plugin metadata
- tests/plugins/image_gen/test_xai_provider.py: 19 unit tests
- Provider class (name, display_name, is_available, list_models, setup_schema)
- Config (default model, resolution, custom model)
- Generate (missing key, success b64/url, API error, timeout, empty response, reference images, auth header)
- Registration
Requires XAI_API_KEY in ~/.hermes/.env.
To use: set image_gen.provider: xai in config.yaml.
|
2026-04-23 15:13:34 -07:00 |
|