Skip to main content
Glama

Edit Image (OpenRouter)

pixara_edit_image

Edit or transform an image using a text prompt and reference images. Supports local files, URLs, or base64 inputs, and saves the edited image to disk.

Instructions

Edit or transform an existing image using a text prompt and one or more reference images, via any image-to-image-capable model on OpenRouter.

This calls OpenRouter's Image API with input_references and saves the resulting image(s) to disk. Reference images can be a local file path, a remote URL, or raw base64 — this tool handles reading/encoding local files itself, so you never need to pre-encode anything.

Args:

  • model (string): Must support image-to-image, e.g. 'openai/gpt-image-1' or 'bytedance-seed/seedream-4.5'. Check with pixara_get_model_details first if unsure.

  • prompt (string): Instruction describing the desired edit/transformation.

  • input_references (array, required, 1+): Each entry is one of: { source: "file", path: "/abs/or/relative/path.png" } { source: "url", url: "https://example.com/photo.jpg" } { source: "base64", data: "", media_type: "image/png" }

  • n, resolution, aspect_ratio, size, quality, output_format, background, output_compression, seed, provider_options, output_dir, filename_prefix: same meaning as in pixara_generate_image.

Returns: Markdown summary listing each saved file's path, media type, size in bytes, and the total cost charged by OpenRouter for the request.

Examples:

  • Use when: "Make this photo look like a watercolor painting" with a local file path

  • Use when: "Remove the background from this product photo" with a URL reference

  • Don't use when: there's no reference image at all (use pixara_generate_image)

Error Handling:

  • "Could not read reference image" -> check the file path is correct and readable

  • "Bad request" -> the chosen model may not support img2img; verify with pixara_get_model_details

  • "Insufficient OpenRouter credits" -> add credits at https://openrouter.ai/credits

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoNumber of images to generate (1-10). Not all models support n > 1.
seedNoSeed for deterministic generation, where supported.
sizeNoConvenience shorthand for either a tier ('2K') or explicit dimensions ('2048x2048'). Don't combine with 'resolution' or 'aspect_ratio'.
modelYesOpenRouter model slug, e.g. 'black-forest-labs/flux-1.1-pro' or 'openai/gpt-image-1'. Use pixara_list_image_models to discover available models.
promptYesText description of the desired image.
qualityNoQuality tier: 'auto', 'low', 'medium', or 'high'.
backgroundNoBackground handling: 'auto', 'transparent', or 'opaque'. 'transparent' requires output_format 'png' or 'webp'.
output_dirNoDirectory to save generated images into. Defaults to OPENROUTER_IMAGE_OUTPUT_DIR.
resolutionNoResolution tier: '512', '1K', '2K', or '4K'. Don't combine with 'size'.
aspect_ratioNoAspect ratio, e.g. '16:9' or '1:1'. Don't combine with 'size'.
output_formatNoOutput image format: 'png', 'jpeg', or 'webp'.png
filename_prefixNoPrefix for saved image filenames (default: 'openrouter-image').
input_referencesYesReference image(s) to edit/transform. Each entry is a local file path, a remote URL, or raw base64 data — the tool handles reading/encoding for you.
provider_optionsNoProvider-specific passthrough params, keyed by provider slug, e.g. { 'black-forest-labs': { steps: 40, guidance: 3 } }. Check pixara_get_model_details for each provider's allowed_passthrough_parameters before using this.
output_compressionNoCompression level 0-100, only applies to 'webp'/'jpeg' output_format.
Behavior5/5

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

Annotations (readOnlyHint=false, destructiveHint=false) are supplemented by the description's disclosure that the tool saves images to disk, handles encoding of local files, and returns a Markdown summary. It also includes error handling details. No contradictions.

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 description is well-structured with sections (general, Args, Returns, Examples, Error Handling). It is comprehensive but not excessively long. Could be slightly more concise, but it earns its place.

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?

Given the tool's complexity (15 params, nested objects, no output schema), the description covers purpose, usage, all parameter categories, return format, and error scenarios. It is sufficiently complete for an AI agent to invoke correctly.

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 description coverage is 100%, so baseline is 3. The description adds value by explaining the three input_reference source types (file, url, base64) and automating local file reading. It groups some parameters by referencing pixara_generate_image, which is efficient but assumes knowledge of that tool.

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 clearly states it edits/transforms an existing image using a text prompt and reference images. It specifies the action (edit/transform), resource (image), and method (via OpenRouter). It distinguishes from sibling pixara_generate_image by noting when not to use it (no reference image).

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

Usage Guidelines5/5

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

The description provides explicit examples ('Use when: ...', 'Don't use when: ...') and advises checking model capabilities with pixara_get_model_details before selecting a model. This gives clear guidance on when to invoke this tool vs alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pinkpixel-dev/pixara-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server