# Face to Sticker

> Create stickers from faces.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/face-to-sticker`
- **Model ID**: `fal-ai/face-to-sticker`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: sticker, 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:


- **`image_url`** (`string`, _required_):
  URL of the video.
  - Examples: "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon.jpg"

- **`prompt`** (`string`, _required_):
  The prompt to use for generating the image. Be as descriptive as possible for best results.
  - Examples: "a person"

- **`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: `""`
  - Default: `""`

- **`num_inference_steps`** (`integer`, _optional_):
  Increasing the amount of steps tells Stable Diffusion that it should take more steps
  to generate your final result which can increase the amount of detail in your image. Default value: `20`
  - Default: `20`
  - Range: `10` to `40`

- **`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: `4.5`
  - Default: `4.5`
  - Range: `0` to `10`

- **`instant_id_strength`** (`float`, _optional_):
  The strength of the instant ID. Default value: `0.7`
  - Default: `0.7`
  - Range: `0` to `1`

- **`ip_adapter_weight`** (`float`, _optional_):
  The weight of the IP adapter. Default value: `0.2`
  - Default: `0.2`
  - Range: `0` to `1`

- **`ip_adapter_noise`** (`float`, _optional_):
  The amount of noise to add to the IP adapter. Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`image_size`** (`ImageSize | Enum`, _optional_):
  The size of the generated image. Default value: `square_hd`
  - Default: `"square_hd"`
  - One of: ImageSize | Enum

- **`upscale`** (`boolean`, _optional_):
  Whether to upscale the image 2x.
  - Default: `false`

- **`upscale_steps`** (`integer`, _optional_):
  The number of steps to use for upscaling. Only used if `upscale` is `true`. Default value: `10`
  - Default: `10`
  - Range: `1` to `20`

- **`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.

- **`enable_safety_checker`** (`boolean`, _optional_):
  If set to false, the safety checker will be disabled. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon.jpg",
  "prompt": "a person"
}
```

**Full Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon.jpg",
  "prompt": "a person",
  "num_inference_steps": 20,
  "guidance_scale": 4.5,
  "instant_id_strength": 0.7,
  "ip_adapter_weight": 0.2,
  "ip_adapter_noise": 0.5,
  "image_size": "square_hd",
  "upscale_steps": 10,
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<Image>`, _required_):
  The generated images.
  - Array of Image
  - Examples: [{"file_size":560358,"height":1024,"file_name":"cd8bab71b946470099d5fa20c7eed440.png","content_type":"image/PNG","url":"https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_1.png","width":1024},{"file_size":452906,"height":1024,"file_name":"181ae8fa12534c6f9285a991b415d9a7.png","content_type":"image/PNG","url":"https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_2.png","width":1024}]

- **`sticker_image`** (`Image`, _required_):
  The generated face sticker image.
  - Examples: {"file_size":560358,"height":1024,"file_name":"cd8bab71b946470099d5fa20c7eed440.png","content_type":"image/PNG","url":"https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_1.png","width":1024}

- **`sticker_image_background_removed`** (`Image`, _required_):
  The generated face sticker image with the background removed.
  - Examples: {"file_size":452906,"height":1024,"file_name":"181ae8fa12534c6f9285a991b415d9a7.png","content_type":"image/PNG","url":"https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_2.png","width":1024}

- **`seed`** (`integer`, _required_):
  Seed used during the inference.
  - Examples: 3625437076

- **`has_nsfw_concepts`** (`Has Nsfw Concepts`, _required_):
  Whether the generated images contain NSFW concepts.
  The key is the image type and the value is a boolean.
  - Examples: {"sticker_image":false,"sticker_image_background_removed":false}



**Example Response**:

```json
{
  "images": [
    {
      "file_size": 560358,
      "height": 1024,
      "file_name": "cd8bab71b946470099d5fa20c7eed440.png",
      "content_type": "image/PNG",
      "url": "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_1.png",
      "width": 1024
    },
    {
      "file_size": 452906,
      "height": 1024,
      "file_name": "181ae8fa12534c6f9285a991b415d9a7.png",
      "content_type": "image/PNG",
      "url": "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_2.png",
      "width": 1024
    }
  ],
  "sticker_image": {
    "file_size": 560358,
    "height": 1024,
    "file_name": "cd8bab71b946470099d5fa20c7eed440.png",
    "content_type": "image/PNG",
    "url": "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_1.png",
    "width": 1024
  },
  "sticker_image_background_removed": {
    "file_size": 452906,
    "height": 1024,
    "file_name": "181ae8fa12534c6f9285a991b415d9a7.png",
    "content_type": "image/PNG",
    "url": "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon_output_2.png",
    "width": 1024
  },
  "seed": 3625437076,
  "has_nsfw_concepts": {
    "sticker_image": false,
    "sticker_image_background_removed": false
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/face-to-sticker \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon.jpg",
     "prompt": "a person"
   }'
```

### 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/face-to-sticker",
    arguments={
        "image_url": "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon.jpg",
        "prompt": "a person"
    },
    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/face-to-sticker", {
  input: {
    image_url: "https://storage.googleapis.com/falserverless/model_tests/face_to_sticker/elon.jpg",
    prompt: "a person"
  },
  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/face-to-sticker)
- [API Documentation](https://fal.ai/models/fal-ai/face-to-sticker/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/face-to-sticker)

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