# 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.

**Endpoint:** `POST https://api.refabric.com/v1/tasks/image.face_fix` · **Task:** `image.face_fix` · **Scope:** `tasks:run` · **Category:** Image editing

Send a finished image of a model and the face is redone to match the model it was shot with; the pose, the garment and the background stay. The model is known from the shoot, through every later edit; for any other image, send `model`.

## Quick start

```python
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.face_fix",
    headers=headers,
    json={
        "image": "art:9f2c01",
    },
).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())
```

```javascript
const headers = {
  Authorization: `Key ${process.env.REFABRIC_API_KEY}`,
  "Content-Type": "application/json",
};

const job = await fetch("https://api.refabric.com/v1/tasks/image.face_fix", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "image": "art:9f2c01"
  }),
}).then((r) => r.json());
console.log(job.job_id);

let status = job;
while (status.lifecycle !== "terminal") {
  await new Promise((r) => setTimeout(r, 5000));
  status = await fetch(job.status_url, { headers }).then((r) => r.json());
}

console.log(await fetch(job.result_url, { headers }).then((r) => r.json()));
```

```bash
curl -X POST "https://api.refabric.com/v1/tasks/image.face_fix" \
  -H "Authorization: Key $REFABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Prefer: wait=60" \
  -d '{"image":"art:9f2c01"}'
```

## Input schema

- `image` (string, _required_, pattern: ^(https://|art:|file:).+$) — A finished image of a model: from `photoshoot.create`, `mannequin_photoshoot.create`, or an edit of one. The model is known from the image's shoot, else from `model`; an image with neither is refused (`image_has_no_model`) before anything is charged. 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 in a project or on a design in the Refabric app, the result is filed there too.
  Example: `art:9f2c01`
- `model` (string, _optional_, pattern: ^model:.+$) — The model the image shows, as a `model:<id>` handle (`GET /v1/refs/model`). An image from a shoot, or an edit of one, already carries its model; send `model` for any other picture (an upload, a url).

## Required-fields example

```json
{
  "image": "art:9f2c01"
}
```

## Full example

```json
{
  "image": "art:9f2c01"
}
```

## Output schema

- `files` (array<object>, _optional_) — One file: the image with the face redone. Pass it on to another edit to continue from it.

## Response example

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

## Result example

```json
{
  "job_id": "d2b3c4d500004000800000000000000d",
  "files": [
    {
      "file": "art:9f2c05",
      "url": "https://files.example.com/image.face_fix/1.png",
      "media_type": "image/png",
      "task": "image.face_fix",
      "job_id": "d2b3c4d500004000800000000000000d",
      "created_at": "2026-10-01T09:25:31Z"
    }
  ],
  "has_more": false
}
```

The image is a photoshoot frame, so its model is known from the shoot. An upload, or any image no shoot or model change made, is refused with `image_has_no_model` (422).

## Built for

- A shoot image whose face drifted from the model
- The model's face put back after other edits
- An upload given the face of one of your models

## What you get

- One image with the face redone to match the model.

## 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
- **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 the face should look like the model again. Use `image.glam` when you want one feature changed, such as the lipstick or an earring.

## Errors

- `field_not_accepted`
- `invalid_request`
- `not_found`
- `permission_denied`
- `insufficient_credits`
- `content_refused`
- `processing_failed`
- `image_has_no_model`

## Related

- `photoshoot.create` — It runs before: its result is this input.
- `mannequin_photoshoot.create` — It runs before: its result is this input.
- `image.change_background` — It does a neighbouring job.

## For agents and code generation

- https://api.refabric.com/v1/tasks/image.face_fix/llms.txt
- https://api.refabric.com/v1/tasks/image.face_fix/openapi.json
- GET https://api.refabric.com/v1/tasks/image.face_fix
