Image Upscaling

Upscale images up to 4x using AI (Real-ESRGAN). Returns the enhanced image in your chosen format and resolution.

POST/v1/services/image-upscaling

Overview

Upscale a single image using AI. Increases resolution by 2x or 4x while enhancing detail and reducing blur. Output can be JPEG, PNG, or WebP.

2x / 4x
Scale factor
3
Output formats
50
Max batch size

Authentication

Include your API key in the Authorization header.

Header
Authorization: Bearer sk-live-your-api-key

Create API keys in your . account settings

Request

Query Parameters

ParameterTypeDefaultDescription
scale_factor integer 4Upscale factor: 2 or 4
output_format string jpegjpeg, png, or webp. PNG/WebP are ~6x slower.
quality integer 85Output quality (1–100). Only applies to JPEG and WebP.

Body

Send as multipart/form-data.

FieldTypeRequiredDescription
file binary RequiredImage file to upscale (JPEG, PNG, WebP). Max 50 MB.

Examples

4x upscale as JPEG
curl -X POST "https://api.maskr.io/v1/services/image-upscaling?scale_factor=4&output_format=jpeg&quality=90" \
  -H "Authorization: Bearer sk-live-your-api-key" \
  -F "[email protected]"

Response

200 OK
{
  "job_id": "abc123-def456",
  "status": "completed",
  "result": {
    "job_id": "abc123-def456",
    "status": "completed",
    "input_filename": "photo.jpg",
    "output_url": "https://api.maskr.io/v1/files/abc123-def456?expires=...&sig=...",
    "processing_time_ms": 2340.5,
    "error": null,
    "original_width": 512,
    "original_height": 384,
    "output_width": 2048,
    "output_height": 1536,
    "credits_used": 5
  },
  "error": null
}

Response Fields

FieldTypeDescription
job_id string Unique job identifier
status string pending, processing, completed, or failed
result.output_url string | null Signed URL to download the upscaled image
result.original_width / original_height integer | null Input image dimensions
result.output_width / output_height integer | null Upscaled output dimensions
result.processing_time_ms number | null Processing time in milliseconds
result.credits_used integer | null Number of credits consumed
error string | null Error message if processing failed
401Unauthorized
Missing or invalid API key. Check your Authorization header.
402Insufficient Credits
{"detail": "Insufficient credits"}
Not enough credits to process this image. . Top up your balance
413File Too Large
Image exceeds the maximum file size limit (50 MB).
422Validation Error
{
  "detail": [
    {
      "loc": ["body", "file"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Batch Processing

POST/v1/services/image-upscaling/batch

Process up to 50 images in a single request. Send multiple files using the files field. The same scale_factor, output_format, and quality query parameters apply to all images in the batch.

cURL
curl -X POST "https://api.maskr.io/v1/services/image-upscaling/batch?scale_factor=2&output_format=jpeg" \
  -H "Authorization: Bearer sk-live-your-api-key" \
  -F "[email protected]" \
  -F "[email protected]" \
  -F "[email protected]"
Batch Response
{
  "batch_id": "batch-789",
  "status": "completed",
  "total_files": 3,
  "completed": 3,
  "failed": 0,
  "results": [
    { "job_id": "job-1", "status": "completed", "output_url": "...", ... },
    { "job_id": "job-2", "status": "completed", "output_url": "...", ... },
    { "job_id": "job-3", "status": "completed", "output_url": "...", ... }
  ],
  "total_processing_time_ms": 7820.3,
  "total_credits_used": 15,
  "error": null
}
Partial Failures

If you run out of credits mid-batch, the API processes as many images as possible and marks the rest as failed. Check the completed and failed counts, and inspect each result’s status field.