Codeformer

2.52 credits/MP
ae_codeformer

Restore and enhance faces in photos, with options for face alignment, facial upscaling, and detail preservation.

ImageUpscaling
2.52 credits/MP

Pricing

2.52 AE credits per MP. Charge for successfully returned images. Charge proportionally to actual pixels. One MP is 1024 by 1024 pixels.

2.52 credits/MP

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
request_bodyobjectYesNo parameter description.—
request_body.seedinteger | unknownNoRandom seed for reproducible generation.—
request_body.alignedbooleanNoShould faces etc should be aligned.false
request_body.fidelitynumberNoWeight of the fidelity factor.0.5
request_body.image_urlstringYesURL of image to be used for relighting—
request_body.face_upscalebooleanNoShould faces be upscaledtrue
request_body.upscale_factornumberNoUpscaling factor2
request_body.only_center_facebooleanNoShould only center face be restoredfalse

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key

Submit first, then query with the returned task_id until the task completes.

Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_codeformer' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "request_body": {
      "aligned": true,
      "face_upscale": true,
      "fidelity": 0.6,
      "image_url": "https://agentearth.ai/fileserver/file/16e6f30d-e27a-4484-8018-829053d1ea9a.jpg",
      "only_center_face": false,
      "upscale_factor": 1
    }
  }
}'
Response exampleresponse.json
JSON
{
  "description": "task accepted; poll the result via query_tool with this task_id",
  "query_tool": "ae_get_result",
  "status": "created",
  "task_id": "838b51cf-d25c-4cd2-b1a5-161316005e88"
}