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
The URL of the reference image.
Defines the overall intensity of the sharpening effect. Increases details. Too much sharpening can create an unrealistic result.
Removes noisy pixels to increase clarity. Can slightly increase image sharpness.
The format of the generated image.
jpegPossible values: Specifies which subjects to detect and process. Options: 'All' (detect all subjects), 'Foreground' (detect only foreground subjects), 'Background' (detect background subjects).
AllPossible values: Whether to enhance faces in the image. When true, the model applies face-specific improvements.
trueLevel of creativity for face enhancement (0-1). Higher values allow more creative, less conservative changes.
0How sharp enhanced faces are relative to background (0-1). Lower values blend changes subtly; higher values make faces more pronounced.
0.8Successfully generated image
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();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()async function main() {
const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
method: 'POST',
headers: {
// Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
'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,
minor_denoise: 0.9,
output_format: 'png',
}),
});
}
main();

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

Last updated
Was this helpful?