# IP Adapter Face ID

> High quality zero-shot personalization


## Overview

- **Endpoint**: `https://fal.run/fal-ai/ip-adapter-face-id`
- **Model ID**: `fal-ai/ip-adapter-face-id`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: ip-adapter, personalization, customization, editing



## Pricing

- **Price**: $0 per compute seconds

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`model_type`** (`ModelTypeEnum`, _optional_):
  The model type to use. 1_5 is the default and is recommended for most use cases. Default value: `"1_5-v1"`
  - Default: `"1_5-v1"`
  - Options: `"1_5-v1"`, `"1_5-v1-plus"`, `"1_5-v2-plus"`, `"SDXL-v1"`, `"SDXL-v2-plus"`, `"1_5-auraface-v1"`
  - Examples: "1_5-v1", "1_5-v1-plus", "1_5-v2-plus", "SDXL-v1", "SDXL-v2-plus", "1_5-auraface-v1"

- **`prompt`** (`string`, _required_):
  The prompt to use for generating the image. Be as descriptive as possible for best results.
  - Examples: "Man cyberpunk, synthwave night city, futuristic, high quality, highly detailed, high resolution, sharp, hyper realistic, extremely detailed"

- **`face_image_url`** (`string`, _optional_):
  An image of a face to match. If an image with a size of 640x640 is not provided, it will be scaled and cropped to that size.
  - Examples: "https://storage.googleapis.com/falserverless/model_tests/upscale/image%20(8).png"

- **`face_images_data_url`** (`string`, _optional_):
  URL to zip archive with images of faces. The images embedding will be averaged to
  create a more accurate face id.

- **`negative_prompt`** (`string`, _optional_):
  The negative prompt to use.Use it to address details that you don't want
  in the image. This could be colors, objects, scenery and even the small details
  (e.g. moustache, blurry, low resolution). Default value: `"blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy"`
  - Default: `"blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy"`
  - Examples: "blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy"

- **`seed`** (`integer`, _optional_):
  The same seed and the same prompt given to the same version of Stable Diffusion
  will output the same image every time.
  - Examples: 42

- **`guidance_scale`** (`float`, _optional_):
  The CFG (Classifier Free Guidance) scale is a measure of how close you want
  the model to stick to your prompt when looking for a related image to show you. Default value: `7.5`
  - Default: `7.5`
  - Range: `0` to `16`

- **`num_inference_steps`** (`integer`, _optional_):
  The number of inference steps to use for generating the image. The more steps
  the better the image will be but it will also take longer to generate. Default value: `50`
  - Default: `50`
  - Range: `1` to `200`

- **`num_samples`** (`integer`, _optional_):
  The number of samples for face id. The more samples the better the image will
  be but it will also take longer to generate. Default is 4. Default value: `4`
  - Default: `4`
  - Range: `1` to `4`

- **`width`** (`integer`, _optional_):
  The width of the generated image. Default value: `512`
  - Default: `512`
  - Range: `512` to `1024`

- **`height`** (`integer`, _optional_):
  The height of the generated image. Default value: `512`
  - Default: `512`
  - Range: `512` to `1024`

- **`face_id_det_size`** (`integer`, _optional_):
  The size of the face detection model. The higher the number the more accurate
  the detection will be but it will also take longer to run. The higher the number the more
  likely it will fail to find a face as well. Lower it if you are having trouble
  finding a face in the image. Default value: `640`
  - Default: `640`
  - Range: `64` to `640`

- **`base_1_5_model_repo`** (`string`, _optional_):
  The URL to the base 1.5 model. Default is SG161222/Realistic_Vision_V4.0_noVAE Default value: `"SG161222/Realistic_Vision_V4.0_noVAE"`
  - Default: `"SG161222/Realistic_Vision_V4.0_noVAE"`

- **`base_sdxl_model_repo`** (`string`, _optional_):
  The URL to the base SDXL model. Default is SG161222/RealVisXL_V3.0 Default value: `"SG161222/RealVisXL_V3.0"`
  - Default: `"SG161222/RealVisXL_V3.0"`



**Required Parameters Example**:

```json
{
  "prompt": "Man cyberpunk, synthwave night city, futuristic, high quality, highly detailed, high resolution, sharp, hyper realistic, extremely detailed"
}
```

**Full Example**:

```json
{
  "model_type": "1_5-v1",
  "prompt": "Man cyberpunk, synthwave night city, futuristic, high quality, highly detailed, high resolution, sharp, hyper realistic, extremely detailed",
  "face_image_url": "https://storage.googleapis.com/falserverless/model_tests/upscale/image%20(8).png",
  "negative_prompt": "blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy",
  "seed": 42,
  "guidance_scale": 7.5,
  "num_inference_steps": 50,
  "num_samples": 4,
  "width": 512,
  "height": 512,
  "face_id_det_size": 640,
  "base_1_5_model_repo": "SG161222/Realistic_Vision_V4.0_noVAE",
  "base_sdxl_model_repo": "SG161222/RealVisXL_V3.0"
}
```


### Output Schema

The API returns the following output format:

- **`image`** (`Image`, _required_):
  The generated image file info.

- **`seed`** (`integer`, _required_):
  Seed of the generated Image. It will be the same value of the one passed in the
  input or the randomly generated that was used in case none was passed.



**Example Response**:

```json
{
  "image": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019,
    "width": 1024,
    "height": 1024
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/ip-adapter-face-id \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "Man cyberpunk, synthwave night city, futuristic, high quality, highly detailed, high resolution, sharp, hyper realistic, extremely detailed"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/ip-adapter-face-id",
    arguments={
        "prompt": "Man cyberpunk, synthwave night city, futuristic, high quality, highly detailed, high resolution, sharp, hyper realistic, extremely detailed"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/ip-adapter-face-id", {
  input: {
    prompt: "Man cyberpunk, synthwave night city, futuristic, high quality, highly detailed, high resolution, sharp, hyper realistic, extremely detailed"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/ip-adapter-face-id)
- [API Documentation](https://fal.ai/models/fal-ai/ip-adapter-face-id/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/ip-adapter-face-id)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
