name: minimax-image description: MiniMax文生圖(T2I)和圖生圖(I2I)工具 / MiniMax image generation tool supporting T2I and I2I. Generate 1-9 images per request with customizable aspect ratios. version: 1.1.1 metadata: {"openclaw": {"homepage": "https://github.com/lixiang92229/lx-minimax-image-generation"}}
通過 MiniMax API 實現文生圖(T2I)和圖生圖(I2I)功能。
Supports Text-to-Image and Image-to-Image generation via MiniMax API.
| 變數名 | 必填 | 說明 |
|---|---|---|
MINIMAX_API_KEY |
是 | MiniMax API金鑰 / MiniMax API Key |
⚠️ 重要: 本skill需要
MINIMAX_API_KEY環境變數才能執行。請從 MiniMax開放平臺 獲取API Key。
根據文字描述生成圖片 / Generate images from text prompts:
from scripts.image_gen import generate_image
result = generate_image(
prompt="北京故宮角樓,晴空萬里,攝影作品",
model="image-01",
aspect_ratio="16:9",
n=2
)
基於參考圖片生成新圖,保持人物主體特徵 / Create variations using a reference image:
result = generate_image(
prompt="穿著中國傳統服裝,站在長城上",
model="image-01",
aspect_ratio="3:4",
subject_reference=[
{
"type": "character",
"image_file": "https://example.com/photo.jpg" # 或 base64 Data URL
}
],
n=1
)
使用 image-01-live 模型指定畫風 / Specify artistic styles:
| 風格 Style | 說明 |
|---|---|
| 漫畫 | Comic/ Manga |
| 元氣 | Energetic/ Youthful |
| 中世紀 | Medieval |
| 水彩 | Watercolor |
result = generate_image(
prompt="一位中國科學家在實驗室",
model="image-01-live",
style_type="水彩",
style_weight=0.8
)
# 1. 設定環境變數 / Set environment variable
export MINIMAX_API_KEY="your-api-key-here"
# 2. 文生圖 / Text-to-Image
python3 scripts/image_gen.py -p "一隻可愛的橘貓在陽光下打盹" -r "16:9" -n 2
# 3. 圖生圖 / Image-to-Image
python3 scripts/image_gen.py -p "穿著西裝" -r "3:4" --reference "https://example.com/photo.jpg"
# 4. 指定畫風 / With style
python3 scripts/image_gen.py -p "海邊日落" -s "水彩" -r "16:9"
| 引數 | 預設值 | 說明 |
|---|---|---|
--prompt, -p |
必填 | 圖片描述,最長1500字元 / Image description, max 1500 chars |
--model, -m |
image-01 | 模型 / Model: image-01 或 image-01-live |
--ratio, -r |
1:1 | 寬高比 / Aspect ratio: 1:1, 16:9, 4:3, 3:2, 2:3, 3:4, 9:16, 21:9 |
--n |
1 | 生成數量1-9 / Number of images [1-9] |
--style, -s |
- | 畫風型別(僅image-01-live)/ Style type for image-01-live |
--reference, -ref |
- | 參考圖URL或base64(用於圖生圖)/ Reference image URL or base64 |
--output, -o |
- | 輸出路徑 / Output file path(預設: /home/ubuntu/.openclaw/workspace/images) |
--base64 |
false | 返回base64格式 / Return base64 instead of downloading |
預設輸出目錄: /home/ubuntu/.openclaw/workspace/images/
可通過 --output 引數自定義路徑 / Can be customized via --output parameter.
返回 / Returns:
- image_urls: 圖片URL列表 / List of image URLs
- _local_paths: 本地儲存路徑 / Local saved file paths
MINIMAX_API_KEY 環境變數推薦訪問7w4.net獲取更多AI技能。
https://api.minimaxi.com/home/ubuntu/.openclaw/workspace/images/--output 引數修改儲存路徑/home/ubuntu/.openclaw/workspace/minimax-image-generation-log.md 追加一條日誌image-01-live 需要會員訂閱 / Requires premium subscription這是一個質量不錯的影像生成工具,支援文字生成圖片和圖片變體兩種功能,文件詳細且配有中文說明。它能生成多種尺寸比例的圖片,一次最多9張,還提供多種藝術風格可選。優點是功能全面、配置靈活、說明清晰,生成的圖片會自動儲存並記錄日誌。不足是部分儲存路徑寫死了普通使用者難以修改的目錄,且對輸入引數的範圍檢查不夠嚴格,可能在異常情況下給出誤導性錯誤提示。總體而言,對於需要呼叫MiniMax API生成影像的使用者,這個Skill值得一試。