Image

APIs for generating and editing images.

Upload Image

This api lets you upload your image on assets and use URL for your image input.

SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
image_file
string <binary> (Image)

Upload your image file.

image_url
string (Image URL)
Default: ""

Input your image URL to upload to us.

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

You can generate and download images from your text prompt.

Example Code

Generate image from text prompt.

import requests

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

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

payload = {
  "quantity": 3,
  "prompt": "Shot of Nike shoes on colorful background.",
  "option": "Auto",
  "aspect_ratio": "16:9"
}

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"

Text prompt to generate image.

quantity
integer (Number of Images) [ 1 .. 4 ]
Default: 1

Number of Images to generate. Available values are integers from 1 to 4.

option
string (Option)
Default: "Auto"

Available options are StableDiffusion3.5, LeonardoImage, Flux1.1Pro, Flux1.1ProUltra, FluxKontextMax, FluxKontextPro, OpenAI-Image-1 and Auto. If you choose Auto, one of them will be chosen automatically.

aspect_ratio
string (Aspect Ratio)
Default: "16:9"

Aspect ratio of generating image(s).

Finetune strength (string) or Finetune strength (number) or Finetune strength (null) (Finetune strength)

Available values are float from 0 to 2.

enhance_image
boolean (Enhance Image)
Default: false

Enhance image by applying 1X super-resolution in post-processing

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

You can generate image(s) from base image and text prompt that describes changes to your base image. You can upload your base image by using image_file or put public image URL into image_url field.

Example Code

import requests

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

payload = {
  'prompt': 'Make shoe blue and look more real like in the shop.',
  'quantity': 2,
  'creativity_strength': 3,
  'aspect_ratio': '4:3',
  'option': 'RealisticVision'
}
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.

prompt
string (Prompt)
Default: ""
creativity_strength
integer (Creativity Strength) [ 1 .. 10 ]
Default: 5

Strength of the creativity effect (1-10).

quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1

Number of images to generate.

aspect_ratio
string (Aspect Ratio)
Default: "16:9"

Aspect ratio of the generated image.

option
string (Option)
Default: "RealisticVision"

The image generation option to use. Available values are RealisticVision, StableDiffusion3.5, FluxKontextMax, FluxKontextPro, FluxKontextDev and LeonardoImage.

enhance_image
boolean (Enhance Image)
Default: false

Enhance image by applying 1X super-resolution in post-processing

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": {
    }
}

Reimagine

You can reimagine uploaded image and text prompt that describes changes to your uploaded image.

Example Code

import requests

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

payload = {
  'prompt': 'Make shoe blue and change wall to sky.',
  'aspect_ratio': '16:9',
  'option': 'Remake',
  'creativity_strength': 3,
}
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)

Reimagine with Restructure option.

import requests

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

payload = {
  'prompt': 'a well manicured shrub in an english garden',
  'aspect_ratio': '16:9',
  'creativity_strength': 3,
  'option': "Restructure"
}
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)

Reimagine with Restyle option.

import requests

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

payload = {
  'prompt': 'a majestic portrait of a chicken',
  'aspect_ratio': '16:9',
  'creativity_strength': 3,
  'option': "Restyle"
}
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)

Reimagine with Sketch option.

import requests

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

payload = {
  'prompt': 'a medieval castle on a hill',
  'aspect_ratio': '16:9',
  'creativity_strength': 3,
  'option': "Sketch"
}
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)

Reimagine with ReplaceWith option.

import requests

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

payload = {
  'prompt': 'Replace shoe with pepsi.', ## Please make sure prompt contains `replace` and `with`.
  '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)

Reimagine with RecolorTo option.

import requests

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

payload = {
  'prompt': 'Recolor green clothes to white clothes.', ## Please make sure prompt contains `recolor` and `to`.
  '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)
SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
image_file
string <binary> (Base or Human Image.)

Base or human image that you can to use for reimagination.

image_url
string (Base or Human Image URL)
Default: ""

URL of the base or human image.

prompt
string (Prompt)
Default: ""

Describe what changes to make to the image. This field will be ignored if image2 is given.

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

Creativity strength (1-10). This field will be ignored if image2 is given.

aspect_ratio
string (Aspect Ratio)

Aspect ratio of the image. This field will be ignored if image2 is given.

quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1

Number of images to generate. This field will be ignored if image2 is given.

option
string (Option)
Default: "Remake"

Available values are TunedFlux1, Remake, Sketch, Restructure, ReView, FluxKontextMax, FluxKontextPro, FluxKontextDev and OpenAI-Image-1.

enhance_image
boolean (Enhance Image)
Default: false

Enhance image by applying 1X super-resolution in post-processing

prompt2
string (Additional Prompt)
Default: ""

Used for OpenAI-Image-1 option

Responses
200

New Image URLs

400

Bad Request

402

Insufficient Credit

422

Validation Error

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

Elements

You can generate an image with elements or replace items by prompt.

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 and FluxKontextMax.

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 and FluxKontextMax.

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

Number of images to generate.

option
string (Option)
Default: "FluxKontextPro"

Available values are FluxKontextMax, FluxKontextPro, FluxKontextDev and ImageElements.

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

Enhance image by applying 1X super-resolution in post-processing

swap_faces
boolean (Swap Faces)
Default: false

Swap the resulting faces with the original faces.

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

You can remove/replace/restyle background from your given image.

Example Code

Remove Background

import requests

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

files=[
  ('image_file', ('image.png', open('/path/to/image.png','rb'), 'image/png'))
]
headers = {
  'X-Api-Key': 'YOUR_API_KEY'
}

payload={
  "option": "RemoveBackground"
}

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

print(response.text)

Replace Background

import requests

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

files=[
  ('image_file', ('image.png', open('/path/to/image.png','rb'), 'image/png'))
  ('image2_file', ('image2.png', open('/path/to/new/background.png','rb'), 'image/png'))
]
headers = {
  'X-Api-Key': 'YOUR_API_KEY'
}
payload={
  "option": "ReplaceBackground"
}

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

print(response.text)

Restyle Background

import requests

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

files=[
  ('image_file', ('image.png', open('/path/to/image.png','rb'), 'image/png'))
  ('image2_file', ('image2.png', open('/path/to/new/background.png','rb'), 'image/png'))
]
headers = {
  'X-Api-Key': 'YOUR_API_KEY'
}
payload={
  "option": "RestyleBackground"
}

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

aspect_ratio
string (Aspect Ratio)
Default: "16:9"

Aspect ratio of new image

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

You can edit the image with below options. To use reframe, you can use this URL for reference.

Example Code

Remove Text

import requests

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

files=[
  ('image_file', ('image.png', open('/path/to/image.png','rb'), 'image/png'))
]
headers = {
  'X-Api-Key': 'YOUR_API_KEY'
}

payload={
  "option": "RemoveText"
}

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

print(response.text)

Upscale Image

import requests

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

files=[
  ('image_file', ('image.png', open('/path/to/image.png','rb'), 'image/png'))
]
headers = {
  'X-Api-Key': 'YOUR_API_KEY'
}

payload={
  "option": "Upscale"
}

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

print(response.text)

Expand Image

import requests

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

files=[
  ('image_file', ('image.png', open('/path/to/image.png','rb'), 'image/png'))
]
headers = {
  'X-Api-Key': 'YOUR_API_KEY'
}

payload={
  "option": "ExpandToAspectRatio",
  "aspect_ratio": "16:9"
}

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

print(response.text)

Inpaint Image

import requests

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

files=[
  ('image_file', ('image.png', open('/path/to/image.png','rb'), 'image/png'))
  ('mask_file', ('mask.png', open('/path/to/image.png','rb'), 'image/png'))
]
headers = {
  'X-Api-Key': 'YOUR_API_KEY'
}

payload={
  "option": "Inpaint",
  "prompt": "Add fantastic background image for inpainting.",
  "quantity": 1
}

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.)
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"

Aspect ratio of new image

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.

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

This api swaps face from base image with new face from second image.

Here is an example code with File Upload

import requests

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

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

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

print(response.text)

Or you can submit with URL.

import requests

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

payload = {
    "main_image_url": "https://path.to.your/main_image.png",
    "human_image_url": "https://path.to.your/human_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
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].

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

This api generates virtual try on image.

Here is an example code with File Upload

import requests

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

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

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

print(response.text)

Or you can submit with URL.

import requests

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

payload = {
    "human_image_url": "https://path.to.your/human_image.png",
    "clothes_image_url": "https://path.to.your/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 KlingTryOn, FashnTryOn, and KontextTryOn.

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

Image Stylization transforms images into stunning artworks with various artistic styles. Available styles 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".

Example Code

Generate text prompt from image. import requests

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

payload = {
  'style': 'anime_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)
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

Enhance image by applying 1X super-resolution in post-processing

Responses
200

New Image URLs

400

Bad Request

402

Insufficient Credit

422

Validation Error

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