API
If you're looking for an API, you can choose from your desired programming language.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
# Use this function to convert a list of image URLs to base64
def image_urls_to_base64(image_urls):
return [image_url_to_base64(url) for url in image_urls]
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/furniture-staging"
# Request payload
data = {
"prompt": "photo of a white table with plant pot placed on an interior",
"main_image": image_url_to_base64("https://i.ibb.co/z8pdz41/main-image.png"), # Or use image_file_to_base64("IMAGE_PATH")
"overlay_image": image_url_to_base64("https://i.ibb.co/bHhQFBq/overlay-image.png"), # Or use image_file_to_base64("IMAGE_PATH")
"main_image_mask": image_url_to_base64("https://i.ibb.co/GFxb3SX/main-image-mask.png"), # Or use image_file_to_base64("IMAGE_PATH")
"overlay_image_mask": image_url_to_base64("https://i.ibb.co/8cqzRHL/overlay-image-mask.png"), # Or use image_file_to_base64("IMAGE_PATH")
"steps": 25,
"seed": 42424242,
"guidance": 30,
"image_format": "png",
"image_quality": 95
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Attributes
The main prompt describing the scene or subject
The URL of the main image
The URL of the overlay image
The URL of the main image mask
The URL of the overlay image mask
The number of steps for image processing
min : 10,
max : 100
Random seed for reproducibility
Guidance scale for adjusting adherence to the prompt
min : 1,
max : 50
The output image format
Allowed values:
The quality of the output image
min : 10,
max : 100
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Each parameter of the model controls a specific aspect of the furniture staging process. Here's a breakdown:
-
prompt:
This describes the scene or subject you want to stage. Write a detailed description of how the staged furniture or design should look. -
main_image:
The primary image of the room or space where the furniture will be staged. Ensure the URL is accessible and points to a clear, high-quality image. -
overlay_image:
The secondary image containing the furniture or staging items to overlay on the main image. Provide the URL of the furniture/staging image. -
main_image_mask:
A mask for the main image. This defines areas to focus on for staging (e.g., walls, floors). If not provided, staging might be applied globally. -
overlay_image_mask (optional):
- If the furniture in the overlay image has a white background, the model will automatically create a mask for it.
- If the overlay image is a lifestyle image or contains more than one furniture item, you should provide a custom mask.
-
steps:
This determines the number of processing steps. Higher values lead to better quality but take longer. -
seed:
Sets a random seed for reproducibility. Change this if you want different variations of the same setup. -
guidance:
Controls how strictly the output adheres to the prompt. Higher values ensure the output matches your prompt but can reduce creativity. -
image_format:
Specifies the format of the output image. Options are usuallypng
,jpeg
, etc. Choosepng
for lossless quality. -
image_quality:
Sets the quality of the output image. Higher values produce better quality but larger file sizes.
Prepare Your Inputs
Make sure all inputs are ready:
-
Images:
- Upload the
main_image
andoverlay_image
to a cloud service or use an accessible URL. - If masks are needed, ensure they match the size and format of their respective images.
- Upload the
-
Prompt:
- Be specific about the furniture type, arrangement, and style (e.g., "Place a modern gray sofa").
Other Popular Models
sdxl-img2img
SDXL Img2Img is used for text-guided image-to-image translation. This model uses the weights from Stable Diffusion to generate new images from an input image using StableDiffusionImg2ImgPipeline from diffusers

faceswap-v2
Take a picture/gif and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training

codeformer
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.

sd2.1-faceswapper
Take a picture/gif and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training
