---
title: "p-try-on-glasses"
url: "https://docs.api.pruna.ai/guides/models/p-try-on-glasses"
image: "https://docs.api.pruna.ai/_og/d/c_Ocean.takumi,title_p-try-on-glasses,props_eyJ0aGVtZSI6eyJtb2RlIjoibGlnaHQiLCJjb2xvcnMiOnsicHJpbWFyeSI6IiM3YzNhZWQifX19,p_Ii9ndWlkZXMvbW9kZWxzL3AtdHJ5LW9uLWdsYXNzZXMi,s_CO_ruygAhd_jM58y.png"
---

# p-try-on-glasses

Try on glasses virtually by compositing a glasses image onto a person's photo

## [Overview](#overview)

p-try-on-glasses is Pruna's virtual try-on model that composites glasses onto a person's photo. Provide a photo of a person and an image of glasses, and the model will realistically place the glasses on the person's face.

**Rate Limit:** 500 requests per minute

**Category:** Image Editing

**Price:** $0.02 / image

## [Quickstart](#quickstart)

### [Start with uploading your images](#start-with-uploading-your-images)

```bash
# Upload person photo
curl -X POST "https://api.pruna.ai/v1/files" \
  -H "apikey: YOUR_API_KEY" \
  -F "content=@/path/to/person.jpg"

# Upload glasses image
curl -X POST "https://api.pruna.ai/v1/files" \
  -H "apikey: YOUR_API_KEY" \
  -F "content=@/path/to/glasses.png"
```

Note: Use -F (form) with @ prefix to upload a file from your local filesystem. The file path should be absolute or relative to your current directory.

##### Try On Glasses (Synchronous)

```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H 'apikey: YOUR_API_KEY' \
-H 'Model: p-try-on-glasses' \
-H 'Try-Sync: true' \
-d '{
"input": {
"person": "https://your-url.com/person.jpg",
"glass": "https://your-url.com/glasses.png"
}
}'
```

##### Try On Glasses (Asynchronous)

```bash
curl -X POST 'https://api.pruna.ai/v1/predictions' \
-H 'Content-Type: application/json' \
-H 'apikey: YOUR_API_KEY' \
-H 'Model: p-try-on-glasses' \
-d '{
"input": {
"person": "https://your-url.com/person.jpg",
"glass": "https://your-url.com/glasses.png"
}
}'
```

#### [Parameters](#parameters)

###### Required Parameters

| Parameter | Type   | Description                             |
| :-------- | :----- | :-------------------------------------- |
| person    | string | Image URL of a person to try glasses on |
| glass     | string | Image URL of the glasses to apply       |

##### Optional Parameters

| Parameter              | Type    | Default | Description                                 |
| :--------------------- | :------ | :------ | :------------------------------------------ |
| disable_safety_checker | boolean | false   | Disable safety checker for generated images |