Sharpen

This documentation is valid for the following list of our models:

  • topaz-labs/sharpen

Model Overview

The model produces sharper visuals, eliminating blur and improving clarity across the subject or the entire frame.

Setup your API Key

If you don’t have an API key for the AI/ML API yet, feel free to use our Quickstart guide.

API Schema

post
Authorizations
Body
modelundefined · enumRequiredPossible values:
modestring · enumRequiredPossible values:
image_urlstring · uriRequired

The URL of the reference image.

strengthnumber · min: 0.01 · max: 1Optional

Defines the overall intensity of the sharpening effect. Increases details. Too much sharpening can create an unrealistic result.

minor_denoisenumber · min: 0.01 · max: 1Optional

Removes noisy pixels to increase clarity. Can slightly increase image sharpness.

output_formatstring · enumOptional

The format of the generated image.

Default: jpegPossible values:
subject_detectionstring · enumOptional

Specifies which subjects to detect and process. Options: 'All' (detect all subjects), 'Foreground' (detect only foreground subjects), 'Background' (detect background subjects).

Default: AllPossible values:
face_enhancementbooleanOptional

Whether to enhance faces in the image. When true, the model applies face-specific improvements.

Default: true
face_enhancement_creativitynumber · max: 1Optional

Level of creativity for face enhancement (0-1). Higher values allow more creative, less conservative changes.

Default: 0
face_enhancement_strengthnumber · max: 1Optional

How sharp enhanced faces are relative to background (0-1). Lower values blend changes subtly; higher values make faces more pronounced.

Default: 0.8
Responses
201

Successfully generated image

application/json
post
/v1/images/generations
async function main() {
  const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      model: 'topaz-labs/sharpen',
      image_url: 'https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blurred-landscape.png',
      mode: 'Strong',
      strength: 0.9,
    }),
  });

  const data = await response.json();
  console.log(JSON.stringify(data, null, 2));
}

main();
201

Successfully generated image

{
  "data": [
    {
      "url": "text",
      "b64_json": "text"
    }
  ]
}

Quick Example

Let's sharpen a relatively strongly blurred image using the Strong mode while adjusting the strength parameter.

import requests
import json

def main():
    response = requests.post(
        "https://api.aimlapi.com/v1/images/generations",
        headers={
            # Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
            "Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
            "Content-Type": "application/json",
        },
        json={
          "model": "topaz-labs/sharpen",
          "image_url": "https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blurred-landscape.png",
          "mode": "Strong",
          "strength": 0.9,
          "minor_denoise": 0.9,
          "output_format": "png",
        }
    )

    data = response.json()
    print(json.dumps(data, indent=2, ensure_ascii=False))

if __name__ == "__main__":
    main()
Response
{
  "data": [
    {
      "url": "https://cdn.aimlapi.com/komodo/output/6435616/ddb723c4-ed16-42f4-8818-9ca4de176ea7.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Checksum-Mode=ENABLED&X-Amz-Credential=ccc352dcd71a436e5fd697125a1be9f8%2F20251027%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20251027T162246Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&x-id=GetObject&X-Amz-Signature=4f4c449772b258bcf53e7257444698e2e486832e77ab5835728afc4aabfa0f8c"
    }
  ],
  "meta": {
    "usage": {
      "tokens_used": 210000
    }
  }
}
Blurred Image
Deblurred Image
"mode": "Strong" "strength": 0.9

For clarity, we’ve created a split image showing the results of different parameter settings.

Last updated

Was this helpful?