Unlimited Open Source Models

Get Plan
Skip to main content
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.

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.

EndpointOperationKey fields
POST /api/v6/image_editing/object_removalRemove an object by nameinit_image, object_name
POST /api/v6/image_editing/inpaintFill or replace a masked regioninit_image, mask_image, prompt
POST /api/v6/image_editing/outpaintExtend the canvas beyond the frameinit_image, prompt
POST /api/v6/image_editing/background_replacerSwap the background from a descriptioninit_image, prompt
POST /api/v6/image_editing/super_resolutionUpscale with super-resolutioninit_image, model_id, scale
POST /api/v6/image_editing/relightingChange the lighting of a sceneinit_image, prompt
POST /api/v6/image_editing/flux_editPrompt-based edit with Flux Kontextinit_image, prompt
POST /api/v6/image_editing/qwen_editPrompt-based edit with Qwen Image Editinit_image, prompt
POST /api/v6/image_editing/mask_creatorGenerate a mask for inpaintinginit_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
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])

JavaScript — inpaint a masked region

JavaScript
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]);

cURL — replace a background, then upscale

bash
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 }'

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.

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:

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

Catalogue Normalisation

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

GDPR Compliant

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

View Docs

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

Explore Plugins for Pro

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

API

Build Apps with
ML
API

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