---
title: Image Editing API — Inpaint, Remove BG, Upscale | ModelsLab
description: Image editing API: inpainting, outpainting, object removal, background replacement, upscaling and relighting on one REST endpoint. Plans from $21/month.
url: https://modelslab.com/image-editing-api
canonical: https://modelslab.com/image-editing-api
type: website
component: Seo/ImageEditingApi
generated_at: 2026-09-16T12:02:19.198417Z
---

Imagen

Image Editing API for Developers
---

Inpainting, outpainting, object removal, background replacement, upscaling and relighting — each one a POST request, all on one key. Image plans from $21/month for 3,250 API calls.

[Get API Key — $21/Month](https://modelslab.com/register) [API Documentation](https://docs.modelslab.com)

What the Image Editing API Covers
---

### Editing, Not Just Generation

Most image APIs stop at text-to-image. The ModelsLab image editing API is the set of endpoints that change an image you already have: fill or replace a masked region, extend the canvas, remove an object by name, swap the background, upscale with super-resolution, relight the scene, or apply a prompt-based edit with the Flux and Qwen editing models.

Each operation is its own endpoint under /api/v6/image\_editing/. Requests take a hosted image URL, responses return one, so a pipeline is a sequence of POSTs on the same key with no intermediate uploads.

### Where It Fits

E-commerce catalogues that need every product on the same background, marketplaces that clean user uploads, creative tools that expose “remove this” and “extend the frame” as buttons, and pipelines that upscale generated images before print. The editing endpoints sit next to text-to-image, so a generated image can be edited in the same run.

- Inpaint and outpaint with a prompt and an optional mask
- Object removal by name — no mask required
- Background replacement from a text description
- Super-resolution upscaling for print and large formats
- Relighting to match a scene or a product shot
- Prompt-based edits with Flux and Qwen editing models

One Endpoint per Operation
---

Every operation lives under /api/v6/image\_editing/. Send an image URL, get an image URL back.

| Endpoint | Operation | Key fields |
|---|---|---|
| POST /api/v6/image\_editing/object\_removal | Remove an object by name | init\_image, object\_name |
| POST /api/v6/image\_editing/inpaint | Fill or replace a masked region | init\_image, mask\_image, prompt |
| POST /api/v6/image\_editing/outpaint | Extend the canvas beyond the frame | init\_image, prompt |
| POST /api/v6/image\_editing/background\_replacer | Swap the background from a description | init\_image, prompt |
| POST /api/v6/image\_editing/super\_resolution | Upscale with super-resolution | init\_image, model\_id, scale |
| POST /api/v6/image\_editing/relighting | Change the lighting of a scene | init\_image, prompt |
| POST /api/v6/image\_editing/flux\_edit | Prompt-based edit with Flux Kontext | init\_image, prompt |
| POST /api/v6/image\_editing/qwen\_edit | Prompt-based edit with Qwen Image Edit | init\_image, prompt |
| POST /api/v6/image\_editing/mask\_creator | Generate a mask for inpainting | init\_image |

All endpoints accept a hosted image URL as init\_image and return a hosted URL, so edits chain without re-uploading.

Image Editing API quick start
---

Remove an object, replace a background, upscale — three requests, one key.

### Python — remove an object by name

Python

```
<code>1import requests
2

3response = requests.post(
4    "https://modelslab.com/api/v6/image_editing/object_removal",
5    json={
6        "key": "YOUR_MODELSLAB_API_KEY",
7        "init_image": "https://example.com/product-shot.jpg",
8        "object_name": "price tag",
9    },
10)
11

12# Hosted URL for the edited image
13print(response.json()["output"][0])</code>
```

### JavaScript — inpaint a masked region

JavaScript

```
<code>1const response = await fetch(
2  'https://modelslab.com/api/v6/image_editing/inpaint',
3  {
4    method: 'POST',
5    headers: { 'Content-Type': 'application/json' },
6    body: JSON.stringify({
7      key: 'YOUR_MODELSLAB_API_KEY',
8      init_image: 'https://example.com/room.jpg',
9      mask_image: 'https://example.com/room-mask.png',
10      prompt: 'a mid-century armchair in warm oak',
11    }),
12  },
13);
14

15const data = await response.json();
16console.log(data.output[0]);</code>
```

### cURL — replace a background, then upscale

bash

```
<code>1# 1. Put the product on a studio background
2curl -X POST 'https://modelslab.com/api/v6/image_editing/background_replacer' \
3  -H 'Content-Type: application/json' \
4  -d '{
5    "key": "YOUR_MODELSLAB_API_KEY",
6    "init_image": "https://example.com/product-shot.jpg",
7    "prompt": "clean white studio background, soft shadow"
8  }'
9

10# 2. Pass the returned URL straight into super_resolution
11curl -X POST 'https://modelslab.com/api/v6/image_editing/super_resolution' \
12  -H 'Content-Type: application/json' \
13  -d '{
14    "key": "YOUR_MODELSLAB_API_KEY",
15    "init_image": "https://cdn.modelslab.com/.../edited.png",
16    "model_id": "RealESRGAN_x4plus",
17    "scale": 4,
18    "face_enhance": false
19  }'</code>
```

Ship an Edit Pipeline in 3 Steps
---

From API key to a chained edit in minutes.

STEP 01

STEP 01

### Step 1: Get Your API Key

Create a ModelsLab account, subscribe to an image plan from $21/month for 3,250 API calls, and copy your key from the dashboard.

STEP 02

STEP 02

### Step 2: Send the Image and the Edit

POST a hosted image URL as init\_image to the endpoint for the operation — object\_name for removal, mask\_image plus prompt for inpainting, prompt alone for background replacement or relighting.

STEP 03

STEP 03

### Step 3: Chain the Next Edit

The response carries a hosted URL. Pass it as init\_image to the next endpoint — remove, relight, upscale — in sequential requests on the same key.

[Get API Key ](https://modelslab.com/register)

Related image API guides
---

[### Image Generation API

Generate the image first: 10,000+ models at a flat $0.0047 per image.](https://modelslab.com/image-generation-api) [### AI Avatar API

Styled avatars from a single selfie on the same image\_editing namespace.](/ai-avatar-api) [### Cheapest AI Image API

What image calls cost across plans, including editing operations.](https://modelslab.com/cheapest-ai-image-api)

### Masks Are Optional

Object removal takes the name of the thing to remove and finds it; background replacement segments the subject on its own. When you do need precise control, inpaint accepts a mask URL, and mask\_creator returns a mask from the image when you do not have one. Outpainting extends in the direction the canvas grows, guided by the prompt.

### Pricing

Image plans start at $21/month for 3,250 API calls and $47/month for 10,000. Each editing operation on a self-hosted model is one call. The $149/month Open Source Unlimited plan removes the per-call limit on the open-weight image models ModelsLab self-hosts. There is no separate editing tier.

Why Developers Use the ModelsLab Image Editing API
---

Key advantages that set us apart

Nine editing operations, one namespace, one key

Object removal by name — no mask needed

Hosted URL in, hosted URL out — edits chain

Flux Kontext and Qwen Image Edit for prompt-based edits

Super-resolution upscaling for print

Same plan and key as text-to-image

Image plans from $21/month for 3,250 calls

Self-hosted models with no cold starts

Our Popular Use Cases

What teams automate with the image editing API:

Catalogue NormalisationUser Upload Clean-UpCreative Tool FeaturesReal Estate and InteriorsAd VariationsPrint Preparation

Put every product on the same background and upscale to the listing size, in two requests per SKU.

![Catalogue Normalisation](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/0fbacb1a-6e34-4254-0a9d-5e75178cf200/768)

Image Editing API FAQ
---


Inpainting, outpainting, object removal, background replacement, super-resolution upscaling, relighting and prompt-based edits with Flux and Qwen editing models. Each operation is its own endpoint under /api/v6/image\_editing/.


POST https://modelslab.com/api/v6/image\_editing/object\_removal with init\_image set to the image URL and object\_name describing what to remove. The response carries a hosted URL for the edited image.


Image plans start at $21/month for 3,250 API calls and $47/month for 10,000. Editing operations on self-hosted models are covered by your plan calls; unlimited generation on open-weight image models is $149/month.


Yes. POST /api/v6/image\_editing/inpaint takes init\_image, mask\_image and prompt. If you do not have a mask, POST the image to /api/v6/image\_editing/mask\_creator to generate one.


ModelsLab is a paid service. Image plans start at $21/month for 3,250 API calls. Creating an account is free, but running an edit requires an active plan.


Yes. Every endpoint returns a hosted image URL that the next call accepts as init\_image, so remove a background, relight and upscale in three sequential requests on the same key.

Your Data is Secure: GDPR Compliant AI Services
---

![ModelsLab GDPR Compliance Certification Badge](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/28133112-07fe-4c1c-44eb-36948d51ae00/768)

AI Image API Pricing Starting at $0.0047 Per Image
---

ModelsLab offers subscription plans from $21/month (Basic) and $47/month (Standard, 10,000 API calls) to $149/month (Open Source Unlimited). All plans include access to Flux, SDXL, Stable Diffusion 3, and 10,000+ community models. Choose a paid plan, cancel anytime, 100% refund policy.

Coming Soon
---

We are making some changes to our pricing, please check back later.

Get Expert Support in Seconds

We're Here to Help.
---

Want to know more? You can email us anytime at <support@modelslab.com>

Chat with support[View Docs](https://docs.modelslab.com)


Inpainting, outpainting, object removal, background replacement, super-resolution upscaling, relighting and prompt-based edits with Flux and Qwen editing models. Each operation is its own endpoint under /api/v6/image_editing/.


POST https://modelslab.com/api/v6/image_editing/object_removal with `init_image` set to the image URL and `object_name` describing what to remove. The response carries a hosted URL for the edited image.


Image plans start at $21/month for 3,250 API calls and $47/month for 10,000. Editing operations on self-hosted models are covered by your plan calls; unlimited generation on open-weight image models is $149/month.


Yes. POST /api/v6/image_editing/inpaint takes `init_image`, `mask_image` and `prompt`. If you do not have a mask, POST the image to /api/v6/image_editing/mask_creator to generate one.


ModelsLab is a paid service. Image plans start at $21/month for 3,250 API calls. Creating an account is free, but running an edit requires an active plan.


Yes. Every endpoint returns a hosted image URL that the next call accepts as `init_image`, so remove a background, relight and upscale in three sequential requests on the same key.

Explore Our Other Solutions
---

Unlock your creative potential and scale your business with ModelsLab's comprehensive suite of AI-powered solutions.

[Audio Gen

### AI Audio Generation

Text-to-speech, voice cloning, music generation, and audio processing APIs.

Explore Audio Gen](https://modelslab.com/audio-gen) [Video Fusion

### AI Video Generation & Tools

Create, edit, and enhance videos with AI-powered generation and transformation tools.

Explore Video Fusion](https://modelslab.com/video-generation) [Chat

### Engage Seamlessly with LLM

Access powerful language models for chatbots, content generation, and AI assistants.

Explore Chat](https://modelslab.com/custom-llm) [3D Verse

### Create Stunning 3D Models

Transform images and text into 3D models with advanced AI-powered generation.

Explore 3D Verse](https://modelslab.com/text-to-3d)

Plugins

Explore Plugins for Pro
---

Our plugins are designed to work with the most popular content creation software.

[Explore Plugins](https://modelslab.com/pro#plugins) [Learn More](https://modelslab.com/pro)

API

Build Apps with ModelsLab

ML

 API
---

Use our API to build apps, generate AI art, create videos, and produce audio with ease.

[API Documentation](https://docs.modelslab.com) [Playground](https://modelslab.com/models)

## Frequently Asked Questions

### What can the image editing API do?
Inpainting, outpainting, object removal, background replacement, super-resolution upscaling, relighting and prompt-based edits with Flux and Qwen editing models. Each operation is its own endpoint under /api/v6/image_editing/.

### How do I remove an object from an image via the API?
POST https://modelslab.com/api/v6/image_editing/object_removal with `init_image` set to the image URL and `object_name` describing what to remove. The response carries a hosted URL for the edited image.

### How much does the image editing API cost?
Image plans start at $21/month for 3,250 API calls and $47/month for 10,000. Editing operations on self-hosted models are covered by your plan calls; unlimited generation on open-weight image models is $149/month.

### Does the API accept a mask for inpainting?
Yes. POST /api/v6/image_editing/inpaint takes `init_image`, `mask_image` and `prompt`. If you do not have a mask, POST the image to /api/v6/image_editing/mask_creator to generate one.

### Is there a free image editing API?
ModelsLab is a paid service. Image plans start at $21/month for 3,250 API calls. Creating an account is free, but running an edit requires an active plan.

### Can I chain several edits in one pipeline?
Yes. Every endpoint returns a hosted image URL that the next call accepts as `init_image`, so remove a background, relight and upscale in three sequential requests on the same key.


---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-09-16*