v0.8.0 — /inpaint via LaMa
Added
-
POST /inpaint— large-mask inpainting via LaMa (Apache-2.0) through the simple-lama-inpainting wrapper. Resolution-robust, deterministic, no prompts. Three auto-detected input modes:- auto-subject (no mask, no bbox) — BiRefNet derives the subject mask, inverts it. Drop in a photo, get the subject erased.
- mask — user-supplied PNG mask (white = inpaint, black = keep).
- bbox — send
x, y, w, hform fields, server synthesizes a rectangular mask.
-
Optional
dilationparam (default 8, range 0..32) expands the mask before inpainting to eliminate ghost outlines from tight masks.
How it works
Pipeline preserves full input resolution: dilate mask → downscale to 1024 max-edge → run LaMa → upscale result → composite over the original so unmasked pixels stay byte-identical to input. Same trick used by lama-cleaner.
Demo
curl -X POST "https://useknockout--api.modal.run/inpaint" \
-H "Authorization: Bearer kno_public_beta_4d7e9f1a3c5b2e8d6a9f7c1b3e5d8a2f" \
-F "file=@photo.jpg" \
-o erased.pngThat's auto-subject mode — drop in any photo, get the subject removed. To target a specific region:
# bbox
curl ... -F "x=100" -F "y=100" -F "w=300" -F "h=400"
# user-supplied mask
curl ... -F "mask=@my-mask.png"Response headers
x-knockout-model: big-lamax-knockout-mode: auto-subject | mask | bboxx-knockout-warning: <text>when mask covers >50% of the image (LaMa quality degrades on huge masks)
Endpoint count
23 endpoints in one image API (was 22).
Full changelog: v0.7.1...v0.8.0