Skip to main content
Glama

ref_edit

Edit a photo by reference to preserve the subject's identity while applying only the described change. The canvas follows reference #1 by default.

Instructions

Edit a photo by reference: same local engine, but the ref_images channel is forced on, which keeps the subject's identity intact instead of re-imagining it (a plain generate_image with one reference also works; this tool simply cannot fall back). Describe ONLY the change you want -- 'same person, change the hairstyle to a short bob'. The canvas follows reference #1 by default. Strength, mask and negative prompt do not exist on this channel; use redraw_image when you need them.

Input Schema

NameRequiredDescriptionDefault
cfgNoGuidance / CFG scale for this call. Same as params.cfg.
seedNo-1 for random; a fixed seed reproduces an image.
countNoNumber of images (1-4 recommended).
guardNoKeep the automatic size guard (area floor, VRAM-aware long edge) for a size the tool picks itself. Set false to submit exactly the size given. Explicit width/height is honoured either way; only the engine's hard limits still apply.
modelNoModel override for multi-model engines.
stepsNoSampling steps. Defaults to the engine's own default.
widthNoPixel width. Used exactly as given (multiples of 8 are cleanest); only the engine's own limit (64-4096 per edge) can change it. Omitted = the engine default.
aspectNoAspect preset used when width/height are omitted; the tool then sizes the image itself and applies its VRAM-aware long edge.
heightNoPixel height. Same contract as width. Omitted = the engine default.
paramsNoAny workflow parameter, applied to THIS call only. Names: cfg, img_cfg, steps, sampler, scheduler, flow_shift, shifted_timestep, eta, distilled_guidance, slg_scale, clip_skip, strength, seed, count. Folded groups: slg_layers/slg_layer_start/slg_layer_end, hires_enabled/hires_upscaler/hires_target_width/hires_target_height/hires_steps/hires_denoising_strength/hires_upscale_tile_size/hires_scale/hires_custom_sigmas (upscaler names are engine spellings, e.g. 'Latent (nearest)'), vae_tiling/vae_tile_size_w/vae_tile_size_h/vae_rel_size_w/vae_rel_size_h/vae_target_overlap/vae_temporal_tiling/vae_extra_tiling_args, output_format (png/jpeg/webp)/output_compression, high_noise_steps/high_noise_cfg/high_noise_sampler, custom_sigmas/extra_sample_args/lora. Values travel in the HTTP payload only -- nothing is written to LocModel's config.
promptYesPositive prompt. English is strongly recommended; include subject, environment, lighting, camera/lens and style.
dry_runNoValidate and build the payload, return it with the size notes and the live engine limits, submit nothing. Use it to confirm how a parameter or size will land.
samplerNoSampler name, e.g. euler / dpm++2m.
timeout_sNoJob timeout in seconds.
output_dirNoAbsolute directory for the image files. Omit to use the working directory's ./output folder.
filename_prefixNoSemantic filename prefix, e.g. architecture_court.
negative_promptNoWhat to avoid. A quality-oriented default is applied when omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.1.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and delivers real behavioral facts: the channel cannot fall back, canvas defaults to reference #1, and strength/mask/negative prompt are unavailable. It stops short of saying what happens if an agent passes the schema-exposed negative_prompt or params.strength anyway (error, ignored, silently overridden), which leaves an unresolved ambiguity.

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

Conciseness5/5

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

Three sentences, zero waste: capability statement, prompting instruction, then capability limits plus the escape hatch to a sibling. Behavioural constraints are front-loaded ahead of the alternative-tool routing.

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 17-parameter generation tool with a nested params object and no output schema, the description covers the core execution contract well. It is silent on job lifecycle (synchronous return vs. a job handle that job_status/cancel_job would follow) and on what happens with multiple ref_images beyond #1, which are the remaining gaps.

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; the description earns above that by adding meaning to prompt (delta-only phrasing with a worked example) and to ref_images ordering (the canvas follows reference #1). It does not explain how to target a later reference when the edit should key off image #2 or #3.

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?

States a specific verb and resource (edit a photo by reference) and immediately names the differentiating mechanism: the ref_images channel is forced on, preserving subject identity. It also distinguishes itself from generate_image ('simply cannot fall back') and from redraw_image, so an agent can pick it without opening a schema.

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?

Gives explicit routing: use generate_image with one reference if a fallback is acceptable, use redraw_image when strength/mask/negative prompt are needed, use this tool when identity must hold. It also tells the agent how to phrase the call ('Describe ONLY the change you want') with a concrete example.

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