API reference
Home textiles
Six endpoints under /api/industry/ for tablecloth and placemat work: two mockup generators, two scene swaps, and two pattern extractors.
POST
/api/industry/tablecloth-mockupPOST
/api/industry/placemat-mockupPOST
/api/industry/tablecloth-scene-swapPOST
/api/industry/placemat-scene-swapPOST
/api/industry/extract-patternPOST
/api/industry/placemat-extract-patternMockups
POST /api/industry/tablecloth-mockup, POST /api/industry/placemat-mockup — put a fabric pattern on a real table photo.
| Parameter | Values | Notes |
|---|---|---|
| imageUrl / image | URL or image file | The fabric pattern. Required. Up to 10 MB. |
| shape | tablecloth: rect · square · round; placemat: rect · square · round · oval · coffee · nightstand · tv · sideboard · student · irregular | Required. No default. |
| drape (tablecloth only) | half · full · custom | Required. With custom, drapeDistanceCm (1–200) is required. |
| edge (tablecloth only) | straight · wave | Required. |
| ratio | 1:1 · 3:2 · 2:3 · 4:3 · 3:4 · 4:5 · 5:4 · 16:9 · 21:9 · 9:16 | Required. |
| styleId | per shape | Optional scene style; only some shapes have a style catalog (e.g. tablecloth rect only). |
| extraPrompt | free text, 400 chars | Optional styling constraints. |
| resolution | 1k · 2k · 4k | Required. |
| quality | standard · enhanced | Required. No default. |
Any missing or unknown value returns 400 invalid_params.
Scene swap
POST /api/industry/tablecloth-scene-swap, POST /api/industry/placemat-scene-swap — move a finished cloth or mat into a new scene, or place one into your own photo.
| Parameter | Values | Notes |
|---|---|---|
| imageUrl / image | URL or image file | The finished cloth or mat. Required. |
| mode | scene · object | Required. scene = new setting for your cloth; object = dress the table in your photo. |
| envId / sceneDesc | scene mode | A ready-made scene id or your own description — at least one is required. |
| replaceDesc | object mode | What should change. Required in object mode. |
| objectImageUrl / objectImage | object mode | Optional reference of the fabric to apply. |
| ratio, resolution, quality | as above | All three required — ratio and quality have no default. |
Extract pattern
POST /api/industry/extract-pattern, POST /api/industry/placemat-extract-pattern — turn a product photo into a flat, printable pattern.
| Parameter | Values | Notes |
|---|---|---|
| imageUrl / image | URL or image file | The product photo. Required. Up to 10 MB, max 4096 px long side. |
| shapeId, patternId | see tool pages | Required. The layout must belong to the selected shape. |
| ratio | 21:9 · 2:3 · 3:4 · 4:5 · 9:16 · 1:1 | Required. |
| resolution | 1k · 2k · 4k | Required. |
| quality | standard · enhanced | Required. No default. |
| extraPrompt | free text, 2000 chars | Optional constraints. |
