# Enhance face details

Enhancing face details is needed when image is rather small or is heavily distorted with noise, compression artefacts or is blurred.

Face enhancement can be done when adding "face\_enhance" option to enhancements.

Type of the face enhancement can be selected by setting **face\_enhance\_parameters:type** parameter

```
"enhancements": ["face_enhance"],
"face_enhance_parameters": {
    "type": "beautify-real",
    "level": 0.8,
    "smoothing_level": 0.1
}
```

| Parameter       | Description                                                                   |
| --------------- | ----------------------------------------------------------------------------- |
| type            | Face enhancing algorithm, described below.                                    |
| level           | Level of face enhancement, values from 0.0 to 1.0. Default is 1.0 - 100%      |
| smothing\_level | Additional skin smoothing filter, values from 0.0 to 1.0. Default is 0.0 - 0% |

| type          | description                                                                                                                                                    |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| beautify-real | Enhances face in 2048x2048 resolution, suitable for higher resolution photos effect - real looking skin, no compression/diffusion artifacts. **Default value** |
| beautify      | Enhances face in 512x512 resolution, suitable for beautify effect - smooth skin, no visible artifacts, low resolution though.                                  |

Let's check the examples. Type beautify.

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2Fm3rJtGsDNjg5m0N3B4IS%2FDSC09498-unsharp4.JPG?alt=media&#x26;token=29e52161-7f82-4e4d-94c5-d584a9470d49" alt=""><figcaption><p>Input image</p></figcaption></figure>

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2F4aDH6anMDeJPlPPNVzjt%2FDSC09498-unsharp4-upscaled_x4.jpg?alt=media&#x26;token=fa2359bf-c91e-46a7-a8a6-ab113a03c745" alt=""><figcaption><p>Upscaled 4x with face_enhance option</p></figcaption></figure>

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2Ft5PnFCBxDpQZRmNKVHjo%2FDSC09498-unsharp4-upscaled_x4%20(1).jpg?alt=media&#x26;token=e5ad67cf-e8c2-46c4-852a-cf5d7d6ccffc" alt=""><figcaption><p>Upscaled 4x without face_enhance option</p></figcaption></figure>

Let's correct generated image with 'beautify-real' type.

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FMHqxOL7kAoW5aXmoMe3c%2Fimage.png?alt=media&#x26;token=96ca49f8-9972-4baf-aec3-ca0c98f1babc" alt=""><figcaption><p>Generated face</p></figcaption></figure>

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FciEcxD5bwYtn0vh1MznP%2Fimage.png?alt=media&#x26;token=239d144e-065d-4db6-8b39-d78f312b6b0a" alt=""><figcaption><p>Face enhancement - beautify-real</p></figcaption></figure>

<figure><img src="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FhorlvtUTIzjsRs9OZi3P%2Fimage.png?alt=media&#x26;token=4fe337cb-cd81-4a3d-aa3c-158c843fef6d" alt=""><figcaption><p>Face enhancement - beautify</p></figcaption></figure>
