by Microsoft

MAI-Image-2.7 edit endpoint: one to five image_urls plus a prompt, about 39 seconds per job, roughly 1K output that keeps the first photo's shape.

microsoft/mai-image-2.7/edit
MAI-Image-2.7 AI Image Generator online
  • Up to 5 reference images
  • Create Image
  • Edit Image

About MAI-Image-2.7

Call this task when the user already has a picture: a season swap, a relight, a new location or a two-photo composite. The body is deliberately small. It requires prompt and image_urls and lists no other properties, so a form that reuses text-to-image state must drop resolution and aspect_ratio before sending, or the payload stops matching the schema.

Call it with the model name microsoft/mai-image-2.7/edit on POST /jobs/createTask, from $0.06168.

Introduction

Surgical single- and multi-image editing

MAI-Image-2.7 Edit takes one to five reference images and applies localized wardrobe, lighting, object, or scene edits without drifting away from the subject's likeness. In our November 25, 2026 live tests, both a 1-image coat replacement and a 2-image stage composite preserved the subject's exact facial geometry and returned 836 x 1254 PNGs matching the source frame.

Practical editing notes

  • Name multi-image roles in upload order ('the first photo', 'the second photo') so background and identity never swap places.

Request parameters

ParameterRequiredDescription
image_urlsYesPhotos to edit or combine. Say in the prompt what each one adds.
promptYesDescribe what you want to make.

Pricing

Prices are in USD and charged to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

OptionUSD per image
Standard$0.05184

Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.

API quick start

Call the MAI-Image-2.7 API in three steps

  1. Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls are billed in USD from your PopNow balance.
  2. Send the request. POST /jobs/createTask with model microsoft/mai-image-2.7/edit and an input object that follows the parameter table. The response returns a task ID straight away.
  3. Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "microsoft/mai-image-2.7/edit",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
    "image_urls": [
      "https://media.popnow.ai/influencer/examples/marco.webp"
    ]
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.

About the MAI-Image-2.7 Edit Image endpoint

image_urls holds one to five public links in JPEG, PNG, WebP or GIF. Position carries the meaning: the prompt talks about image 1 and image 2, and the array order is the only place that mapping lives. Persist the ordered list together with the instruction so a later rerun, audit or support ticket can see which file played the person and which played the background.

Plan for the delivered size. In our November 2026 runs on PopNow, a 1543 × 2048 portrait and a two-photo composite both came back at 896 × 1184, the same 3:4 shape as the first input with far fewer pixels. Read dimensions from the result, and offer an upscale step or a fresh 2K text-to-image render when the edit has to fill a print layout.

Wording that held up: list what stays fixed (face, hair, coat, pose, camera angle) before what changes. The winter edit kept earrings, hands in pockets and the wall lettering untouched and altered only weather, ice and breath. In the composite, asking for light that matches the second photo moved the subject into its pink dusk rather than pasting her in with grey pool light.

The price has two parts: a flat rate for the edit and a surcharge for every extra URL after the first. Recalculate whenever the user adds or removes a reference, keep the accepted maximum with the job, and show the settled costUsd separately once the callback lands. A text-to-image quote is not a valid stand-in here, because the edit rate is its own line in the catalog.

Both test jobs finished in about 39 seconds including queue time. Submit with an Idempotency-Key, save the taskId against the draft, and wait on a verified callback or recordInfo polling. On invalid_asset, replace only the failed file and keep its slot. On content_rejected, tell the user which picture or phrase to change rather than silently retrying the same set.

MAI-Image-2.7 API questions

How much does the MAI-Image-2.7 API cost?

MAI-Image-2.7 starts at $0.06168 per image with Edit Image, its lowest-priced task. API usage is charged in USD to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

What are the limits of the MAI-Image-2.7 · Edit Image API?

Reference images: 5; Prompt length (characters): 10,000. Requests outside these limits are rejected before anything is charged.

More about MAI-Image-2.7