Image

Image APIs use JSON for generation and editing. Only upload uses multipart/form-data.

Endpoints

Method Path Body
POST /v2/image multipartimage_file
POST /v2/image/estimate-credits JSON
POST /v2/image/text-2-image JSON
POST /v2/image/image-2-image JSON — image_url
POST /v2/image/elements JSON — image_urls
POST /v2/image/replace-background JSON
POST /v2/image/edit-image JSON
POST /v2/image/face-swap JSON — image_urls
POST /v2/image/try-on JSON — human + clothes URLs

Workflow

  1. POST /v2/image to host a file, or use any public HTTPS URL.
  2. Call a route with application/json and image_url / image_urls.
  3. Read results on the asset. Use async_mode: true when supported; poll until status is success.

Responses

  • All routes (including upload) → asset object without a data wrapper
  • Output URLs are in results; poll by asset id when async_mode is true

Authentication

X-Api-Key: YOUR_API_KEY on every request.

Legacy form-data routes (with data wrapper on some responses) remain at /image/*, /video/*, /audio/*, and /text/* (tagged (Legacy) in the schema).

Upload Image

Uploads an image file to Vimmerse storage so you can reference it by URL in other POST /v2/image/ routes.

This is the only v2 image route that uses multipart/form-data. All generation and edit routes expect JSON with image_url or image_urls.

Supported formats

JPEG, PNG, WebP (including transparency where supported).

Example

import requests

url = "https://api.vimmerse.net/v2/image"
headers = {"X-Api-Key": "YOUR_API_KEY"}

with open("/path/to/photo.png", "rb") as f:
    response = requests.post(
        url,
        headers=headers,
        files={"image_file": ("photo.png", f, "image/png")},
        timeout=120,
    )

response.raise_for_status()
asset = response.json()
print(asset["results"])  # uploaded file URL(s)
SecurityAPIKeyHeader
Request
header Parameters
Authorization (string) or Authorization (null) (Authorization)
Username (string) or Username (null) (Username)
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type)
Request Body schema: multipart/form-data
image_file
string <binary> (Image)

Upload your image file.

Responses
200

New Image URLs

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/v2/image
Request samples
Response samples
application/json
{
  • "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  • "customer_id": "customer123",
  • "primary_user_id": "user-abc-123",
  • "args": {
    },
  • "thumbnails": [ ],
  • "status": "success",
  • "mime_type": "image/png",
  • "app_name": "text-to-image",
  • "quantity": 1,
  • "credits": 12,
  • "created_at": "2025-05-06T16:35:59.840508+00:00",
  • "updated_at": "2025-05-06T16:36:12.102933+00:00",
  • "history": [ ]
}

Estimate Credits

Returns how many credits an image generation request would charge for the given app_name, option, quantity, and optional prompt, without creating an asset.

Uses the same billing rules as POST /v2/image/ generation routes. Send Content-Type: application/json.

Example

import requests

url = "https://api.vimmerse.net/v2/image/estimate-credits"
headers = {"Content-Type": "application/json"}
payload = {
    "app_name": "text-to-image",
    "option": "NanoBanana",
    "quantity": 2,
    "prompt": "Product photo of running shoes on a gradient background",
}

response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.json())
Request
Request Body schema: application/json
required
app_name
string (App Name)
Default: "text-to-image"

Internal route id stored on the asset record (same as the target POST /image/* route). Available values: text-to-image (default), image-to-image, reimagine, face-swap, replace-bg, edit-image, image-elements, try-on, scene-image, upload-image (0 credits).

option
required
string (Generation Option)

Model/tool option on the target image endpoint (e.g. NanoBanana, AutoI).

quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1
prompt
string (Prompt)
Default: ""

Used for length-based pricing when applicable.

Responses
200

Credit estimate and breakdown

422

Validation Error

post/v2/image/estimate-credits
Request samples
Response samples
application/json
{
  • "total_credits": 0,
  • "breakdown": { }
}

Text to Image

Generates one or more images from a text prompt.

Send Content-Type: application/json. The response is an asset object; output URLs are in results.

Parameters

Field Type Default Description
prompt string Text description of the desired image
quantity integer 1 Number of images (1–4)
option string AutoI Model/tool; AutoI picks automatically
aspect_ratio string 16:9 e.g. 21:9, 16:9, 4:3, 1:1, 9:16
enhance_image boolean false Apply 1× super-resolution post-processing
async_mode boolean false Return immediately with status: processing
webhook_url string Optional callback URL when complete

Example

import requests

url = "https://api.vimmerse.net/v2/image/text-2-image"
headers = {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
}
payload = {
    "prompt": "A serene landscape with mountains and a lake at sunset, cinematic lighting",
    "quantity": 2,
    "option": "AutoI",
    "aspect_ratio": "16:9",
    "enhance_image": False,
    "async_mode": False,
}

response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
asset = response.json()
print(asset["id"], asset["status"], asset["results"])
SecurityAPIKeyHeader
Request
header Parameters
Authorization (string) or Authorization (null) (Authorization)
Username (string) or Username (null) (Username)
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type)
Request Body schema: application/json
required
async_mode
boolean (Async Mode)
Default: false
Webhook URL (string) or Webhook URL (null) (Webhook URL)
prompt
string (Text Prompt)
Default: "Shot of Nike shoes on colorful background"
quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1
option
string (Option)
Default: "AutoI"

If AutoI is selected, one of the options will be selected automatically.

Enum: "AutoI" "Seedream" "NanoBananaT2" "NanoBananaPro" "QwenImage" "GPTImage" "FluxPro" "FluxTurbo" "NanoBanana" "FluxKontextPro" "StableDiffusion3.5"
aspect_ratio
string (Aspect Ratio) ^(\d+):(\d+)$
Default: "16:9"

Available values: ['21:9', '16:9', '4:3', '3:2', '1:1', '2:3', '3:4', '9:16', '9:21']

enhance_image
boolean (Enhance Image)
Default: false

Enhances the image by applying 1× super-resolution during post-processing.

Responses
200

Asset with generated image URL(s) in results

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/v2/image/text-2-image
Request samples
Response samples
application/json
{
  • "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  • "customer_id": "customer123",
  • "primary_user_id": "user-abc-123",
  • "args": {
    },
  • "thumbnails": [ ],
  • "status": "success",
  • "mime_type": "image/png",
  • "app_name": "text-to-image",
  • "quantity": 1,
  • "credits": 12,
  • "created_at": "2025-05-06T16:35:59.840508+00:00",
  • "updated_at": "2025-05-06T16:36:12.102933+00:00",
  • "history": [ ]
}

Image to Image

Transforms or reimagines a source image using a text prompt.

Provide image_url (from upload or any public HTTPS URL). Response asset URLs are in results.

Parameters

Field Type Default Description
image_url string required Source image URL
prompt string "" Desired edits or style
option string AutoI Edit model/mode
aspect_ratio string Optional output ratio
quantity integer 1 Variations (1–4)
enhance_image boolean false Super-resolution post-processing
async_mode boolean false Async processing
webhook_url string Optional callback

Example

import requests

url = "https://api.vimmerse.net/v2/image/image-2-image"
headers = {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
}
payload = {
    "image_url": "https://media.vimmerse.net/example/uploads/shoe.png",
    "prompt": "Make the shoe blue with a sky background",
    "option": "AutoI",
    "aspect_ratio": "16:9",
    "quantity": 1,
}

response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])
SecurityAPIKeyHeader
Request
header Parameters
Authorization (string) or Authorization (null) (Authorization)
Username (string) or Username (null) (Username)
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type)
Request Body schema: application/json
required
async_mode
boolean (Async Mode)
Default: false
Webhook URL (string) or Webhook URL (null) (Webhook URL)
image_url
required
string (Image URL)

URL of the source image.

prompt
string (Prompt)
Default: ""

Text prompt to edit your image.

Aspect Ratio (string) or Aspect Ratio (null) (Aspect Ratio)
quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1

Number of images to generate.

option
string (Option)
Default: "AutoI"
Enum: "AutoI" "Seedream" "NanoBananaT2" "NanoBananaPro" "QwenImage" "GPTImage" "FluxPro" "FluxTurbo" "ImageUtilsDepth" "NanoBanana" "FluxKontextPro" "StableDiffusion3.5"
enhance_image
boolean (Enhance Image)
Default: false

Enhances the image by applying 1× super-resolution during post-processing.

Responses
200

Asset with generated image URL(s) in results

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/v2/image/image-2-image
Request samples
Response samples
application/json
{
  • "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  • "customer_id": "customer123",
  • "primary_user_id": "user-abc-123",
  • "args": {
    },
  • "thumbnails": [ ],
  • "status": "success",
  • "mime_type": "image/png",
  • "app_name": "text-to-image",
  • "quantity": 1,
  • "credits": 12,
  • "created_at": "2025-05-06T16:35:59.840508+00:00",
  • "updated_at": "2025-05-06T16:36:12.102933+00:00",
  • "history": [ ]
}

Elements

Generates or edits an image using a main image plus reference images (characters, objects, environments).

Pass all images as image_urls: the first URL is the main image; the rest are references. Limits depend on option (see field description in the schema).

Example

import requests

url = "https://api.vimmerse.net/v2/image/elements"
headers = {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
}
payload = {
    "image_urls": [
        "https://media.vimmerse.net/example/main.png",
        "https://media.vimmerse.net/example/ref_character.png",
    ],
    "prompt": "Place the character naturally in the scene, photorealistic",
    "option": "AutoI",
    "aspect_ratio": "16:9",
    "quantity": 1,
    "swap_faces": False,
}

response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])
SecurityAPIKeyHeader
Request
header Parameters
Authorization (string) or Authorization (null) (Authorization)
Username (string) or Username (null) (Username)
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type)
Request Body schema: application/json
required
async_mode
boolean (Async Mode)
Default: false
Webhook URL (string) or Webhook URL (null) (Webhook URL)
image_urls
required
Array of strings (Element Image URLs) non-empty

The first image is the main image and the rest are reference images. Max 4 URLs for FluxKontextPro, 6 for Seedream, 8 for FluxPro, and 10 for GPTImage, NanoBanana, and NanoBananaPro.

aspect_ratio
string (Aspect Ratio) ^(\d+):(\d+)$
Default: "16:9"
quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1

Number of images to generate.

option
string (Option)
Default: "AutoI"

Available values: AutoI, FluxPro, Seedream, NanoBananaPro, FluxKontextPro, NanoBanana, and GPTImage.

prompt
string (Prompt)
Default: ""
enhance_image
boolean (Enhance Image)
Default: false

Enhances the image by applying 1× super-resolution during post-processing.

swap_faces
boolean (Swap Faces)
Default: false

Swap the resulting faces with the original faces.

Responses
200

Asset with generated image URL(s) in results

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/v2/image/elements
Request samples
Response samples
application/json
{
  • "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  • "customer_id": "customer123",
  • "primary_user_id": "user-abc-123",
  • "args": {
    },
  • "thumbnails": [ ],
  • "status": "success",
  • "mime_type": "image/png",
  • "app_name": "text-to-image",
  • "quantity": 1,
  • "credits": 12,
  • "created_at": "2025-05-06T16:35:59.840508+00:00",
  • "updated_at": "2025-05-06T16:36:12.102933+00:00",
  • "history": [ ]
}

Replace Background

Removes, replaces, or restyles the background of an image.

option image2_url Behavior
RemoveBackground omit Transparent PNG foreground
ReplaceBackground required New background image
RestyleBackground required Style reference image

Example — remove background

import requests

url = "https://api.vimmerse.net/v2/image/replace-background"
headers = {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
}
payload = {
    "image_url": "https://media.vimmerse.net/example/product.png",
    "option": "RemoveBackground",
}

response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])

Example — replace background

payload = {
    "image_url": "https://media.vimmerse.net/example/product.png",
    "image2_url": "https://media.vimmerse.net/example/studio_bg.png",
    "option": "ReplaceBackground",
}
SecurityAPIKeyHeader
Request
header Parameters
Authorization (string) or Authorization (null) (Authorization)
Username (string) or Username (null) (Username)
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type)
Request Body schema: application/json
required
async_mode
boolean (Async Mode)
Default: false
Webhook URL (string) or Webhook URL (null) (Webhook URL)
image_url
required
string (Base Image URL)
image2_url
string (Additional Image URL (Optional))
Default: ""

Optional second image used for background replacement.

option
string (Option)
Default: "RemoveBackground"

Option to apply. Available values: RemoveBackground, ReplaceBackground, RestyleBackground.

Responses
200

Asset with modified image URL(s) in results

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/v2/image/replace-background
Request samples
Response samples
application/json
{
  • "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  • "customer_id": "customer123",
  • "primary_user_id": "user-abc-123",
  • "args": {
    },
  • "thumbnails": [ ],
  • "status": "success",
  • "mime_type": "image/png",
  • "app_name": "text-to-image",
  • "quantity": 1,
  • "credits": 12,
  • "created_at": "2025-05-06T16:35:59.840508+00:00",
  • "updated_at": "2025-05-06T16:36:12.102933+00:00",
  • "history": [ ]
}

Edit Image

Edits an image: remove text, upscale, reframe, expand aspect ratio, or inpaint masked regions.

option Required fields
RemoveText image_url
Upscale image_url
ExpandToAspectRatio image_url, aspect_ratio
Inpaint image_url, mask_url, prompt
LumaReframe image_url, reframe_parameters

Example — remove text

import requests

url = "https://api.vimmerse.net/v2/image/edit-image"
headers = {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
}
payload = {
    "image_url": "https://media.vimmerse.net/example/sign.png",
    "option": "RemoveText",
}

response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])

Example — inpaint

payload = {
    "image_url": "https://media.vimmerse.net/example/room.png",
    "mask_url": "https://media.vimmerse.net/example/room_mask.png",
    "option": "Inpaint",
    "prompt": "Add a mountain view through the window",
    "quantity": 1,
}
SecurityAPIKeyHeader
Request
header Parameters
Authorization (string) or Authorization (null) (Authorization)
Username (string) or Username (null) (Username)
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type)
Request Body schema: application/json
required
async_mode
boolean (Async Mode)
Default: false
Webhook URL (string) or Webhook URL (null) (Webhook URL)
image_url
required
string (Base Image URL)
mask_url
string (Mask Image URL)
Default: ""
option
string (Option)
Default: "RemoveText"

Available values: RemoveText, Upscale, LumaReframe, Inpaint, ExpandToAspectRatio.

reframe_parameters
string (Reframe Parameters)
Default: ""

JSON string for reframe parameters in pixels.

aspect_ratio
string (Aspect Ratio)
Default: "16:9"
prompt
string (Text Prompt)
Default: ""

Text prompt for the regions to be modified/added.

expand_method
string (Expand Method)
Default: "Outpaint"

Only used for ExpandToAspectRatio option.

expand_direction
string (Expand Direction)
Default: "center"

Only used for ExpandToAspectRatio option.

quantity
integer (Quantity) >= 1
Default: 1

Quantity of output images.

Responses
200

Asset with modified image URL(s) in results

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/v2/image/edit-image
Request samples
Response samples
application/json
{
  • "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  • "customer_id": "customer123",
  • "primary_user_id": "user-abc-123",
  • "args": {
    },
  • "thumbnails": [ ],
  • "status": "success",
  • "mime_type": "image/png",
  • "app_name": "text-to-image",
  • "quantity": 1,
  • "credits": 12,
  • "created_at": "2025-05-06T16:35:59.840508+00:00",
  • "updated_at": "2025-05-06T16:36:12.102933+00:00",
  • "history": [ ]
}

Face Swap

Swaps faces in a target image using one or more reference face images.

  • image_urls[0] — target image containing face(s) to replace
  • image_urls[1:] — reference faces
  • order_indices — optional mapping of target face indices (left-to-right from 0)

Example

import requests

url = "https://api.vimmerse.net/v2/image/face-swap"
headers = {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
}
payload = {
    "image_urls": [
        "https://media.vimmerse.net/example/group_photo.png",
        "https://media.vimmerse.net/example/face_a.png",
        "https://media.vimmerse.net/example/face_b.png",
    ],
    "option": "NanoBananaFaceSwap",
    "face_only_mode": True,
    "multi_face_mode": True,
    "order_indices": [0, 1],
}

response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])
SecurityAPIKeyHeader
Request
header Parameters
Authorization (string) or Authorization (null) (Authorization)
Username (string) or Username (null) (Username)
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type)
Request Body schema: application/json
required
async_mode
boolean (Async Mode)
Default: false
Webhook URL (string) or Webhook URL (null) (Webhook URL)
image_urls
required
Array of strings (Image URLs) >= 2 items

The first URL is the target image; the rest are human/face reference images.

option
string (Face swap method)
Default: "NanoBananaFaceSwap"

Available values: NanoBananaFaceSwap, SeedreamFaceSwap, MagicFaceSwap, EaselFaceSwap, and SegmindFaceSwap.

face_only_mode
boolean (Face swap only)
Default: true

When true, only the face is swapped (not the entire head).

multi_face_mode
boolean (Multi face swap mode)
Default: true
Array of Order Indices (integers) or Order Indices (null) (Order Indices)

Indices of faces in the target image to swap (left-to-right, starting at 0).

Responses
200

Asset with face-swapped image URL(s) in results

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/v2/image/face-swap
Request samples
Response samples
application/json
{
  • "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  • "customer_id": "customer123",
  • "primary_user_id": "user-abc-123",
  • "args": {
    },
  • "thumbnails": [ ],
  • "status": "success",
  • "mime_type": "image/png",
  • "app_name": "text-to-image",
  • "quantity": 1,
  • "credits": 12,
  • "created_at": "2025-05-06T16:35:59.840508+00:00",
  • "updated_at": "2025-05-06T16:36:12.102933+00:00",
  • "history": [ ]
}

Try On

Virtual try-on: composites clothing from clothes_image_url onto the person in human_image_url.

Example

import requests

url = "https://api.vimmerse.net/v2/image/try-on"
headers = {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
}
payload = {
    "human_image_url": "https://media.vimmerse.net/example/model.png",
    "clothes_image_url": "https://media.vimmerse.net/example/jacket.png",
    "option": "NanoBananaTryOn",
}

response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
print(response.json()["results"])
SecurityAPIKeyHeader
Request
header Parameters
Authorization (string) or Authorization (null) (Authorization)
Username (string) or Username (null) (Username)
X-Client-Type (string) or X-Client-Type (null) (X-Client-Type)
Request Body schema: application/json
required
async_mode
boolean (Async Mode)
Default: false
Webhook URL (string) or Webhook URL (null) (Webhook URL)
human_image_url
required
string (URL of Human Image)
clothes_image_url
required
string (URL of Clothes Image)
option
string (Virtual Try On Option)
Default: "NanoBananaTryOn"

Available values: NanoBananaTryOn, SeedreamTryOn, KlingTryOn, FashnTryOn, KontextTryOn.

Responses
200

Asset with try-on image URL(s) in results

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/v2/image/try-on
Request samples
Response samples
application/json
{
  • "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  • "customer_id": "customer123",
  • "primary_user_id": "user-abc-123",
  • "args": {
    },
  • "thumbnails": [ ],
  • "status": "success",
  • "mime_type": "image/png",
  • "app_name": "text-to-image",
  • "quantity": 1,
  • "credits": 12,
  • "created_at": "2025-05-06T16:35:59.840508+00:00",
  • "updated_at": "2025-05-06T16:36:12.102933+00:00",
  • "history": [ ]
}