Skip to main content
Glama

txt2img

Generate images from text prompts or transform existing images with Puter AI, including image-to-image generation.

Instructions

Generate an image from a text prompt or transform an existing image using Puter AI. Supports image-to-image generation. Default model: gpt-image-2 for text-to-image, gemini-2.5-flash-image-preview for image-to-image.

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>"
    },
    "name": "txt2img"
  }
}

Input Schema

NameRequiredDescriptionDefault
nNoNumber of images to generate
seedNoRandom seed for reproducible generation
modelNoImage model to use (default: gpt-image-2 for text-to-image, gemini-2.5-flash-image-preview for image-to-image)
ratioNoAspect ratio with w and h properties
stepsNoNumber of generation steps
widthNoImage width in pixels (Together provider)
heightNoImage height in pixels (Together provider)
promptYesText description for the image generation or transformation
qualityNo
providerNo
image_urlNoInput image URL (Together provider)
test_modeNoUse test mode without credits
input_imageNoInput image URL or Base64 for image-to-image generation (Replicate/Gemini)
aspect_ratioNoAspect ratio (Together provider)
image_base64NoInput image as Base64 (Together provider)
input_imagesNoArray of input image URLs for image-to-image (Gemini/Replicate)
output_formatNoOutput formatbase64
mask_image_urlNoMask image URL for inpainting (Together provider)
negative_promptNoWhat to avoid in the image
prompt_strengthNoHow strongly the prompt influences output (Together provider)
response_formatNoResponse format (Together provider)
mask_image_base64NoMask image as Base64 for inpainting (Together provider)
puter_output_pathNoSave to Puter filesystem path
disable_safety_checkerNoDisable safety checker

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior2/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 falls well short. It does not state that generation consumes Puter AI credits, what is returned (a URL vs. base64 payload), whether the safety checker can block output, or how provider-specific parameters interact; those must all be inferred from the 24-parameter schema.

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?

Three tight sentences with the core capability front-loaded and the mode-specific model defaults stated up front. Nothing is wasted, though the last sentence could be trimmed since it echoes the schema.

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

Completeness3/5

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

For a 24-parameter, multi-provider generation tool with no output schema, the description covers what it does but not the practical consequences of provider choice, credit consumption, or return format. The rich schema compensates for much of the parameter surface, but an agent still lacks the context needed to call it confidently without reading every field.

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

Parameters3/5

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

Schema description coverage is 92%, so the schema already explains nearly every parameter, establishing a baseline of 3. The description adds only the default-model mapping, which is largely duplicated in the model parameter's own description, so it contributes little meaning beyond the schema.

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

Purpose4/5

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

The description uses specific verbs and resources: 'generate an image from a text prompt' and 'transform an existing image,' and it explicitly names image-to-image support. That clearly separates it from siblings like img2txt and txt2vid, though it never names an alternative tool to route away from.

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

Usage Guidelines3/5

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

Mentioning the default model per mode implicitly tells the agent which mode is selected by supplying (or not supplying) an input image, which is useful implied guidance. However, there is no explicit when-to-use/when-not guidance, no note about which sibling to prefer for the reverse direction, and no cost or credit guidance beyond the schema's test_mode field.

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