Virtual try-on
curl --request POST \
--url https://api.bfl.ai/v1/flux-tools/vto-v1 \
--header 'Content-Type: application/json' \
--header 'x-key: <api-key>' \
--data '
{
"prompt": "TRY-ON: The person of image 1 wearing the garments of image 2.",
"person": "<string>",
"garment": "<string>",
"seed": 42,
"safety_tolerance": 2,
"output_format": "jpeg",
"webhook_url": "<string>",
"webhook_secret": "<string>"
}
'import requests
url = "https://api.bfl.ai/v1/flux-tools/vto-v1"
payload = {
"prompt": "TRY-ON: The person of image 1 wearing the garments of image 2.",
"person": "<string>",
"garment": "<string>",
"seed": 42,
"safety_tolerance": 2,
"output_format": "jpeg",
"webhook_url": "<string>",
"webhook_secret": "<string>"
}
headers = {
"x-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'TRY-ON: The person of image 1 wearing the garments of image 2.',
person: '<string>',
garment: '<string>',
seed: 42,
safety_tolerance: 2,
output_format: 'jpeg',
webhook_url: '<string>',
webhook_secret: '<string>'
})
};
fetch('https://api.bfl.ai/v1/flux-tools/vto-v1', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bfl.ai/v1/flux-tools/vto-v1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'TRY-ON: The person of image 1 wearing the garments of image 2.',
'person' => '<string>',
'garment' => '<string>',
'seed' => 42,
'safety_tolerance' => 2,
'output_format' => 'jpeg',
'webhook_url' => '<string>',
'webhook_secret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bfl.ai/v1/flux-tools/vto-v1"
payload := strings.NewReader("{\n \"prompt\": \"TRY-ON: The person of image 1 wearing the garments of image 2.\",\n \"person\": \"<string>\",\n \"garment\": \"<string>\",\n \"seed\": 42,\n \"safety_tolerance\": 2,\n \"output_format\": \"jpeg\",\n \"webhook_url\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bfl.ai/v1/flux-tools/vto-v1")
.header("x-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"TRY-ON: The person of image 1 wearing the garments of image 2.\",\n \"person\": \"<string>\",\n \"garment\": \"<string>\",\n \"seed\": 42,\n \"safety_tolerance\": 2,\n \"output_format\": \"jpeg\",\n \"webhook_url\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bfl.ai/v1/flux-tools/vto-v1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"TRY-ON: The person of image 1 wearing the garments of image 2.\",\n \"person\": \"<string>\",\n \"garment\": \"<string>\",\n \"seed\": 42,\n \"safety_tolerance\": 2,\n \"output_format\": \"jpeg\",\n \"webhook_url\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"polling_url": "<string>",
"cost": 123,
"input_mp": 123,
"output_mp": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Tools
Virtual try-on
Submits a virtual try-on task. Person and garment images are mapped to the underlying input image slots; prompts steer attribute transfer.
POST
/
v1
/
flux-tools
/
vto-v1
Virtual try-on
curl --request POST \
--url https://api.bfl.ai/v1/flux-tools/vto-v1 \
--header 'Content-Type: application/json' \
--header 'x-key: <api-key>' \
--data '
{
"prompt": "TRY-ON: The person of image 1 wearing the garments of image 2.",
"person": "<string>",
"garment": "<string>",
"seed": 42,
"safety_tolerance": 2,
"output_format": "jpeg",
"webhook_url": "<string>",
"webhook_secret": "<string>"
}
'import requests
url = "https://api.bfl.ai/v1/flux-tools/vto-v1"
payload = {
"prompt": "TRY-ON: The person of image 1 wearing the garments of image 2.",
"person": "<string>",
"garment": "<string>",
"seed": 42,
"safety_tolerance": 2,
"output_format": "jpeg",
"webhook_url": "<string>",
"webhook_secret": "<string>"
}
headers = {
"x-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'TRY-ON: The person of image 1 wearing the garments of image 2.',
person: '<string>',
garment: '<string>',
seed: 42,
safety_tolerance: 2,
output_format: 'jpeg',
webhook_url: '<string>',
webhook_secret: '<string>'
})
};
fetch('https://api.bfl.ai/v1/flux-tools/vto-v1', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bfl.ai/v1/flux-tools/vto-v1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'TRY-ON: The person of image 1 wearing the garments of image 2.',
'person' => '<string>',
'garment' => '<string>',
'seed' => 42,
'safety_tolerance' => 2,
'output_format' => 'jpeg',
'webhook_url' => '<string>',
'webhook_secret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bfl.ai/v1/flux-tools/vto-v1"
payload := strings.NewReader("{\n \"prompt\": \"TRY-ON: The person of image 1 wearing the garments of image 2.\",\n \"person\": \"<string>\",\n \"garment\": \"<string>\",\n \"seed\": 42,\n \"safety_tolerance\": 2,\n \"output_format\": \"jpeg\",\n \"webhook_url\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bfl.ai/v1/flux-tools/vto-v1")
.header("x-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"TRY-ON: The person of image 1 wearing the garments of image 2.\",\n \"person\": \"<string>\",\n \"garment\": \"<string>\",\n \"seed\": 42,\n \"safety_tolerance\": 2,\n \"output_format\": \"jpeg\",\n \"webhook_url\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bfl.ai/v1/flux-tools/vto-v1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"TRY-ON: The person of image 1 wearing the garments of image 2.\",\n \"person\": \"<string>\",\n \"garment\": \"<string>\",\n \"seed\": 42,\n \"safety_tolerance\": 2,\n \"output_format\": \"jpeg\",\n \"webhook_url\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"polling_url": "<string>",
"cost": 123,
"input_mp": 123,
"output_mp": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Input model for FLUX.2 Klein VTO endpoint.
Exposes only person/garment image fields for cleaner API ergonomics.
Text prompt for VTO generation.
Example:
"TRY-ON: The person of image 1 wearing the garments of image 2."
Person image (maps internally to input_image).
Image of one more garments (maps internally to input_image_2).
Optional seed for reproducibility.
Example:
42
Tolerance level for input and output moderation. Between 0 and 5 for public use.
Required range:
0 <= x <= 5Available options:
jpeg, png, webp URL to receive webhook notifications
Required string length:
1 - 2083Optional secret for webhook signature verification
Was this page helpful?
⌘I

