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
import requests
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/fashion-ai"
# Prepare data and files
data = {}
files = {}
# For parameter "image", you can send a raw file or a URI:
# files['image'] = open('IMAGE_PATH', 'rb') # To send a file
# data['image'] = 'IMAGE_URI' # To send a URI
data['prompt'] = "a person wearing blue jeans"
data['clothing'] = "topwear"
headers = {'x-api-key': api_key}
response = requests.post(url, data=data, files=files, headers=headers)
print(response.content) # The response is the generated image
Input image to in-paint. The image will be center cropped and resized to size 512*512.
Image prompt that will edit the clothing.
This value should be one of the following - [topwear, bottomwear]
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.
Unlock the full potential of generative AI with Segmind. Create stunning visuals and innovative designs with total creative control. Take advantage of powerful development tools to automate processes and models, elevating your creative workflow.
Gain greater control by dividing the creative process into distinct steps, refining each phase.
Customize at various stages, from initial generation to final adjustments, ensuring tailored creative outputs.
Integrate and utilize multiple models simultaneously, producing complex and polished creative results.
Deploy Pixelflows as APIs quickly, without server setup, ensuring scalability and efficiency.
Fashion AI model can effectively replace a piece of clothing in an image with a new one, creating a seamless and realistic result. The fashion AI model working in two steps:
The model first identifies and separates the piece of clothing from the rest of the image. This precise segmentation allows the model to focus solely on the clothing item.
Once the clothing item is segmented, the model then inpaints the segmented image. This process is guided by a text prompt, which describes the new piece of clothing that should replace the original one.
Under the hood, the Fashion AI model is a combination of object detection, segmentation and inpainting.
Object Detection: The Grounding DINO model is used for object detection. It identifies the object of interest in the image, such as clothing. This is achieved by inputting the image and the object category into the Grounding DINO model, which uses both language and vision modalities to detect objects.
Segmentation: The Segment Anything Model (SAM) is employed for segmentation. It precisely segments elements in images based on semantic text prompts.
Inpainting: Following segmentation, a mask is created for the segmented clothing image. White pixels represent the clothing that will be inpainted, while black pixels are preserved. Based on the text prompt, a new clothing item replaces the old one. This process is known as inpainting.
Input Image: Provide an image of a person wearing clothing. This will serve as the base for the clothing replacement.
Text Prompt: Specify your desired changes to the clothing. This could include color, design, etc.
Clothing: Adjust the ‘clothing’ parameter to select the type of clothing you want to modify. This could be topwear, bottomwear, or full body wear, depending on the input image.
*Please note, if there is a mismatch between the clothing in the input image and the selected clothing type, it may result in unsatisfactory results. Always ensure that the clothing type matches the clothing present in the input image for the best results.
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
Best-in-class clothing virtual try on in the wild
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
The SDXL model is the official upgrade to the v1.5 model. The model is released as open-source software