Install
openclaw skills install minimax-image-t2iMiniMax AI text-to-image generation tool. Use when the user wants to generate, create, or produce images (pictures/photos/illustrations) via AI. Triggers on phrases like "生成图片", "创建图片", "画一张图", "生成一张图片", "帮我画", "text-to-image", "文生图", "文生图", "text to image", or any request that asks for AI image generation. Requires only a text prompt describing the desired image content.
openclaw skills install minimax-image-t2iGenerate images from text prompts using MiniMax AI.
When user asks to generate an image, extract the image description from their prompt and run:
cd /root/.openclaw/workspace && python3 /root/.openclaw/skills/minimax-image/scripts/minimax-image.py "用户想要的图片描述" -n 数量 -a 宽高比 -o 输出文件.png
Examples:
python3 ... "一只可爱的卡通螃蟹" -n 1 -a 1:1 -o image.png"python3 ... "海边日落风景图" -n 3 -a 16:9 -o image.png"自动行为:当用户输入的提示词较短(<30字符)时,会自动调用 MiniMax 模型进行扩写,生成更详细专业的描述后再生成图片。
扩写示例:
跳过扩写:用户明确说"不扩写"、"不用扩写"时,添加 --no-expand 参数:
python3 ... --no-expand "一只猫"
| Parameter | Description | Default |
|---|---|---|
-n | Number of images (1-9) | 1 |
-a | Aspect ratio | 1:1 |
-m | Model (image-01 / image-01-live) | image-01 |
-o | Output filename | image.png |
--expand | Enable prompt expansion (default) | enabled |
--no-expand | Disable prompt expansion | disabled |
Aspect ratios: 1:1, 16:9, 4:3, 3:2, 2:3, 3:4, 9:16, 21:9
Extract image description from user's prompt
Check if expansion is needed (short prompt + user didn't say "不扩写")
If expansion needed: call MiniMax model to expand → print expanded prompt
Generate image using expanded or original prompt
Send the generated image back to user via 飞书 with detailed message:
For group chat (群里 @ 你的情况):
openclaw message send --channel feishu --target chat:oc_a386f54f877bb01f548c41f521e65d81 --message "🎨 图片生成完成!\n\n📝 原始提示词:{原始提示词}\n\n✨ 扩写后提示词:\n{完整的扩写后英文提示词}\n\n---\nGenerated by MiniMax AI" --media /root/.openclaw/workspace/minimax-images/输出文件.png
For direct message (私聊):
openclaw message send --channel feishu --target user:ou_c767b11bf84f718816a6919f3d7a08cf --message "🎨 图片生成完成!\n\n📝 原始提示词:{原始提示词}\n\n✨ 扩写后提示词:\n{完整的扩写后英文提示词}\n\n---\nGenerated by MiniMax AI" --media /root/.openclaw/workspace/minimax-images/输出文件.png
重要:消息中必须包含完整的扩写后提示词,不要省略或简化!这是用户想要看到的重要内容。
All images are saved to /root/.openclaw/workspace/minimax-images-t2i/ directory.
-o cat.png), it will be saved as /root/.openclaw/workspace/minimax-images-t2i/cat.pngimage_1.png, image_2.png, etc.