SKILLS/image-generation/SKILL.md

67 lines
2.9 KiB
Markdown

---
name: image-generation
description: Generate images using MiniMax API with support for custom prompts, aspect ratios, and multiple image generation.
metadata: {"clawdbot":{"emoji":"🎨","os":["linux","darwin","win32"]}}
---
# MiniMax Image Generation SKILL
## Description
Generate images using MiniMax API. Supports custom prompts, aspect ratios, generation count, and more.
## Usage
```bash
python scripts/run.py --api-key "your-api-key" --prompt "your-prompt" [options]
```
## Arguments
| Argument | Type | Required | Default | Description |
|----------|------|----------|---------|-------------|
| `--api-key` | string | Yes | - | MiniMax API key (can also be set via `MINIMAX_API_KEY` env var) |
| `--prompt` | string | Yes | - | Image generation prompt |
| `--model` | string | No | `image-01` | Image generation model |
| `--aspect-ratio` | string | No | `1:1` | Image aspect ratio (e.g., 16:9, 1:1, 9:16) |
| `--response-format` | string | No | `url` | Response format (`url` or `base64`) |
| `--n` | int | No | `1` | Number of images to generate (1-3) |
| `--prompt-optimizer` | bool | No | `false` | Enable prompt optimizer |
| `--subject-reference` | string | No | - | Reference image URL or local file path for image-to-image generation |
| `--subject-type` | string | No | `character` | Subject reference type (character, product, logo, video_subject, other) |
| `--seed` | int | No | - | Random seed for reproducible generation |
| `--output-dir` | string | No | `./output` | Output directory for images |
## API Reference
- **Endpoint**: `POST https://api.minimaxi.com/v1/image_generation`
- **Auth**: Bearer Token
## Examples
```bash
python scripts/run.py --api-key "sk-xxx" --prompt "A sunset over the ocean"
# Generate multiple images
python scripts/run.py --api-key "sk-xxx" --prompt "A man in a white t-shirt, full-body, standing front view, outdoors" --n 3 --aspect-ratio "16:9"
# Enable prompt optimizer
python scripts/run.py --api-key "sk-xxx" --prompt "sunset ocean" --prompt-optimizer true
# Image-to-image generation with reference image URL
python scripts/run.py --api-key "sk-xxx" --prompt "A girl looking into the distance from a library window" --subject-reference "https://example.com/reference.jpg" --subject-type "character" --n 2
# Image-to-image with local file
python scripts/run.py --api-key "sk-xxx" --prompt "A girl looking into the distance from a library window" --subject-reference "./my_character.jpg" --subject-type "character"
# Image-to-image with product reference
python scripts/run.py --api-key "sk-xxx" --prompt "A beautiful product shot" --subject-reference "https://example.com/product.jpg" --subject-type "product"
# Use seed for reproducible generation
python scripts/run.py --api-key "sk-xxx" --prompt "A sunset over the ocean" --seed 42
```
## Output
Images are saved to the specified output directory with the naming format: `generated_image_{index}_{timestamp}.{ext}`.