Text to Sketch API
A garment sketch from a description — a clean technical flat for the tech pack, or a fashion designer's croquis of a model walking in the outfit.
/v1/generateworkflow: text_to_sketch-v1One endpoint serves every workflow — this page documents text_to_sketch-v1, the current version. Credits are debited at submission (1 cr standard, 3 cr pro); a failed generation is refunded automatically. Earlier versions of this endpoint, if any, keep being served under their own names.
| Parameter | Value for this workflow |
|---|---|
| workflow | "text_to_sketch-v1" required |
| fields.garment | Describe the garment. The piece, its cut and its construction details — e.g. "oversized denim jacket with dropped shoulders and chest pockets".required |
| fields.view | View. Front view, back view, or front and back side by side.Defaults to “Front view”. |
| fields.model | Model. Who walks in the sketch — e.g. "a woman from Italy", "a tall man" (Fashion sketch only).Defaults to “a woman”. |
| variant | Flat sketch · Fashion sketch |
| ratio | 21:9 · 16:9 · 3:2 · 4:3 · 5:4 · 1:1 · 4:5 · 3:4 · 2:3 · 9:16 |
| tier | "standard" (1 cr) or "pro" (3 cr) |
| webhook_url | Optional — we POST the outcome here when the generation settles. Without it, poll the URL returned in the response until the status settles. |
Example request
curl -X POST https://thenewblack.ai/api/v1/generate \
-H "Authorization: Bearer tnb_live_XXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"workflow": "text_to_sketch-v1",
"fields": {
"garment": "oversized denim jacket with dropped shoulders and chest pockets",
"view": "Front view",
"model": "a woman from Italy"
},
"variant": "Flat sketch",
"ratio": "3:4",
"tier": "standard"
}'// 202 Accepted
{
"generation_id": "3f1c9a6e-...",
"status": "running",
"poll": "/api/v1/generations/3f1c9a6e-..."
}Example response
Poll /v1/generations/{id} (or receive the webhook) until the generation settles:
// 200 OK
{
"generation_id": "3f1c9a6e-...",
"workflow": "text_to_sketch",
"status": "succeeded",
"result": {
"type": "image",
"url": "https://.../result.webp",
"thumbnail": "https://.../thumb.webp"
}
}Results are stored for 48 hours — copy them to your own storage. Authentication, errors and webhooks are documented in the full API reference.
Frequently asked questions
What are the two sketch types?
Flat sketch: a black-line technical drawing, garment laid flat, every seam and pocket drawn, for spec sheets. Fashion sketch: a designer's croquis, a model walking in the outfit, quick expressive lines.
Does it need an image?
No — the garment field is the whole input. The view field applies to the flat sketch, the model field to the fashion sketch.
How much does it cost?
1 credit on the standard tier, 3 on pro. Credits come with plans and packs; a failed generation is always refunded.
Other endpoints: Virtual Try-On API · AI Fashion Models API · Fashion Design API · Reimagine Model API · Swap Model API · AI Stylist API · all endpoints