API reference/POST /studio-shot

E-commerce studio shot

One-call e-commerce preset: cutout, padding, soft drop shadow, neutral background. Tuned for catalog images and Shopify-style product tiles.

POSThttps://useknockout--api.modal.run/studio-shot

Parameters

Send as multipart/form-data unless noted otherwise.

filerequiredfileImage to process. JPG, PNG, WebP, HEIC. Up to 10 MB and 4096×4096.
bg_colorstring#FFFFFFBackground hex color.
paddingint10%Padding as pixels or % of canvas.
shadowbooleantrueWhether to add a soft drop shadow.
transparentbooleanfalseKeep a transparent background. Ignores bg_color and shadow (a shadow needs an opaque bg). Output is forced to PNG if format=jpg, since jpg can't carry alpha.
aspectstring1:1Output aspect ratio.
enhancebooleanfalseOff by default. Set true for a subtle brightness + saturation lift (ecommerce-ready). Leave off for true-to-life color.
enhance_strengthfloat 0-0.50.15Lift amount. Only applies when enhance=true.
qualityint 1-10092JPEG/WebP quality. Ignored for PNG.
max_dimintClamp the longest output edge to N pixels (downscale only). Aspect preserved.
widthintResize output to an exact width in pixels. Use with height, or alone to scale by aspect.
heightintResize output to an exact height in pixels.
despillbooleanfalseRemove colored edge spill (green/blue fringing) bled onto the subject from the old background. Knockout Plus only.
watermarkstringURL of a watermark image (PNG with alpha) to overlay on the output. Knockout Plus only.
watermark_opacityfloat 0-11.0Watermark opacity. Only applies when watermark is set. Knockout Plus only.
presetstringApply a saved preset by id (see /presets). Explicit params override the preset's stored values.

Request

curl -X POST "https://useknockout--api.modal.run/studio-shot" \
  -H "Authorization: Bearer $KNOCKOUT_TOKEN" \
  -F "file=@product.jpg" \
  -F "transparent=true" \
  --output studio.png

Response

HTTP/1.1 200 OK
content-type: image/png
content-length: 254312
x-knockout-latency: 184
x-knockout-model: BiRefNet
x-ratelimit-limit: 60
x-ratelimit-remaining: 59

Errors

401unauthorizedMissing or invalid token.
402payment_requiredFree tier exhausted. Add a card to continue.
413payload_too_largeImage exceeds 10 MB or 4096×4096.
422no_subject_detectedForeground could not be isolated from background.
429rate_limit_exceededSlow down. Retry-After header tells you when.
500internal_errorSomething broke on our side. Include request_id when reporting.
Every error response also includes a request_id in the JSON body. Quote it when reporting issues.

Notes

  • Defaults match Shopify and Amazon catalog requirements: 1:1, white bg, 10% padding.
  • Override aspect to 4:5 for Instagram, 16:9 for desktop catalog headers.
  • When transparent=true, bg_color and shadow are ignored.
  • Output is opaque, so jpg is valid (unless transparent=true, which forces PNG).
  • enhance is off by default. Output is unaltered unless you pass enhance=true. Leave it off to match real-life camera color.
  • Saved presets now honor width and height on /studio-shot (previously ignored). Apply one with preset=<id>; explicit width/height still override the stored values.