Skip to main content
POST
/
v1
/
phota
/
enhance
Enhance
curl --request POST \
  --url https://api.photalabs.com/v1/phota/enhance \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "image": "<string>",
  "profile_ids": [
    "<string>"
  ],
  "num_output_images": 1
}
'
{
  "images": [
    "<string>"
  ],
  "known_subjects": {
    "counts": {}
  }
}

Authorizations

X-API-Key
string
header
required

Body

application/json

Request body for the enhance endpoint.

Enhances the provided input image without requiring a text prompt, aspect ratio, or resolution -- those parameters are inferred automatically.

The image can be provided as a raw base64-encoded string or a publicly accessible URL. Both formats are accepted and detected automatically.

image
string
required

Input image as a raw base64 string or publicly accessible URL.

profile_ids
string[]

Subset of your account's profiles relevant to this request. Your account holds all profiles, but only pass the ones belonging to the end-user whose photo is being edited. These profiles serve as candidates for identity preservation. The fewer profiles you pass, the easier it is for our system to determine which profiles are relevant.

num_output_images
integer
default:1

Number of output images to generate (1-4).

Required range: 1 <= x <= 4

Response

Successful Response

Response returned by the edit and generate endpoints.

images
string[]
required

Base64-encoded PNG output image(s).

known_subjects
KnownGeneratedSubjectCounts · object
required

Dictionary mapping a known subject's profile_id to the number of times they were generated. If multiple variations are generated, this will be the aggregated count across all variations.