Models/AI Image Editing API

AI Image Editing API — Instruction Edits, Masking, and Reference Inputs

Live70+ image-editing models

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.

Three Ways to Edit an Image

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.

Instruction Edits vs. Masked Edits vs. Reference Edits

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.

Representative Models

GoogleMulti-Image

Nano Banana Pro Edit

Takes multiple reference images (images_list) plus a prompt and an explicit resolution control for high-fidelity composited edits.

Image in
$0.12/generation
Try Model
Black Forest LabsMulti-Image

FLUX Kontext Pro

Instruction-based editing from multiple reference images at once — combine, restyle, or merge elements across inputs.

Image in
$0.03/generation
Try Model
AlibabaMulti-Image

Qwen Image Edit Plus

Multi-image instruction editing with explicit width/height output control instead of an aspect-ratio enum.

Image in
$0.03/generation
Try Model
OpenAIMasked

GPT-4o Edit

Accepts a mask_image_url to constrain the edit to a specific region — the standard pattern for targeted local edits.

Image in
$0.04/generation
Try Model
MuapiMasked

AI Object Eraser

Purpose-built mask-driven removal — paint the region to erase and the model fills it in, no text prompt required.

Image in
$0.05/generation
Try Model
MiniMaxReference

MiniMax Subject Reference

Keeps a subject's identity consistent across a new prompt-driven scene from a single reference image.

Image in
$0.01/generation
Try Model
IdeogramReference

Ideogram Character

Character-consistency editing tuned specifically for keeping a character recognizable across multiple generated scenes.

Image in
$0.15/generation
Try Model
IdeogramReframe

Ideogram v3 Reframe

No prompt needed — takes an image and a target aspect_ratio and outpaints the canvas to fit, without touching the original content.

Image in
$0.15/generation
Try Model

Source Upload and Prompt Structure

  • Upload or link the source image(s). Every model accepts a public URL; use POST /api/v1/upload_file if you don't already have one.
  • Multi-image models expect an ordered list. On 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.
  • Masks are binary region maps. A mask image marks the editable region (commonly white = edit, black = keep) — check each model's exact convention before submitting.
  • Instructions should describe the change, not the whole scene. Since the source image already fixes the composition, an instruction like "change the jacket to red leather" performs better than re-describing the entire photo.
  • Output resolution/aspect ratio is often independently controllable — some models take an explicit aspect_ratio or width/height pair rather than inheriting the source image's dimensions automatically.

How to Call an Image Editing Model

  1. Host the source image(s). Upload via POST /api/v1/upload_file, or use any publicly reachable URL.
  2. Submit the request. 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.
  3. Poll for completion. Check 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())

Frequently Asked Questions

Which image-editing model should I use?

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.

What's the difference between an instruction edit and a masked edit?

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).

Can I combine multiple images into one edit?

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.

How do I keep a character consistent across multiple edits?

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.

Can I change an image's aspect ratio without cropping content?

Yes — Ideogram v3 Reframe takes just an image and a target aspect_ratio and outpaints the canvas to fit, without touching the existing content.

Can I get Image Editing API access right now?

Yes. Sign up at muapi.ai, create an API key from your dashboard, and start calling any image-editing model immediately — no waitlist required.