Skip to main content
FLUX Deblur takes a single blurry image and returns a sharper version of the same scene. It is designed to restore detail while staying faithful to the input image, with no prompt and no mask required.

Example output

Drag the slider to compare the blurry input image (left) against the deblurred result (right).

More examples

Endpoint

Submit a deblur job:
POST https://api.bfl.ai/v1/flux-tools/deblur-v1
x-key: $BFL_API_KEY
Poll for the result:
GET https://api.bfl.ai/v1/get_result?id=<TASK_ID>
x-key: $BFL_API_KEY

Quick start

The API uses an asynchronous workflow:
1

Submit a deblur request

POST your blurry input image to the endpoint as base64 or an HTTP(S) URL. The model sharpens the whole image automatically - no prompt or mask is accepted.
2

Poll for the result

Use the returned polling_url to check status until the deblurred image is ready.
#!/usr/bin/env python3
import base64
import os
import time
import requests

API_KEY = os.environ["BFL_API_KEY"]
BASE = "https://api.bfl.ai"
HEADERS = {"accept": "application/json", "x-key": API_KEY, "Content-Type": "application/json"}

IMAGE_PATH = "/path/to/blurry-input.png"

with open(IMAGE_PATH, "rb") as f:
    image_b64 = base64.b64encode(f.read()).decode()

payload = {
    "image": image_b64,
    "output_format": "png",
}

submit = requests.post(f"{BASE}/v1/flux-tools/deblur-v1", headers=HEADERS, json=payload)
submit.raise_for_status()
meta = submit.json()

task_id = meta["id"]
poll_url = meta.get("polling_url", f"{BASE}/v1/get_result?id={task_id}")

while True:
    r = requests.get(poll_url, headers={"accept": "application/json", "x-key": API_KEY})
    r.raise_for_status()
    result = r.json()

    status = result.get("status")
    if status == "Ready":
        print("Result URL:", result["result"]["sample"])
        break
    if status in {"Error", "Request Moderated", "Content Moderated", "Task not found"}:
        raise RuntimeError(f"Deblur failed with status: {status} | payload: {result}")

    time.sleep(1)

Request parameters

Use image as the minimum payload.
ParameterTypeRequiredDescription
imagestringYesBlurry input image as base64 or an HTTP(S) image URL. Maximum image area is 4 MP
seedintegerNoOptional seed for reproducibility
safety_toleranceintegerNo0-5, defaults to 2. Moderation strictness for input and output
output_formatstringNopng (default), jpeg, or webp
webhook_urlURLNoAsync callback
webhook_secretstringNoSignature secret
No prompt or mask parameter is sent by the caller. The server applies a fixed deblurring instruction to the whole image.

Response format

Initial response

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "polling_url": "https://api.bfl.ai/v1/get_result?id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Always poll the URL returned in the response.

Polling response (success)

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "Ready",
  "result": {
    "sample": "https://delivery.bfl.ai/..."
  }
}
When status is "Ready", use result.sample.
Signed delivery URLs are only valid for 10 minutes. Retrieve your result within this timeframe.

How it works

FLUX Deblur treats blur removal as a guided image edit. It reconstructs fine detail while staying anchored to the input, so character identity, colors, objects, lighting, and composition remain faithful to the original scene instead of being re-imagined. The endpoint is powered by a FLUX.2 Klein 9B image-to-image finetune trained on blurry-to-sharp image pairs. Because it uses the Klein backbone, it is suitable for low-latency, lower-cost, high-volume, or interactive workflows.

Tips for best results

  • Use images where the underlying scene is still recognizable. Heavy blur can be reduced substantially, but the endpoint is not a perfect restorer for severely degraded inputs.
  • Run deblur before downstream cleanup steps such as upscaling, outpainting, or publication export.

Limitations

  • Heavily degraded inputs may contain residual blur or reconstructed details that are not exact.
  • Since the endpoint is based on Klein, typography and human anatomy can be faulty, especially for heavily blurred images.
  • Deblur is applied to the full image. It does not support region-specific masks.

Troubleshooting

  • 403 Forbidden - your API key is missing or your project does not have access to this endpoint.
  • 422 / validation errors - check base64 encoding, image URL accessibility, and the 4 MP maximum image area.
  • Result still looks blurry - the input may be too degraded; try using the least compressed source available.
  • Unexpected artifacts - try a cleaner source image or run deblur before other enhancement steps.
For the full list of HTTP status codes and polling response types returned by the API, see the Errors reference.