p-try-on-glasses
Try on glasses virtually by compositing a glasses image onto a person's photo
Try on glasses virtually by compositing a glasses image onto a person's photo
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
# 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.
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"
}
}'
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"
}
}'
| Parameter | Type | Description |
|---|---|---|
| person | string | Image URL of a person to try glasses on |
| glass | string | Image URL of the glasses to apply |
| Parameter | Type | Default | Description |
|---|---|---|---|
| disable_safety_checker | boolean | false | Disable safety checker for generated images |