For AI agents: this page is also available as Markdown at https://docs.refabric.com/task-api-reference/image.to_sketch.md, and the index of every page is https://docs.refabric.com/llms.txt.

Image editing

Turn an image into a sketch

Turn a garment image into a technical drawing, in the style you choose, as line art or in colour. Delivered as one image file.

Endpoint: POST https://api.refabric.com/v1/tasks/image.to_sketchTask: image.to_sketchScope: tasks:runCategory: Image editing

Quick start

import os
import time
import requests

headers = {"Authorization": f"Key {os.environ['REFABRIC_API_KEY']}"}

job = requests.post(
    "https://api.refabric.com/v1/tasks/image.to_sketch",
    headers=headers,
    json={
        "image": "art:4b7e01",
    },
).json()
print(job["job_id"])

while True:
    status = requests.get(job["status_url"], headers=headers).json()
    if status["lifecycle"] == "terminal":
        break
    time.sleep(5)

print(requests.get(job["result_url"], headers=headers).json())

cURL waits for the result with Prefer: wait; when the job outlives the wait, it answers 202 with the job's URLs.

Input schema

  • stringrequired

    The garment image to draw, as one string: a URL, a file from an earlier result (art:… or its url) or an upload (file:…). If it is one of your files placed on a design, the drawing is filed there too.

    pattern: ^(https://|art:|file:).+$

    Example: art:4b7e01

  • stringoptionalDefault: standard

    How the drawing is rendered. standard is clean line art of the garment, the drawing most uses need; each other style says when to choose it.

    Values

    • standard — Clean line art of the garment.
    • technical — A flat technical drawing, drawn left-right symmetrical. When you need a flat, symmetrical drawing for production.
    • no_print — Line art without the garment's print. When the drawing should show the garment's shape without its print.
    • textured — Line art that shows the fabric's texture. When the drawing should show the fabric's texture.

    Example: technical

  • booleanoptionalDefault: false

    Draw in the garment's colours instead of plain line art. Independent of style. A technical drawing is plain line art unless you ask for colour; send true when the drawing should also show the garment's colours.

    Example: false

  • stringoptional

    Notes for the drawing, in any language, up to 2000 characters — construction details to keep, things to leave out. Optional.

    max length 2000

    Example: keep the princess seams and the welt pockets; leave out the logo

Output schema

  • array<object>optional

    One image/* file: the technical drawing of the garment.

Required-fields example

{
  "image": "art:4b7e01"
}

Full example

{
  "image": "art:4b7e01",
  "style": "technical",
  "coloured": false,
  "prompt": "keep the princess seams and the welt pockets; leave out the logo"
}

Response example

{
  "job_id": "7a1c2e3f00004000800000000000001a",
  "lifecycle": "queued",
  "status_url": "http://v3-api.refabric.com/v1/jobs/7a1c2e3f00004000800000000000001a",
  "result_url": "http://v3-api.refabric.com/v1/jobs/7a1c2e3f00004000800000000000001a/result",
  "cancel_url": "http://v3-api.refabric.com/v1/jobs/7a1c2e3f00004000800000000000001a/cancel"
}

Result example

{
  "job_id": "7a1c2e3f00004000800000000000001a",
  "files": [
    {
      "file": "art:4b7e02",
      "url": "https://files.example.com/image.to_sketch/1.png",
      "media_type": "image/png",
      "task": "image.to_sketch",
      "job_id": "7a1c2e3f00004000800000000000001a",
      "created_at": "2026-10-01T09:14:07Z"
    }
  ],
  "has_more": false
}

style: technical is a flat, left-right symmetrical drawing; leave style out for standard line art. The image belongs to a design, so the drawing is saved on that design too.

Send a garment image and get a technical drawing of it. Choose how it is drawn with `style`, and whether it is drawn in the garment's colours with `coloured`. Add notes in `prompt` to name construction details to keep or things to leave out.

Built for

  • A tech pack drawing from a design image
  • Line art for a production brief
  • A flat drawing to turn into a vector file

What you get

  • One image: the technical drawing of the garment.

Specs

Input formatsImages, each one string: a URL, an upload (file:…) or a file from an earlier result (art:…). Upload types and sizes: GET /v1/meta limits.upload.
Input countimage: one
Output formatFiles: each one line with its url and its media_type, in the job's result.
Outputs per jobOne image file per job.

Errors

Good to know

  • prompt is at most 2000 characters.

Pricing: Estimate a request before you run it, or see the price of each option.

For agents and code generation

Schema changes follow Versioning.