bfl/flux-2/virtual-tryon
Flux 2 Virtual Tryon by BFL - AI-powered image editing, style transfer, and transformation. Edit photos with natural language instructions, remove backgrounds, change styles, and enhance images effortlessly.
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
Example output — click Run to generate your own
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
https://api.sandbase.ai/v1/runbfl/flux-2/virtual-tryonInput Schema
8 parameters · 1 required · 7 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | The prompt to generate a virtual try-on image. |
seed | integer | Optional | Random seed for reproducibility. Same seed with same prompt will produce same result. |
images | string[] | Optional | The URLs of the images for virtual try-on. Provide person image and clothing image. |
lora_scale | number | Optional | The strength of the virtual try-on effect. · Min: 0 · Max: 2 · Default: 1 |
aspect_ratio | string | Optional | The aspect ratio of the generated image. · Options: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16 21:916:93:24:35:41:14:53:42:39:16 |
output_format | string | Optional | The format of the output image · Options: png, jpeg · Default: "png" pngjpeg |
guidance_scale | number | Optional | The CFG (Classifier Free Guidance) scale. Controls how closely the model follows the prompt. · Min: 0 · Max: 20 · Default: 2.5 |
num_inference_steps | integer | Optional | The number of inference steps to perform. · Min: 4 · Max: 50 · Default: 40 |
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom the completed response
Code Examples
Ready-to-run snippets
# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "bfl/flux-2/virtual-tryon",
"images": [
"https://static.sandbase.ai/examples/bfl/flux-2/virtual-tryon/input_images_0.png",
"https://static.sandbase.ai/examples/bfl/flux-2/virtual-tryon/input_images_1.png"
],
"prompt": "A person wearing a stylish jacket, virtual try-on",
"lora_scale": 1,
"output_format": "png",
"guidance_scale": 2.5,
"num_inference_steps": 40
}'
# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
-H "Authorization: Bearer YOUR_API_KEY"API README
FLUX.2 Virtual Try-On
FLUX.2 Virtual Try-On transfers a garment from one image onto a person in another image. It is a specialized clothing-editing workflow built around the person and garment assets rather than a general text-to-image request. A written instruction defines the intended wardrobe change while the paired images establish the visual material.
The route is useful for producing a dressed-person visualization without preparing a mask or removing the background first. It keeps the try-on operation within one image-editing request and returns a finished raster image. Additional controls let teams tune edit strength, composition shape, and inference settings when the default balance is not enough.
Highlights
- Two-image virtual try-on workflow. The exact workflow is defined around a person image and a garment image. This gives the model both the wearer context and the clothing reference in the same request.
- Specialized garment transfer. The route uses a clothing-focused FLUX.2 LoRA rather than treating the task as unrestricted image manipulation. Its purpose is transferring the referenced garment onto the depicted person.
- No manual masking or background removal. The documented dual-input workflow eliminates those preparation steps. Teams can start from the two visual assets instead of producing a separate cutout or mask.
- Broader clothing-editing foundation. FLUX.2 documentation covers outfit changes, accessories, garment recoloring, and clothing-style adaptation. The virtual try-on specialization places garment transfer within that established editing family.
Pricing
| Billing unit | Price |
|---|---|
| Base price per request | $0.021 |
When to Use
| ✅ Good fit | ❌ Consider alternatives |
|---|---|
| Previewing a referenced garment on a photographed person | Generating a person and outfit with no input images |
| Creating outfit variations from an existing wearer image | Requiring a production sewing pattern or garment CAD file |
| Testing a clothing concept without preparing a manual mask | Editing an unrelated object or scene element |
| Producing raster try-on imagery for review | Needing a layered design document with independently editable pieces |
| Comparing garment references on the same person asset | Requiring measured physical fit or size prediction |
Prompt Guide
Provide the person image first and the garment image second. Write a concise instruction that names the clothing transfer and any visible treatment you need; the images carry the primary identity and garment information.
Images:
1. <person image URL>
2. <garment image URL>
Prompt: Put the garment from image 2 on the person in image 1. <optional visible styling direction>
Example request:
{
"images": [
"https://example.com/person.jpg",
"https://example.com/garment.jpg"
],
"prompt": "Put the garment from image 2 on the person in image 1.",
"lora_scale": 1,
"aspect_ratio": "4:5",
"output_format": "png"
}
Technical Specs
| Spec | Value |
|---|---|
| Model ID | bfl/flux-2/virtual-tryon |
| Required field | prompt |
| Image inputs | images array for person and garment references |
| LoRA scale | 0 to 2; default 1 |
| Guidance scale | 0 to 20; default 2.5 |
| Inference steps | 4 to 50; default 40 |
| Aspect ratio | 10 supported presets from 21:9 through 9:16 |
| Output format | png or jpeg; default png |
| Output | Image URL and content type |
| Execution | Asynchronous job |
Related
- FLUX.2 Pro Edit — use the sibling editing route for broader image transformations beyond virtual try-on.

