minimax image t2i

MCP Tools

MiniMax 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.

Install

openclaw skills install minimax-image-t2i

MiniMax Text-to-Image (T2I)

Generate images from text prompts using MiniMax AI.

Quick Usage

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:

  • User: "帮我生成一张可爱的卡通螃蟹" → python3 ... "一只可爱的卡通螃蟹" -n 1 -a 1:1 -o image.png"
  • User: "生成3张海边日落风景图" → python3 ... "海边日落风景图" -n 3 -a 16:9 -o image.png"

Prompt Expansion (提示词扩写)

自动行为:当用户输入的提示词较短(<30字符)时,会自动调用 MiniMax 模型进行扩写,生成更详细专业的描述后再生成图片。

扩写示例

  • 输入:"一只猫" → 输出:"A fluffy adorable cat sitting on a windowsill, soft natural lighting, warm afternoon sun, photorealistic, 4K, high detail, front view"
  • 输入:"海边日落" → 输出:"Breathtaking ocean sunset scene with vibrant orange and pink sky, calm waves reflecting golden light, silhouetted palm trees, cinematic composition, photorealistic, 8K, masterpiece"

跳过扩写:用户明确说"不扩写"、"不用扩写"时,添加 --no-expand 参数:

python3 ... --no-expand "一只猫"

Parameters

ParameterDescriptionDefault
-nNumber of images (1-9)1
-aAspect ratio1:1
-mModel (image-01 / image-01-live)image-01
-oOutput filenameimage.png
--expandEnable prompt expansion (default)enabled
--no-expandDisable prompt expansiondisabled

Aspect ratios: 1:1, 16:9, 4:3, 3:2, 2:3, 3:4, 9:16, 21:9

Workflow

  1. Extract image description from user's prompt

  2. Check if expansion is needed (short prompt + user didn't say "不扩写")

  3. If expansion needed: call MiniMax model to expand → print expanded prompt

  4. Generate image using expanded or original prompt

  5. 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
    

    重要:消息中必须包含完整的扩写后提示词,不要省略或简化!这是用户想要看到的重要内容。

Output Location

All images are saved to /root/.openclaw/workspace/minimax-images-t2i/ directory.

  • If user specifies a filename (e.g., -o cat.png), it will be saved as /root/.openclaw/workspace/minimax-images-t2i/cat.png
  • If no filename specified, auto-generates image_1.png, image_2.png, etc.