For AI agents: this page is also available as Markdown at https://docs.refabric.com/task-api-reference/image.change_texture.md, and the index of every page is https://docs.refabric.com/llms.txt.
Image editing
Change a garment's texture
Change the texture, print and colour of one garment in a finished image to match a fabric, keeping the person, the pose and the scene. Delivered as one image file.
Endpoint: POST https://api.refabric.com/v1/tasks/image.change_textureTask: image.change_textureScope: 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.change_texture",
headers=headers,
json={
"image": "art:9f2c01",
"fabric": "fabric:5f0c1d2e-8a41-4b7e-9c3d-1a2b3c4d5e60",
"prompt": "the knit should be the ribbed cream one, not flat white",
},
).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 finished image to change, as one string: a URL, a file from an earlier result (
art:…or its url) or an upload (file:…). Any image of a dressed person or a garment; the person, pose and scene come back unchanged. If it is one of your files placed in a project in the Refabric app, the result is filed there too.pattern: ^(https://|art:|file:).+$
Example:
art:9f2c01 - stringrequired
The fabric to match — its texture, print and colour — as one string: a photo of it (a full
https://URL,art:…orfile:…, or anitems[].urlof a fabric'sdata), or a library fabricfabric:<id>(GET /v1/refs/fabric), whose cover image is used. Send a publicly reachable image.pattern: ^(https://|art:|file:|fabric:).+$
Example:
fabric:5f0c1d2e-8a41-4b7e-9c3d-1a2b3c4d5e60 - stringrequired
What to change, in any language, up to 2000 characters — name the garment when the image shows several ("the red t-shirt should be the ribbed cream knit").
min length 1 · max length 2000
Example:
the knit should be the ribbed cream one, not flat white
Output schema
- array<object>optional
One
image/*file: the image with the garment's texture, print and colour changed. Pass it on to another edit to continue from it.
Required-fields example
{
"image": "art:9f2c01",
"fabric": "fabric:5f0c1d2e-8a41-4b7e-9c3d-1a2b3c4d5e60",
"prompt": "the knit should be the ribbed cream one, not flat white"
}Full example
{
"image": "art:9f2c01",
"fabric": "fabric:5f0c1d2e-8a41-4b7e-9c3d-1a2b3c4d5e60",
"prompt": "the knit should be the ribbed cream one, not flat white"
}Response example
{
"job_id": "d2b3c4d500004000800000000000000a",
"lifecycle": "queued",
"status_url": "http://v3-api.refabric.com/v1/jobs/d2b3c4d500004000800000000000000a",
"result_url": "http://v3-api.refabric.com/v1/jobs/d2b3c4d500004000800000000000000a/result",
"cancel_url": "http://v3-api.refabric.com/v1/jobs/d2b3c4d500004000800000000000000a/cancel"
}Result example
{
"job_id": "d2b3c4d500004000800000000000000a",
"files": [
{
"file": "art:9f2c02",
"url": "https://files.example.com/image.change_texture/1.png",
"media_type": "image/png",
"task": "image.change_texture",
"job_id": "d2b3c4d500004000800000000000000a",
"created_at": "2026-09-30T11:04:52Z"
}
],
"has_more": false
}The fabric handle stands for the fabric's cover image; a fabric photo url, art: or file: works the same. The image is one of your products, so the result is saved on that product too.
Send a finished image, a fabric — a photo of it or one from your fabric library — and a sentence naming the garment. That garment takes on the fabric's texture, print and colour, while the person, the pose and the scene stay.
Built for
- A design shown in another fabric
- A shoot image matched to the fabric you will produce in
- Fabric options compared on one image
What you get
- One image with the garment's texture, print and colour changed to the fabric's.
Prompting
Say what to change and name the garment when the image shows several ('the red t-shirt should be the ribbed cream knit'). Any language works.
Specs
| Input formats | Images, 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 count | image: one; fabric: one |
| Output format | Files: each one line with its url and its media_type, in the job's result. |
| Outputs per job | One image file per job. |
Choosing a task
- Use this when a garment should take on the texture, print and colour of a fabric you have. Use image.glam when a small detail should change: make-up, a button, jewellery.
Errors
field_not_acceptedinvalid_requestrequest_refusednot_foundpermission_deniedinsufficient_creditsprocessing_failed
Related
fabric.create· It runs before: its result is this input.photoshoot.create· It runs before: its result is this input.image.upscale· It runs after: it takes this task's result.
Good to know
promptis at most 2000 characters.
Pricing: Estimate a request before you run it, or see the price of each option.
For agents and code generation
- https://api.refabric.com/v1/tasks/image.change_texture/llms.txt
- https://api.refabric.com/v1/tasks/image.change_texture/openapi.json
GET https://api.refabric.com/v1/tasks/image.change_texture