> For the complete documentation index, see [llms.txt](https://documentation.deep-image.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.deep-image.ai/common-usecases/face-swap.md).

# Face swap

Face swapping API can be used for replacing the face on the original image with another one.

```json
{
    "url": "original_image",
    "background": {
        "generate": {
            "adapter_type": "face",
            "avatar_generation_type": "creative_img2img",
            "ip_image2": "replacement_face_url"
        }
    }
}
```

### Whole head swap

By default, face swap replaces the face area only.

To swap the whole head, set `background.generate.generation_type` to `"head_swap"`.

This works well when hairstyle, head shape, or head position should also change.

```json
{
    "url": "original_image",
    "background": {
        "generate": {
            "adapter_type": "face",
            "avatar_generation_type": "creative_img2img",
            "generation_type": "head_swap",
            "ip_image2": "replacement_face_url"
        }
    }
}
```

Let's swap a head from this photo to another:

<figure><img src="/files/xPlWu7PXvEbUHPJdKiH0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/V4OFlfdGtQuVIFkkVlq0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/p0mUwetHvPibDRpuSh88" alt=""><figcaption></figcaption></figure>
