Skip to content
Inferlane

Guides, 11 of 17

Guide: image editing

Send a source image with an instruction and read the edited result.

How editing works

Editing models take a source image and a plain instruction. The source goes in an image_url input: a public URL, a path on this site, or a data URI (see Files and inputs). The edited image comes back in the same images shape as text to image.

Image editing models

Every model below takes the same three calls. Prices come from the catalog and are billed per image or per the unit shown.

google/nano-banana-pro-edit$0.15 / image
Nano Banana Pro Edit. Edit an image with plain instructions: change materials, colors, lighting or remove objects.
black-forest-labs/flux-kontext-pro$0.04 / image
FLUX.1 Kontext [pro]. In context image editing from Black Forest Labs that keeps characters and objects consistent.
qwen/qwen-image-edit$0.03 / megapixel
Qwen Image Edit. Open weights editing model for semantic and appearance edits, including text inside images. Open weights.
bytedance/seedream-4-edit$0.03 / image
Seedream 4.0 Edit. ByteDance's editing model: change materials, add or remove objects and restyle with plain instructions.

Inputs of Nano Banana Pro Edit

This walkthrough uses google/nano-banana-pro-edit. Its inputs, read from the same schema that GET /models/google/nano-banana-pro-edit returns:

promptstring, required
Describe the edit, for example: make the bottle sage green.
image_urlimage_url, required
Source image. A public URL or a data URI.
resolutionenum
Output resolution. One of 1K, 2K, 4K. Default "1K".
output_formatenum
File format of the result. One of png, jpeg, webp. Default "png".

Submit the request

curl -X POST "https://inferlane.net/api/v1/queue/google/nano-banana-pro-edit" \
  -H "Authorization: Key $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Make the bottle sage green and keep everything else the same","image_url":"/media/outputs/product-1x1.webp","resolution":"1K"}'

The answer is 202 with a request_id. Keep it: export REQUEST_ID="...".

Poll until it completes

Poll the status about once a second. A Nano Banana Pro Edit request completes in about 3.9 seconds.

curl "https://inferlane.net/api/v1/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $API_KEY"

Read the result

curl "https://inferlane.net/api/v1/requests/$REQUEST_ID" \
  -H "Authorization: Key $API_KEY"
200 OK
{
  "request_id": "Z29vZ2xlL25hbm8tYmFuYW5hLXByby1lZGl0fG11cXpkMHZzfDF8YmZiMjc4ODh8MWNlN2Y1",
  "model_id": "google/nano-banana-pro-edit",
  "status": "COMPLETED",
  "sample": true,
  "output": {
    "images": [
      {
        "url": "https://inferlane.net/media/outputs/edit-1x1.webp",
        "width": 1024,
        "height": 1024,
        "content_type": "image/webp"
      }
    ],
    "seed": 4242
  },
  "billing": {
    "unit": "image",
    "quantity": 1,
    "unit_price": 0.15,
    "amount": 0.15,
    "currency": "USD",
    "sample": true
  },
  "timings": {
    "queue_ms": 900,
    "inference_ms": 3000
  },
  "submitted_at": "2026-10-02T13:09:55.000Z",
  "completed_at": "2026-10-02T13:09:58.900Z"
}

Nano Banana Pro Edit is priced at $0.15 / image. Each image returned. Asking for four images bills four. This request bills a quantity of 1, so billing.amount is 0.15 USD.

The whole flow in one script

# 1. Submit the request and keep its request_id
REQUEST_ID=$(curl -s -X POST "https://inferlane.net/api/v1/queue/google/nano-banana-pro-edit" \
  -H "Authorization: Key $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "Make the bottle sage green and keep everything else the same",
  "image_url": "/media/outputs/product-1x1.webp",
  "resolution": "1K"
}' \
  | sed -n 's/.*"request_id": *"\([^"]*\)".*/\1/p')

# 2. Poll the status about once a second until it is COMPLETED
until curl -s "https://inferlane.net/api/v1/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $API_KEY" | grep -q '"status": "COMPLETED"'; do
  sleep 1
done

# 3. Fetch the result
curl "https://inferlane.net/api/v1/requests/$REQUEST_ID" \
  -H "Authorization: Key $API_KEY"

Chain a generated image into an edit

Pass the URL of a previous result straight into the next model. In JavaScript, after a text to image request completes:

JavaScript
// result is the completed text to image result body
const source = result.output.images[0].url;

const res = await fetch(`${API_BASE}/queue/google/nano-banana-pro-edit`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    prompt: "Make the bottle sage green and keep everything else the same",
    image_url: source,
  }),
});
const { request_id } = await res.json();
Result URLs stay readable for 24 hours. Download anything you want to keep.

Background removal and upscaling take an image and return a single image object instead of an array. Two examples from the catalog:

bria/rmbg-2$0.018 / image
BRIA RMBG 2.0. Background removal model trained on licensed data, with weights available for non commercial use. Open weights.
topaz/image-upscale$0.02 / megapixel
Topaz Image Upscale. Upscale photos up to 6x with Topaz enhancement models while keeping natural texture.
curl -X POST "https://inferlane.net/api/v1/queue/bria/rmbg-2" \
  -H "Authorization: Key $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image_url":"/media/outputs/product-1x1.webp"}'