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

Plans from $21 a month

Basic is $21/month and Standard $47/month; self-hosted image models cost $0.0047 per image from that allowance. Open Source Unlimited is $149/month with no per-image charge on self-hosted models. Every plan covers Flux, SDXL and 10,000+ community models. Cancel anytime.

100% refund policy on monthly & yearly plans — cancel anytime

Contact Sales
Best Value

Open Source Unlimited

Mission-Critical

$149/month

100% refund policy · cancel anytime

Unlimited Open Source Models
100% refund policy
24x7 Support
15 parallel generations
Access to all APIs
Unlimited generations on all open-source models
For mission critical workloads
Add Team Members
Priority GPU Clusters
Most Popular

Standard

Production

$47/month

100% refund policy · cancel anytime

Moderate Traffic
100% refund policy
Priority Developer Support
10 concurrent API requests
For Production workloads
API access to all models
Prototype

Basic

Prototype

$21/month

100% refund policy · cancel anytime

Moderate Traffic
100% refund policy
Developer Support via Discord/Email
5 concurrent API requests
API access to all models
Shared GPU
Testimonials

Trusted by 450+ teams on dedicated GPUs

See how developers and engineering teams scale generative pipelines with ModelsLab.

ModelsLab's Voice Cloning and Audio APIs revolutionized how we approach character development in our games. It's like having a full studio of voice actors running on dedicated infrastructure.

Alex Rivera

Alex Rivera

Lead Game Developer at Voxel Studios

The LLM and image generation APIs made multi-model pipelines trivial. One unified API key replaced four separate vendor contracts and cut our queue latency in half.

John Hernandez

John Hernandez

AI Systems Architect at Synthetix AI

The ease of creating lifelike voiceovers for our e-learning courses has dramatically increased engagement. 99.9% uptime and instant API response have made it essential to our stack.

Priya Singh

Priya Singh

Instructional Designer at LearnStream Media

Dedicated GPU clusters gave our production pipelines the throughput we needed without unpredictable rate limits or cold starts. Excellent developer experience.

Michael Chen

Michael Chen

Digital Marketing Manager at Nexus Studio

All image editing API models

28 models, most used first. Prices are the billed rate per unit.

ModelProviderTaskPriceAdded
Flux Klien 9BModelsLabImage to image$0.0047 per image
Gemini 2.5 Flash (nano banana)GoogleImage to image$0.0468 per image
Nano Banana ProGoogleImage to image$0.18 per image
Grok Imagine Image EditxAIImage to image$0.03 per image
Qwen Image Edit 2511ModelsLabImage editing$0.022 per image
Seedream 5.0 Lite Image EditBytePlusImage to image$0.04 per image
QwenModelsLabImage to image$0.0047 per image
Nano Banana 2 Image EditGoogleImage to image$0.1 per image
Flux Kontext ProBFLImage to image$0.048 per image
Seedream 4.5 Image to imageBytePlusImage to image$0.06 per image
GPT Image 2.0 Image EditOpenAIImage to image$0.3 per image
Seedream 4.0 Image to imageBytePlusImage to image$0.04 per image
Wan 2.7 Image EditAlibabaImage to image$0.03 per image
Flux 2 Max Image EditingBFLImage to image$0.24 per image
Qwen Image 2.0 Pro Image EditAlibaba CloudImage to image$0.075 per image
Qwen 2.1 Realtime Image EditingModelsLabImage to imageFrom $0.01 per generation
Flux Kontext DevModelsLabImage to image$0.0047 per image
Gen4 Image turboRunway MLImage to image$0.025 per image
Seedream 5.0 Pro Image To ImageBytePlusImage to image$0.054 per image
Grok Imagine Image 2.0 Image EditingxAIImage to imageFrom $0.072 per generation
GPT-Image-2.5 Sunburst - Image EditOpenAIImage to image$0.1 per image
GPT Image 2.5 Flare Image EditOpenAIImage to image$0.1 per image
Nano Banana 2.1 Image EditingGoogleImage to imageFrom $0.0464 per generation
Flux 3 Image EditBFLImage to imageFrom $0.0256 per generation
Qwen Image 3.0 Image EditAlibaba CloudImage to image$0.075 per image
Ideogram 4.5 Precise Image EditModelsLabImage to imageFrom $0.036 per generation
Out PaintingModelsLabOutpainting$0.0047 per image
Remove BackgroundModelsLabBackground removal$0.0047 per image
See all image models

Get expert support

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.