andreasjansson/portrait-blur

Blur out-of-focus parts of an image

Public
26 runs

Run andreasjansson/portrait-blur with an API

Use one of our client libraries to get started quickly. Clicking on a library will take you to the Playground tab where you can tweak different inputs, see the results, and copy the corresponding code to use in your own project.

Input schema

The fields you can use to run this model with an API. If you don't give a value for a field its default value will be used.

Field Type Default value Description
image
string
Input image to apply portrait mode blur effect
blur_strength
number
10

Min: 1

Max: 30

Blur strength (higher = more blur)
edge_averaging
integer
11

Min: 1

Max: 31

Edge smoothing window size (higher = smoother transitions)
return_debug_image
boolean
False
Return debug depth visualization

Output schema

The shape of the response you’ll get when you run this model with an API.

Schema
{
  "type": "object",
  "title": "Output",
  "required": [
    "blurred_image",
    "depth_debug"
  ],
  "properties": {
    "depth_debug": {
      "type": "string",
      "title": "Depth Debug",
      "format": "uri"
    },
    "blurred_image": {
      "type": "string",
      "title": "Blurred Image",
      "format": "uri"
    }
  }
}
Example API response
View prediction
{'blurred_image': 'https://replicate.delivery/xezq/fZVGYqMrfwqOEEJBgdCAZR1kXoZZICa2E56k9jdpVIPCukOVA/portrait_blur.jpg',
 'depth_debug': None}