Tutorial · Python · ~10 min

Remove JPEG Artifacts and Upscale

Garbage in, garbage upscaled. Clean the compression artifacts first — or let the model do both at once.

PythonJPEG ArtifactsAPI

Why this matters

JPEG/MPEG blocking and ringing become ugly texture when upscaled — the model treats artifacts as detail. Denoising first (or in-model) recovers a clean base.

The right order is: denoise → upscale → sharpen. The API chains them in one job so you can't get it wrong.

How it works

Submit with denoise=high; the job strips blocking artifacts, upscales, and sharpens the result.

Submit a job with an input URL (S3, GCS or HTTPS), poll the job URL, and download the rendered output. No GPU, no queues, no ffmpeg builds to babysit.

Code

Python
import requests, time

API = "https://api.mlslabs.io/v1/super-resolution/jobs"
headers = {"X-API-Key": "YOUR_API_KEY"}
payload = {"input": "s3://bucket/video.mp4", "scale": 2, "model": "real-esrgan-x4", "denoise": "high"}

resp = requests.post(API, json=payload, headers=headers)
job = resp.json()
while job["status"] not in ("succeeded", "failed"):
    time.sleep(3)
    job = requests.get(job["url"], headers=headers).json()

print("Output:", job["output_url"])

Pro tips

  • High denoise for heavy artifacts; medium for lightly compressed sources.
  • Compare a 10-second sample before committing to the batch.
  • Prefer the least-compressed source you have — restoration is lossy for the source.

Pricing note

Usage is metered per minute of media processed; the first tier is free each month. Volume discounts kick in automatically.

FAQ

Common questions

Does denoise hurt fine detail?

High denoise trades some fine texture for clean flat regions; medium is safer when the source is decent.

Can I see the intermediate stage?

Yes — request intermediate outputs for QC.

Is this useful for downloaded web videos?

It helps a lot with low-bitrate YouTube-era captures.