Skip to main content
Glama

Image To Image

image_to_image

Transform an existing image using a text prompt.

Modifies images based on text descriptions. Useful for style transfer and editing. Accepts images as URLs (preferred), data URIs (data:image/...;base64,...), or base64 strings. When a URL is available (e.g., from a previous text_to_image result), always prefer passing the URL directly.

Pass either image for a single source or images for up to five; the API rejects a request carrying both.


Available models:

  • Flux_2_Klein_4B_BF16: steps=4 (fixed), size=256-1536x256-1536, up to 3 input image(s), no negative_prompt

  • QwenImageEdit_Plus_NF4: steps=1-50 (default 40), size=256-1024x256-1024, output size = input size, up to 1 input image(s)

  • gpt-image-2.6 (test model): size=640-3840x640-3840, w/h rounded down to a multiple of 16, ≤8.29Mpx, side≤3840, aspect≤3, up to 5 input image(s), quality: low|medium|high|auto (default medium), no negative_prompt

  • nano-banana-2.1 (test model): size=352-11712x352-11712, w/h rounded down to a multiple of 16, ≤17.20Mpx, side≤11712, aspect≤8.4, up to 5 input image(s), no negative_prompt

  • gpt-image-2.5 (test model): size=640-3840x640-3840, w/h rounded down to a multiple of 16, ≤8.29Mpx, side≤3840, aspect≤3, up to 5 input image(s), quality: low|medium|high|auto (default high), no negative_prompt

  • gpt-image-2 (test model): size=512-2048x512-2048, output size = input size, up to 2 input image(s), quality: low|medium|high|auto (default medium), no negative_prompt

  • gpt-image-1.5 (test model): size=1024-1536x1024-1536, output size = input size, up to 2 input image(s), quality: low|medium|high (default medium), no negative_prompt Models marked (test model) are experimental: they may change or disappear. Prefer an unmarked model unless the caller asks for one of them.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>",
      "model": "<model>"
    },
    "name": "image_to_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedNoRandom seed for reproducibility
imageNoSource image as URL (e.g., from text_to_image result), data URI (data:image/png;base64,...), or base64 string. IMPORTANT: Pass the image directly without displaying or printing the base64 data.
lorasNoList of LoRA models (optional, e.g., [{'name': 'style_lora', 'weight': 0.75}])
modelYesAI model name for image transformation
stepsNoNumber of diffusion steps. Defaults to the model's own value (see the model list)
widthNoOutput width in pixels. Defaults to the first input image's size; ignored by models that keep the input size (Qwen, gpt-image-1.5/2)
heightNoOutput height in pixels. Defaults to the first input image's size; ignored by models that keep the input size (Qwen, gpt-image-1.5/2)
imagesNoSeveral source images to edit together, each a URL, data URI or base64 string. How many a model takes is 'up to N input image(s)' in the model list (the API caps it at 5). Mutually exclusive with 'image'
promptYesText description of desired transformation
qualityNoQuality tier for models that price by tier, e.g. 'low', 'medium', 'high'. Costs vary sharply between tiers
webhook_urlNoHTTPS URL for deAPI to call when this job finishes. Notifies your own systems; the tool still returns the result here
enhance_promptNoLet the API expand the prompt before generating
guidance_scaleNoHow closely to follow the prompt. Leave unset to use the model's own default
webhook_secretNo32-255 char key deAPI signs the callback with (HMAC-SHA256). Needs webhook_url. A secret given in chat stays in the transcript
negative_promptNoThings to exclude from the transformed image (optional)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / images / anyOf
      Previous value: -[
      -  {
      -    "items": {},
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {},
      +    "maxItems": 16,
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations at all, the description carries the full behavioral burden and mostly meets it: per-model capabilities, fixed vs. configurable steps, output-size behavior, input-image caps, and experimental-model instability are all disclosed. It does not say whether the call blocks or is queued, how failures surface, or whether results are stored, which are material for a 15-parameter generation call.

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?

The purpose and input-format rules are front-loaded, and the model constraints are presented as a scannable bulleted table, so the length earns its place. Minor waste exists in the near-duplicate opening pair ('Transform an existing image...' / 'Modifies images based on text descriptions'), which say the same thing twice.

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

Completeness4/5

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

For a complex multi-model tool with 15 parameters, the description covers the hard parts: accepted image encodings, mutual exclusivity, per-model limits, and model stability. With an output schema present, return-value explanation is unnecessary, but job execution semantics and cost implications (relevant given the price siblings) are left unaddressed.

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 the baseline is 3, but the model table adds real meaning beyond the schema's bare 'AI model name' entry — step ranges, size bounds, aspect ratio caps, per-model defaults, and which models ignore negative_prompt/quality. That translates directly into which optional parameters matter for a given model, though it does not add anything for seed, loras, or guidance_scale.

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?

The description names a specific verb+resource up front: 'Transform an existing image using a text prompt,' and clarifies the useful cases ('style transfer and editing'). The emphasis on 'existing image' and 'from a previous text_to_image result' makes clear that this is the edit-from-image path rather than generation from scratch or video/upscale siblings.

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?

It gives concrete usage guidance: prefer URLs (especially those returned by text_to_image), and pass either 'image' or 'images' but never both because the API rejects it. It also warns to prefer unmarked models over experimental ones. It does not state exclusions vs. price/lookup siblings or when the job runs asynchronously, so it stops short of fully explicit when/when-not rules.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.