Fabric Swap — Replace the fabric, leather, or material on any product photo with a single API call. Upload your product image, a mask, and a swatch; we tile the swatch, transfer the product's lighting and shadows, and return a photorealistic mockup. Perfect for furniture, apparel, upholstery, and ecommerce product personalization. No AI, sub-second response, deterministic output.
One POST request. Get the result back directly — as an image, video, or JSON depending on the tool.
curl -X POST https://apiai.me/api/workflow/fabric-swap-material-swap \
-H "X-API-Key: YOUR_API_KEY" \
-F "image=@input.jpg" \
-F "ambient_pickup=0.25" \
-F "color_match=0.0" \
-F "contact_shadow=0.3" \
-F "detail_boost=0.5" \
-F "feather_px=3" \
-F "image_inpaint=@image.jpg" \
-F "image_mask=@image.jpg" \
-F "shading_strength=0.8" \
-F "tile_scale=1.0"
--output result.png
Test this tool visually before writing any code. Upload an image, set parameters, and see the result live. When it looks right, copy the auto-generated curl command and paste it into your app.
Process hundreds of images at once without writing a loop. Upload a CSV with one row per item, set your parameters, and download the results as a ZIP when they're done.
| Name | Required | Description | Default / Options |
|---|---|---|---|
ambient_pickup |
optional | Pick up the ambient color of surrounding pixels so the fabric inherits room lighting. 0.0 = off, 1.0 = strong. | 0.25
|
color_match |
optional | How strongly to pull the fabric's chroma toward the masked region (0.0 = keep fabric color exactly). | 0.0
|
contact_shadow |
optional | Darken the fabric near mask edges to simulate a contact shadow where fabric meets the frame. 0.0 = off, 1.0 = strong. | 0.3
|
detail_boost |
optional | Local-contrast boost on the shaded fabric to restore micro-detail. 0.0 = off, 1.0 = strong. | 0.5
|
feather_px |
optional | Gaussian blur radius (px) applied to mask edges for a soft blend. | 3
|
image_inpaint |
required | Fabric / material swatch to tile across the masked region. Square swatches work best. | — |
image_mask |
required | Region mask: white = apply fabric, black = keep original. Any image format; alpha channel is honored if present. | — |
shading_strength |
optional | How strongly the product's lighting is transferred onto the fabric (0.0 = flat, 1.0 = full). | 0.8
|
tile_scale |
optional | Multiplier for fabric tile size. 1.0 = ~8 repeats across each masked region. Larger = bigger pattern. | 1.0
|
Get an API key, test Fabric Swap / Material Swap in the dashboard, and copy the curl command.