Skip to main content
Glama

Generate Image with Replicate

replicate_generate_image

Generate one or more images from a text prompt using selectable Replicate image models, with controls for aspect ratio, seed, and output count.

Instructions

Generate one or more images from a text prompt using a Replicate image model.

Use this for any "draw / create / generate an image of …" request. By default it uses Flux Schnell (fast, ~2 seconds per image).

DISPLAY REQUIREMENT — after this tool returns successfully, you MUST embed the image inline in your reply by pasting ONE of the three embed blocks the tool prints verbatim (Option 1 iframe, Option 2 , or Option 3 markdown — try them in that order; pick the first one your chat client renders). The iframe variant scales to the chat column width with the image's native aspect ratio; the variant is a responsive fallback; markdown is the universal last resort. Place the chosen embed BEFORE any descriptive prose. Do NOT paraphrase the URL or omit the embed — the user wants the image to appear in the main chat flow, not only inside the collapsed tool widget. URLs expire in ~24h.

Args:

  • prompt (string): Text description of the image to generate.

  • model (string, default "flux-schnell"): Either a curated key (flux-schnell, flux-dev, flux-pro, flux-2-max, sd-3.5-large, recraft-v3, recraft-v4.1, ideogram-v2, imagen-3, seedream) or a full Replicate identifier "owner/name[:version]".

  • aspect_ratio ("1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "21:9" | "3:2" | "2:3", optional): Aspect ratio. Default 1:1.

  • num_outputs (1-4, optional): How many images to generate.

  • seed (integer, optional): Random seed for reproducible output.

  • extra_input (object, optional): Model-specific extra inputs (e.g. {guidance: 3.5, num_inference_steps: 28}). Use replicate_get_model_schema if unsure.

  • download (boolean, default true): Download files locally to ~/Downloads/replicate-mcp/.

  • timeout_ms (5000-1800000, optional): Max wait. Default 300000 (5min).

Returns structuredContent matching PredictionResult: { "status": "starting" | "processing" | "succeeded" | "failed" | "canceled", "prediction_id": string, "model": string, "urls": string[], // Replicate URLs (expire ~24h) "local_paths": string[], // Absolute paths on disk when download=true "metrics": { "predict_time_seconds": number } | undefined, "error": string | undefined, "pending": boolean | undefined // true if timed out — poll via replicate_get_prediction }

Examples:

  • "An origami fox in a misty forest" → uses flux-schnell, 1:1

  • prompt="logo for a coffee shop called Crema", model="recraft-v3" → for text-in-image

  • prompt="cinematic shot of a lighthouse", model="flux-pro", aspect_ratio="21:9", seed=42

Error handling:

  • If REPLICATE_API_TOKEN is missing, returns an actionable error telling the user how to set it.

  • Invalid model IDs return Replicate's error message verbatim.

Input Schema

NameRequiredDescriptionDefault
seedNoRandom seed for reproducible outputs.
modelNoEither a curated key (flux-schnell, flux-dev, flux-pro, sd-3.5-large, recraft-v3, recraft-v4.1, flux-2-max, seedream, ideogram-v2, imagen-3) or a Replicate identifier like "owner/name" or "owner/name:version".flux-schnell
promptYesText prompt describing the image to generate.
downloadNoWhether to download the generated files locally. Default true. When false, only Replicate URLs are returned (URLs expire after ~24h).
timeout_msNoMax ms to wait for the prediction. If exceeded, returns the prediction ID so you can poll via replicate_get_prediction. Default: 300000 (5min).
extra_inputNoAdditional model-specific inputs merged into the request (e.g. {guidance: 3.5}). Use replicate_get_model_schema to see what a model accepts.
num_outputsNoNumber of images to generate (1-4).
aspect_ratioNoAspect ratio. Supported by Flux models. Default 1:1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv3.3.1
    • addedInput schema / properties / extra_input / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / seed / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / seed / minimum
      Added value: +-9007199254740991
  2. First observedv3.2.3

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations (readOnlyHint=false, openWorldHint=true): discloses ~2s/image default latency, that URLs expire in ~24h, that download=true writes to ~/Downloads/replicate-mcp/, the timeout/pending polling path via replicate_get_prediction, and specific error behavior for a missing REPLICATE_API_TOKEN and invalid model IDs. It also flags the post-call display obligation, which is non-obvious agent-facing behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded and sections are headed (display requirement, args, returns, examples, errors) so an agent can scan. It is long and the 'Args' block largely restates the schema, which is the main waste, but the display requirement and examples justify their space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description supplies a full PredictionResult field-by-field shape including pending/failed states and the polling escape hatch, plus error handling and expiry caveats. Nothing an agent needs to call this correctly and interpret the result is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds real guidance beyond the schema: recraft-v3 for text-in-image, flux-pro with 21:9 and seed for cinematic shots, aspect_ratio support limited to Flux models, and extra_input examples paired with the schema-lookup tool. The duplicated Args list adds little, but the examples do.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb and resource ('Generate one or more images from a text prompt using a Replicate image model') with a stated default model and speed. Sibling tools (generate_video, generate_audio, upscale_image, inpaint) are clearly distinct from text-to-image generation, so an agent can route on name + first sentence alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes 'draw / create / generate an image of …' requests here and points to replicate_get_model_schema when extra_input fields are unknown. It does not, however, state exclusions against near-neighbors like replicate_upscale_image, replicate_inpaint, or replicate_run_model, leaving the agent to infer those boundaries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.