POST /v1/enhance
Image Enhance API
Improve image quality with auto-enhance, denoise, sharpening, white balance, and basic upscaling.
Opérations clés
auto_enhance
denoise
deblur_basic
sharpen
upscale_basic
fix_dark_photo
fix_overexposed_photo
white_balance
Cas d’utilisation
Low-quality image cleanup
Commerce photo polishing
Import pipeline normalization
Cycle de vie de la tâche async
Tous les endpoints de traitement ImageHQ sont asynchrones. Après un POST réussi, vous recevez une réponse 202 Acceptedavec un job_id. Interrogez l’endpoint de statut jusqu’à ce que l’état atteigne succeeded.
Exemple de requête
import requests
url = "https://api.imagehq.io/v1/enhance"
payload = {
"operation": "auto_enhance",
"options": {
"preserve_natural_tones": True,
"strength": 0.7
},
"tool_slug": "auto-enhance"
}
files = [("files[]", open("image.png", "rb"))]
data = {"request": json.dumps(payload)}
response = requests.post(url, files=files, data=data)
print(response.json())const form = new FormData();
form.append("files[]", file);
form.append("request", JSON.stringify({
"operation": "auto_enhance",
"options": {
"preserve_natural_tones": true,
"strength": 0.7
},
"tool_slug": "auto-enhance"
}));
const response = await fetch("https://api.imagehq.io/v1/enhance", {
method: "POST",
headers: { "Idempotency-Key": crypto.randomUUID() },
body: form
});
const data = await response.json();
console.log(data);const form = new FormData();
form.append("files[]", file);
form.append("request", JSON.stringify({
"operation": "auto_enhance",
"options": {
"preserve_natural_tones": true,
"strength": 0.7
},
"tool_slug": "auto-enhance"
}));
const response = await fetch("https://api.imagehq.io/v1/enhance", {
method: "POST",
headers: { "Idempotency-Key": crypto.randomUUID() },
body: form
});
const data = await response.json();
console.log(data);curl -X POST "https://api.imagehq.io/v1/enhance" \
-H "Idempotency-Key: $(uuidgen)" \
-F "files[]=@image.png" \
-F 'request={"operation":"auto_enhance","options":{"preserve_natural_tones":true,"strength":0.7},"tool_slug":"auto-enhance"}'$client = new GuzzleHttp\Client();
$response = $client->post("https://api.imagehq.io/v1/enhance", [
"multipart" => [
["name" => "files[]", "contents" => fopen("image.png", "r")],
["name" => "request", "contents" => '{"operation":"auto_enhance","options":{"preserve_natural_tones":true,"strength":0.7},"tool_slug":"auto-enhance"}']
]
]);require "faraday"
response = Faraday.post("https://api.imagehq.io/v1/enhance") do |req|
req.headers["Idempotency-Key"] = SecureRandom.uuid
req.body = { "files[]" => Faraday::UploadIO.new("image.png", "image/png"), "request" => '{"operation":"auto_enhance","options":{"preserve_natural_tones":true,"strength":0.7},"tool_slug":"auto-enhance"}' }
endbody := &bytes.Buffer{}
writer := multipart.NewWriter(body)
writer.WriteField("request", `{"operation":"auto_enhance","options":{"preserve_natural_tones":true,"strength":0.7},"tool_slug":"auto-enhance"}`)
file, _ := writer.CreateFormFile("files[]", "image.png")
_ = file
writer.Close()
http.Post("https://api.imagehq.io/v1/enhance", writer.FormDataContentType(), body)HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.imagehq.io/v1/enhance"))
.header("Idempotency-Key", UUID.randomUUID().toString())
.POST(HttpRequest.BodyPublishers.ofString("multipart form data"))
.build();using var form = new MultipartFormDataContent();
form.Add(new StringContent('{"operation":"auto_enhance","options":{"preserve_natural_tones":true,"strength":0.7},"tool_slug":"auto-enhance"}'), "request");
form.Add(new StreamContent(File.OpenRead("image.png")), "files[]", "image.png");
await httpClient.PostAsync("https://api.imagehq.io/v1/enhance", form);var request = URLRequest(url: URL(string: "https://api.imagehq.io/v1/enhance")!) request.httpMethod = "POST" request.setValue(UUID().uuidString, forHTTPHeaderField: "Idempotency-Key") // Attach multipart files[] and request fields before sending.
Réponse réussie
{
"completed": {
"download_url": "/v1/jobs/job_123/download",
"expires_at": "2026-05-03T00:00:00Z",
"id": "job_123",
"inputs": [
{
"filename": "input.png",
"format": "png",
"mime_type": "image/png",
"size_bytes": 420122
}
],
"outputs": [
{
"filename": "output.jpg",
"format": "jpg",
"id": "0",
"mime_type": "image/jpeg",
"size_bytes": 161002
}
],
"progress": 100,
"retention_policy": {
"clamp": true,
"ttl_hours": 24
},
"stages": [
{
"name": "queued",
"progress": 100,
"status": "succeeded"
},
{
"name": "processing",
"progress": 100,
"status": "succeeded"
}
],
"status": "succeeded",
"warnings": []
},
"queued": {
"client_reference_id": "example-123",
"created_at": "2026-05-02T00:00:00Z",
"current_stage": "queued",
"expires_at": "2026-05-03T00:00:00Z",
"id": "job_123",
"operation": "enhance",
"poll_url": "/v1/jobs/job_123",
"progress": 0,
"status": "queued",
"tool_slug": "png-to-jpg"
}
}Questions fréquentes
Does enhance use AI models?
This iteration focuses on classic enhancement operations without AI dependencies.
Can I sharpen and denoise together?
Yes. Enhance operations can be configured per request and combined in pipelines.
Does enhance preserve metadata?
Use output options to control metadata preservation or stripping.