Skip to content

generate_image

Create images from a text description using the MiniMax image-01 model. Generated images are returned inline in the MCP response (base64-encoded JPEG) and saved to disk for reuse.

ParameterTypeRequiredDefaultDescription
promptstringText description of the image to generate (max 1,500 chars)
modelstringimage-01Image generation model
aspect_ratiostring1:1Output aspect ratio: 1:1, 16:9, 4:3, 3:2, 2:3, 3:4, 9:16, 21:9
ninteger1Number of images to generate per request [1, 9]
prompt_optimizerbooleantrueAuto-optimize the prompt for better results

Single image:

“Generate an image of a serene mountain lake at sunrise, photorealistic style.”

Batch with aspect ratio:

“Create 4 variations of a logo for a coffee shop called ‘Morning Brew’, minimalist style, 16:9 aspect ratio.”

Widescreen scene:

“Generate a portrait of a futuristic city skyline at night, cyberpunk aesthetic, 21:9 widescreen.”

Image for video pipeline (see generate_video):

“Generate a photorealistic image of a golden retriever on a beach at sunset — I’ll use it as the first frame of a video.”

Returns one or more image content parts (base64-encoded JPEG), plus a text part with the saved file paths.

  • All images are returned as JPEG with MIME type image/jpeg.
  • When n > 1, each image is saved as a separate file in the same temporary directory.
  • Generated files can be passed as first_frame_image to generate_video to create a video from the image.