p-try-on-glasses

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

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

Start with uploading your images

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

Required Parameters
ParameterTypeDescription
personstringImage URL of a person to try glasses on
glassstringImage URL of the glasses to apply
Optional Parameters
ParameterTypeDefaultDescription
disable_safety_checkerbooleanfalseDisable safety checker for generated images