Replace a background
"Put this sofa in a sunlit Scandinavian living room with oak floors"
Turns one studio shot into a whole catalogue of settings without a photographer.
edit_image · POST /playground/edit · ~10 credits
No mask, no layers, no selection tool. Send the picture and a sentence about what should be different, and the edited version comes back as a hosted URL. It is the same operation whether your Node service calls it or your coding agent does.
Each of these is one request. The prompt column is the whole instruction — there is no second step where someone opens Photoshop.
"Put this sofa in a sunlit Scandinavian living room with oak floors"
Turns one studio shot into a whole catalogue of settings without a photographer.
"Remove the traffic cone in the bottom right and fill the pavement naturally"
Cleans up stock and user-submitted photos before they reach a page.
"Redraw this photograph as a flat vector illustration in two colours"
Brings mismatched imagery into one house style across a site.
"Brighten the exposure, warm the white balance, sharpen the label text"
The boring corrections that otherwise queue up behind a designer.
"Add steam rising from the cup, keep everything else identical"
Small additions that would otherwise mean regenerating the whole image.
aspectRatio: "21:9" with "extend the scene left and right"
One asset becomes a hero banner, a card and a social preview.
Two required fields — the image and the prompt. The image can be a public https URL or a base64 data URI, so an agent can edit something it just generated without ever writing it to disk.
curl -X POST "https://api.imagemcpserver.com/playground/edit" \
-H "Authorization: Bearer $IMAGEMCP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "https://cdn.example.com/product/chair-raw.jpg",
"prompt": "Remove the price tag and place the chair on a
seamless cream backdrop with a soft shadow",
"action": "edit"
}'Name what stays, not just what changes
Adding "keep the composition and lighting identical" stops the model rebuilding the whole frame around one small fix.
One change per call
Two unrelated instructions in one prompt is where results get muddy. Chain two calls instead — the second edits the output URL of the first.
Leave aspectRatio alone by default
Setting it re-frames the picture. Omit it and the source dimensions survive the edit untouched.
Feed the style back in
Put your last approved asset in referenceImages so edit number nine still matches edit number one.
The output URL of one tool is valid input to the next, which is what lets an agent run a whole asset pipeline without a human in the loop.
generate_image
Draft the scene from a prompt.
edit_image
Fix the one thing that is wrong.
remove_background
Cut the subject out cleanly.
compress_image
Ship it at a sensible file size.
Running four sequential calls costs four round trips. If the steps are independent — ten product photos, all needing the same treatment — send them together through multicall and they execute in parallel. See the batch endpoint.
No. You describe the region in words — "replace the sky with an overcast morning", "remove the person on the left" — and the model resolves what to change. That is what makes the endpoint usable by an agent that has no cursor.
Only if you ask it to. Leave aspectRatio out and the source dimensions are preserved. Setting it deliberately re-frames the picture, which is how you turn a square product shot into a 16:9 banner.
It picks the mode: edit for general changes, inpaint for a localised fix, remove_bg for a cutout, upscale for resolution. remove_bg and upscale are also available as their own tools with their own flat prices, which is usually the clearer choice.
Yes — pass referenceImages alongside the source. The extra images steer palette, lighting and treatment, so a batch of ten edits comes back looking like one set rather than ten unrelated pictures.
The cost of the model the call routes to, around 10 credits on the default. With your own OpenRouter key connected on a paid plan it is a flat 2 credits and OpenRouter bills you for the model.
Thirty credits a month, free, no card. Enough to work out whether prompt-driven editing belongs in your pipeline before you pay for it.