This page covers the mechanics of editing an existing image through Muapi's API: instruction-based edits from a plain-text prompt, masked region edits, multi-image reference composition, and character-consistency workflows. For picking which model to use by quality, price, or use case, see the AI Image API comparison instead — this page is about how the request works, not which model wins.
Muapi's image-editing models fall into three input patterns. Instruction edits take a source image_url (or several, via images_list) plus a text prompt describing the change — "make the sky sunset orange," "add a hat," "combine these two product shots." Masked edits add a mask_image_url that constrains the change to a specific region, leaving everything outside the mask untouched. Reference-driven edits use one or more input images to preserve a subject or character's identity while generating a new scene around it.
Muapi exposes 70+ image-editing models — FLUX Kontext, Nano Banana, Qwen Image Edit, GPT-4o, Ideogram, MiniMax, and more — through the same unified REST pattern: one API key, one request/poll flow, pay-per-generation pricing with no subscription.
Use an instruction edit (FLUX Kontext, Nano Banana Edit, Qwen Image Edit Plus, ByteDance SeedEdit) when the change is describable in a sentence and doesn't need pixel-precise boundaries — a style change, an added object, a background swap. Use a masked edit (GPT-4o Edit, AI Object Eraser) when the change must stay confined to an exact region — removing an object cleanly, replacing only a specific area without disturbing the rest of the composition. Use a reference edit (MiniMax Subject Reference, Ideogram Character, FLUX PuLID) when the goal is keeping a specific subject or character recognizable across a brand-new generated scene, rather than editing the original photo's pixels directly. Reframing (Ideogram v3 Reframe) is a fourth, narrower pattern — no prompt at all, just a target aspect ratio, outpainting the canvas without touching existing content.
Takes multiple reference images (images_list) plus a prompt and an explicit resolution control for high-fidelity composited edits.
Instruction-based editing from multiple reference images at once — combine, restyle, or merge elements across inputs.
Multi-image instruction editing with explicit width/height output control instead of an aspect-ratio enum.
Accepts a mask_image_url to constrain the edit to a specific region — the standard pattern for targeted local edits.
Purpose-built mask-driven removal — paint the region to erase and the model fills it in, no text prompt required.
Keeps a subject's identity consistent across a new prompt-driven scene from a single reference image.
Character-consistency editing tuned specifically for keeping a character recognizable across multiple generated scenes.
No prompt needed — takes an image and a target aspect_ratio and outpaints the canvas to fit, without touching the original content.
POST /api/v1/upload_file if you don't already have one.images_list-based models, order matters — the first image is typically treated as the primary subject/base, later images as references or elements to incorporate.aspect_ratio or width/height pair rather than inheriting the source image's dimensions automatically.POST /api/v1/upload_file, or use any publicly reachable URL.POST /api/v1/{model-slug} with image_url (or images_list) and a prompt, plus a mask_image_url if the model supports masked edits.GET /api/v1/predictions/{request_id}/result until status is completed, then download the edited image.curl -X POST https://api.muapi.ai/api/v1/gpt4o-edit \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"image_url": "https://example.com/photo.jpg",
"mask_image_url": "https://example.com/mask.png",
"prompt": "replace the masked region with a clear blue sky"
}'import requests
response = requests.post(
"https://api.muapi.ai/api/v1/gpt4o-edit",
headers={"x-api-key": "YOUR_API_KEY"},
json={
"image_url": "https://example.com/photo.jpg",
"mask_image_url": "https://example.com/mask.png",
"prompt": "replace the masked region with a clear blue sky",
},
)
request_id = response.json()["request_id"]
result = requests.get(
f"https://api.muapi.ai/api/v1/predictions/{request_id}/result",
headers={"x-api-key": "YOUR_API_KEY"},
)
print(result.json())It depends on quality, price, and use case — see the AI Image API comparison for a full ranked breakdown. This page covers the request mechanics common across all of them.
An instruction edit describes the change in a text prompt and lets the model decide what to change (FLUX Kontext, Nano Banana Edit). A masked edit constrains the change to an exact region via a mask image, leaving everything outside the mask untouched (GPT-4o Edit, AI Object Eraser).
Yes — models that accept images_list (FLUX Kontext, Nano Banana Edit, Qwen Image Edit Plus, Vidu Q2 Reference) take multiple input images and compose or reference them in the output.
Use a reference-driven model — Ideogram Character, MiniMax Subject Reference, or FLUX PuLID — with the same source image across multiple prompts to preserve the subject's identity in each new scene.
Yes — Ideogram v3 Reframe takes just an image and a target aspect_ratio and outpaints the canvas to fit, without touching the existing content.
Yes. Sign up at muapi.ai, create an API key from your dashboard, and start calling any image-editing model immediately — no waitlist required.