Image

APIs for generating and editing images.

Upload Image

Uploads images to the Vimmerse platform for use in API requests.

Benefits

  • Store images securely in the cloud
  • Reference images by URL in other API calls
  • Manage your media assets efficiently

Supported Formats

  • JPEG, JPG
  • PNG (with transparency support)
  • WebP

Usage

After uploading, you'll receive a URL that can be used with the image_url parameter in other endpoints.

SecurityAPIKeyHeader
Request
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/image
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Text to Image

Generates high-quality images from text prompts using advanced AI models.

Parameters

  • prompt: Text description of the desired image (required)
  • quantity: Number of images to generate, 1-4 (default: 1)
  • option: AI model to use (default: "Auto")
    • "Auto": Automatically selects the best model
    • Other options depend on available models
  • aspect_ratio: Image dimensions (default: "16:9")
    • Available: "21:9", "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16", "9:21"
  • creativity_strength: Control over creativity, 1-10 (default: 5)
  • enhance_image: Apply super-resolution enhancement (default: false)

Example

import requests

url = "https://api.vimmerse.net/image/text-2-image"

headers = {
    'X-Api-Key': 'YOUR_API_KEY',
}
payload = {
    "quantity": 3,  # Number of images to generate (1-4)
    "prompt": "A serene landscape with mountains and a lake at sunset",
    "option": "Auto",  # Image generation model
    "aspect_ratio": "16:9"  # Image aspect ratio
}

response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
prompt
string (Text Prompt)
Default: "Shot of Nike shoes on colorful background"
quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1
option
string (Option)
Default: "Auto"

If Auto is selected, one of the option will be selected automatically.

Enum: "Seedream" "FluxPro" "FluxTurbo" "NanoBananaPro" "NanoBanana" "FluxKontextPro" "FluxFinetuned" "QwenImage" "StableDiffusion3.5" "LeonardoImage" "GPTImage" "Auto"
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']

creativity_strength
integer (Creativity Strength) [ 1 .. 10 ]
Default: 5

Strength of the creativity effect (1-10).

enhance_image
boolean (Enhance Image)
Default: false

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

async_mode
boolean (Async Mode)
Default: false
webhook_url
string (Webhook URL)
Responses
200

New Image URLs

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/image/text-2-image
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Image to Image

Transforms images using text prompts with various editing modes.

Available Options

Remake

  • Redesigns the image based on the prompt
  • Changes overall composition and elements
  • Best for major creative transformations

Restructure

  • Completely restructures the image layout
  • Maintains visual style while changing composition
  • Ideal for dramatic scene changes

Restyle

  • Applies artistic style transformations
  • Changes visual appearance while keeping content
  • Perfect for style transfer and artistic effects

Sketch

  • Converts image to sketch/drawing style
  • Creates artistic line-based visuals
  • Great for illustrations and art styles

ReplaceWith

  • Replaces specific objects with others
  • Must include "replace" and "with" in prompt
  • Perfect for object substitution

RecolorTo

  • Changes colors of specific elements
  • Must include "recolor" and "to" in prompt
  • Ideal for color adjustments

Parameters

  • image_file or image_url: Source image (required)
  • prompt: Description of desired changes (required)
  • option: Edit mode (required)
  • aspect_ratio: Desired output ratio (optional)
  • creativity_strength: 1-10 scale for creativity (default: 5)
  • quantity: Number of variations, 1-4 (default: 1)

Examples

Remake

import requests

url = "https://api.vimmerse.net/image/image-2-image"

payload = {
    'prompt': 'Make the shoe blue and change the wall to a sky background',
    'aspect_ratio': '16:9',
    'option': 'Remake',  # Redesign the image based on prompt
    'creativity_strength': 3,  # 1-10 scale
}
files=[
    ('image_file', ('image.png', open('/path/to/image.png', 'rb'), 'image/png'))
]
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

Restructure

import requests

url = "https://api.vimmerse.net/image/image-2-image"

payload = {
    'prompt': 'Transform into a well-manicured shrub in an English garden',
    'aspect_ratio': '16:9',
    'creativity_strength': 3,
    'option': "Restructure"  # Completely restructures the image
}
files=[
    ('image_file', ('image.png', open('/path/to/image.png', 'rb'), 'image/png'))
]
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

Restyle

import requests

url = "https://api.vimmerse.net/image/image-2-image"

payload = {
    'prompt': 'Transform into a majestic portrait style',
    'aspect_ratio': '16:9',
    'creativity_strength': 3,
    'option': "Restyle"  # Applies artistic style changes
}
files=[
    ('image_file', ('image.png', open('/path/to每一個.png', 'rb'), 'image/png'))
]
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

Sketch

import requests

url = "https://api.vimmerse.net/image/image-2-image"

payload = {
    'prompt': 'Convert to a medieval castle scene',
    'aspect_ratio': '16:9',
    'creativity_strength': 3,
    'option': "Sketch"  # Converts image to sketch style
}
files=[
    ('image_file', ('image.png', open('/path/to/image.png', 'rb'), 'image/png'))
]
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

Replace With

import requests

url = "https://api.vimmerse.net/image/image-2-image"

payload = {
    'prompt': 'Replace the shoe with a can of Pepsi',
    'aspect_ratio': '16:9',
    'creativity_strength': 3,
    'option': "ReplaceWith"
}
files=[
    ('image_file', ('image.png', open('/path/to/image.png', 'rb'), 'image/png'))
]
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

Recolor To

import requests

url = "https://api.vimmerse.net/image/image-2-image"

payload = {
    'prompt': 'Recolor the green shirt to white',
    'aspect_ratio': '16:9',
    'creativity_strength': 3,
    'option': "RecolorTo"  # Changes colors in the image
}
files=[
    ('image_file', ('image.png', open('/path/to/image.png', 'rb'), 'image/png'))
]
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
image_file
string <binary> (Image File)
image_url
string (Image Url)
Default: ""
prompt
string (Prompt)
Default: ""

Text prompt to edit your image

creativity_strength
integer (Creativity Strength) [ 1 .. 10 ]
Default: 5
aspect_ratio
string (Aspect Ratio)
quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1

Number of images to generate.

option
string (Option)
Default: "FluxKontextPro"
Enum: "Seedream" "FluxPro" "FluxTurbo" "ImageUtilsDepth" "NanoBananaPro" "NanoBanana" "FluxKontextPro" "QwenImage" "FluxKontextFinetuned" "Remake" "StableDiffusion3.5" "LeonardoImage" "Sketch" "Restructure" "Review" "GPTImage" "Auto"
enhance_image
boolean (Enhance Image)
Default: false

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

async_mode
boolean (Async Mode)
Default: false
webhook_url
string (Webhook URL)
Responses
200

New Image URLs

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/image/image-2-image
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Elements

Generates images with elements or replaces items based on prompts.

Use Cases

  • Add new elements to existing images
  • Remove unwanted objects
  • Replace objects with alternatives
SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
image_files
Array of strings <binary> (Element Images)
Default: []

The first image is the main image and rest of them are reference image. Max 4 files are supported from FluxKontextPro, 6 files for Seedream, 8 files for FluxPro, and 10 files are supported from GPTImage, NanoBanana and NanoBananaPro.

image_urls
Array of strings (Element Image URLs)
Default: []

The first image is the main image and rest of them are reference image. Max 4 files are supported from FluxKontextPro, 6 files for Seedream, 8 files for FluxPro, and 10 files are supported from GPTImage, NanoBanana and NanoBananaPro.

aspect_ratio
string (Aspect Ratio)
Default: "16:9"
quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1

Number of images to generate.

option
string (Option)
Default: "FluxPro"

Available values are 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.

async_mode
boolean (Async Mode)
Default: false
webhook_url
string (Webhook URL)
Responses
200

New Image URLs

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/image/elements
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Replace Background

Manipulates the background of images with three modes: remove, replace, or restyle.

Options

RemoveBackground

  • Creates a transparent background (PNG format)
  • Ideal for product photography and portrait editing
  • Output maintains foreground elements perfectly

ReplaceBackground

  • Replaces the background with a new image
  • Use bg_image_file or bg_image_url to provide the replacement background
  • Best for changing scenes or environments

RestyleBackground

  • Applies artistic style from a reference image
  • Use bg_image_file or bg_image_url to provide the style reference
  • Great for creating unique visual effects

Parameters

  • image_file or image_url: Main image (required)
  • bg_image_file or bg_image_url: Background image (required for ReplaceBackground and RestyleBackground)
  • option: "RemoveBackground", "ReplaceBackground", or "RestyleBackground" (required)

Examples

Remove Background

{REMOVE_BG_EXAMPLE}

Replace Background

{REPLACE_BG_EXAMPLE}

Restyle Background

{RESTYLE_BG_EXAMPLE}

SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
image_file
string <binary> (Base Image.)
image_url
string (Base Image URL)
Default: ""

URL of the base image.

image2_file
string <binary> (Additional Image (Optional))

Upload second image. You can use this option to replace background.

image2_url
string (Additional Image URL (Optional))
Default: ""

Upload second image. You can use this option to replace background.

option
string (Option)
Default: "RemoveBackground"

Option to apply to your image. Available values RemoveBackground, ReplaceBackground and RestyleBackground.

async_mode
boolean (Async Mode)
Default: false
webhook_url
string (Webhook URL)
Responses
200

Modified image url.

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/image/replace-background
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Edit Image

Performs various image editing operations including text removal, upscaling, expansion, and inpainting.

Available Options

RemoveText

  • Automatically detects and removes text from images
  • Uses AI to intelligently fill removed areas
  • Perfect for cleaning up signage, watermarks, or captions

Upscale

  • Increases image resolution up to 4x
  • Uses super-resolution AI technology
  • Maintains image quality and detail

ExpandToAspectRatio

  • Expands image to match the specified aspect ratio
  • Uses AI to generate realistic extended content
  • aspect_ratio: Desired ratio (e.g., "16:9", "9:16", "1:1")

Inpaint

  • Fills in masked areas based on a text prompt
  • Requires both an image and a mask file
  • mask_file: White areas in the mask indicate regions to fill
  • prompt: Description of what to generate in the masked area
  • quantity: Number of variations to generate (1-4)

Parameters

  • image_file or image_url: Source image (required)
  • mask_file: Mask image for inpainting (required for Inpaint option)
  • option: "RemoveText", "Upscale", "ExpandToAspectRatio", or "Inpaint" (required)
  • aspect_ratio: For ExpandToAspectRatio (required for that option)
  • prompt: For Inpaint (required for that option)
  • quantity: Number of variations for Inpaint (optional, default: 1)

Examples

Remove Text

{REMOVE_TEXT_EXAMPLE}

Upscale Image

{UPSCALE_IMAGE_EXAMPLE}

Expand Image

{EXPAND_IMAGE_EXAMPLE}

Inpaint Image

{INPAINT_IMAGE_EXAMPLE}

SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
image_file
string <binary> (Base Image.)
mask_file
string <binary> (Mask Image.)
image_url
string (Base Image URL)
Default: ""

URL of the base image.

mask_url
string (Mask Image URL)
Default: ""

URL of the Mask Image.

option
string (Option)
Default: "RemoveText"

Available values are RemoveText, Upscale, LumaReframe, Inpaint and ExpandToAspectRatio.

reframe_parameters
string (Reframe Parameters)
Default: ""

JSON string for reframe parameters in pixels unit

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)
Default: 1

Quantity of output images.

async_mode
boolean (Async Mode)
Default: false
webhook_url
string (Webhook URL)
Responses
200

Modified image url.

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/image/edit-image
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Face Swap

Swaps faces in an image with faces from other uploaded images.

How It Works

  • Upload a main image containing the face(s) to be replaced
  • Upload one or more images containing the replacement faces
  • The API automatically detects and swaps faces matching the order of images

Parameters

  • image_files: List of image files to upload (required if not using URLs)
  • image_urls: List of image URLs (required if not using files)
  • order_indices: Array of face indices to swap (optional, e.g., [0, 1])
  • main_image_url: Deprecated - use image_urls instead
  • human_image_url: Deprecated - use image_urls instead

Best Practices

  • First image: Image containing face(s) to be replaced
  • Subsequent images: Images with replacement faces
  • Ensure faces are clearly visible and well-lit
  • Supported formats: JPG, PNG, WebP

Example: Using File Upload

import requests

url = "https://api.vimmerse.net/image/face-swap"

files=[
    ('image_files', ('main_image.png', open('/path/to/main_image.png', 'rb'), 'image/png')),
    ('image_files', ('human1_image.jpeg', open('/path/to/human_image.jpeg', 'rb'), 'image/jpeg')),
    ('image_files', ('human2_image.jpeg', open('/path/to/second_face.jpeg', 'rb'), 'image/jpeg'))
]
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}
payload = {
    'order_indices': [0, 1]  # Optional: specify which faces to swap
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

Example: Using URLs

import requests

url = "https://api.vimmerse.net/image/face-swap"

payload = {
    'image_urls': [
        "https://example.com/main_image.png",
        "https://example.com/human_image1.png",
        "https://example.com/human_image2.png"
    ],
    'order_indices': [0, 1]  # Optional
}

headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
image_files
Array of strings <binary> (Images)
Default: []

The first image is the main target image and rest of them are human / face images.

image_urls
Array of strings (Image URLs)
Default: []

The first image is the main target image and rest of them are human / face images.

option
any (Face swap method)
Default: "MagicFaceSwap"

Available values are EaselFaceSwap, SegmindFaceSwap and MagicFaceSwap

face_only_mode
boolean (Face swap only)
Default: true

Face swap only mode changes the face only and not the entire head!

multi_face_mode
boolean (Multi face swap mode)
Default: true

Multi face swap mode

order_indices
Array of integers (Order Indices)

Indices of the faces in the target image to be swapped. If target image has three people standing next two each other then are indexed 0, 1, 2 from left to right. If two face images are used but want to use the first one to swap the person on the right and the second one to swap the person on left, then order indices to be passed is [2,0].

async_mode
boolean (Async Mode)
Default: false
webhook_url
string (Webhook URL)
Responses
200

New Image URLs

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/image/face-swap
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Try On

Generates a virtual try-on image by overlaying clothing onto a human subject.

How It Works

This API combines a human image and a clothing image to create a realistic visualization of how the clothing looks on the person.

Parameters

  • human_image_file or human_image_url: Image of a person (required)
  • clothes_image_file or clothes_image_url: Image of clothing to try on (required)
  • option: Try-on method (default: "Auto")

Requirements

  • Human image should feature a person in standing pose, facing forward
  • Clothing image should be clear and show the garment on a plain background
  • Both images should be well-lit and in focus

Example: Using File Upload

import requests

url = "https://api.vimmerse.net/image/try-on"

files=[
    ('human_image_file', ('human_image.jpeg', open('/path/to/human_image.jpeg', 'rb'), 'image/jpeg')),
    ('clothes_image_file', ('clothes_image.jpeg', open('/path/to/clothes_image.jpeg', 'rb'), 'image/jpeg'))
]
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}
payload = {}  # Optional parameters

response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

Example: Using URLs

import requests

url = "https://api.vimmerse.net/image/try-on"

payload = {
    "human_image_url": "https://example.com/human_image.png",
    "clothes_image_url": "https://example.com/clothes_image.png"
}

headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
human_image_file
string <binary> (Human Image)
human_image_url
string (URL of Human Image)
Default: ""
clothes_image_file
string <binary> (Clothes Image)
clothes_image_url
string (URL of Clothes Image)
Default: ""
option
string (Virtual Try On Option)
Default: "KlingTryOn"

Available values are SeedreamTryOn, NanoBananaProTryOn, KlingTryOn, FashnTryOn, and KontextTryOn.

async_mode
boolean (Async Mode)
Default: false
webhook_url
string (Webhook URL)
Responses
200

New Image URLs

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/image/try-on
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Restyle

Transforms images into various artistic styles using AI-powered stylization.

Available Styles

  • realistic_style: Hyper-realistic rendering
  • anime_style: Japanese anime aesthetic
  • 3d: Three-dimensional rendering
  • angel: Ethereal, angelic appearance
  • japanese_comics: Manga/comic book style
  • princess_style: Fairytale princess aesthetic
  • dreamy: Soft, dream-like atmosphere
  • ink_style: Ink wash painting effect
  • monets_garden: Impressionist painting style
  • new_monet_garden: Modern impressionist style
  • exquisite_comic: Detailed comic art
  • cyber_machinery: Futuristic tech aesthetic
  • chinese_style: Traditional Chinese painting
  • romantic: Soft, romantic atmosphere
  • ugly_clay: Claymation stop-motion style
  • cute_doll: Doll-like appearance
  • 3d_gaming: Video game 3D style
  • animated_movie: Animated film aesthetic
  • doll: Character doll style

Parameters

  • image_file or image_url: Source image (required)
  • style: Artistic style to apply (required)

Example

import requests

url = "https://api.vimmerse.net/image/restyle"

payload = {
    'style': 'anime_style'  # Apply anime style transformation
}
files=[
    ('image_file', ('image.png', open('/path/to/image.png', 'rb'), 'image/png'))
]
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
image_file
string <binary> (Base image)

Upload the base image.

image_url
string (Base Image URL)
Default: ""

URL of the base image.

style
string (Style)
Default: "anime_style"

Available values are "3d", "realistic_style", "angel", "anime_style", "japanese_comics", "princess_style", "dreamy", "ink_style", "new_monet_garden", "monets_garden", "exquisite_comic", "cyber_machinery", "chinese_style", "romantic", "ugly_clay", "cute_doll", "3d_gaming", "animated_movie" and "doll".

enhance_image
boolean (Enhance Image)
Default: false

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

async_mode
boolean (Async Mode)
Default: false
webhook_url
string (Webhook URL)
Responses
200

New Image URLs

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/image/restyle
Request samples
Response samples
application/json
{
  • "data": {
    }
}