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

Image editing

Changes one thing in an image you send — its background, frame, face, pose, fabric, views or finish — and keeps the rest.

Tasks

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.

Change an image's background

Put a finished image on a new background — a backdrop from your library, a photo, a scene you describe, or none at all (a transparent PNG) — keeping everything in front of it as it is. Delivered as one image file.

Expand an image

Grow a finished image outward by a number of pixels on each side, filling the new space with more of the same scene. Delivered as one image file.

Fix the face in an image

Redo the face in a finished shoot image so it matches the model it was shot with, leaving the pose, the garment and the background as they are. Delivered as one image file.

Change one detail of an image

Change one thing you name in a finished image — the lipstick, a button, an earring — and leave the rest untouched. Delivered as one image file.

Put a model in new poses

Put the same person in the same clothes into new poses — picked from the pose library or described in words. Delivered as one image file per pose, in the order you listed them.

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.

Rotate an image to its other views

Turn the subject of an image around: its back, left and right views, keeping its medium and style. Delivered as up to three image files, in that order.

Polish shoot images

Correct the light and colour of finished images of one of your shoots, keeping everything else. One polished file per image.

Quick start

image.change_texture

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())