typefile
{
"blur_strength": 10,
"edge_averaging": 11,
"image": "https://replicate.delivery/pbxt/Nb5sdr4GpsbJfMvG0IsnO0sVgW1YlFUxW97VbT6qmflgH3XR/IMG_8244.jpeg",
"return_debug_image": false
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_LB1**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run andreasjansson/portrait-blur using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
blur_strength: 10,
edge_averaging: 11,
image: "https://replicate.delivery/pbxt/Nb5sdr4GpsbJfMvG0IsnO0sVgW1YlFUxW97VbT6qmflgH3XR/IMG_8244.jpeg",
return_debug_image: false
};
const output = await replicate.run("andreasjansson/portrait-blur", { input });
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_LB1**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/portrait-blur using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/portrait-blur",
input={
"blur_strength": 10,
"edge_averaging": 11,
"image": "https://replicate.delivery/pbxt/Nb5sdr4GpsbJfMvG0IsnO0sVgW1YlFUxW97VbT6qmflgH3XR/IMG_8244.jpeg",
"return_debug_image": False
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_LB1**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/portrait-blur using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"input": {
"blur_strength": 10,
"edge_averaging": 11,
"image": "https://replicate.delivery/pbxt/Nb5sdr4GpsbJfMvG0IsnO0sVgW1YlFUxW97VbT6qmflgH3XR/IMG_8244.jpeg",
"return_debug_image": false
}
}' \
https://api.replicate.com/v1/models/andreasjansson/portrait-blur/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Object output with 1 properties
{
"id": "5bmst6kd0nrma0crw8vr5cy3x0",
"model": "andreasjansson/portrait-blur",
"version": "hidden",
"input": {
"blur_strength": 10,
"edge_averaging": 11,
"image": "https://replicate.delivery/pbxt/Nb5sdr4GpsbJfMvG0IsnO0sVgW1YlFUxW97VbT6qmflgH3XR/IMG_8244.jpeg",
"return_debug_image": false
},
"logs": "detections [{'bbox': [1401, 931, 3073, 2606], 'confidence': 0.4927964508533478, 'label': 'person'}, {'bbox': [1402, 932, 3072, 2606], 'confidence': 0.2877204120159149, 'label': 'man'}, {'bbox': [2494, 1035, 3070, 1606], 'confidence': 0.36745485663414, 'label': 'face'}, {'bbox': [1402, 933, 3072, 2607], 'confidence': 0.4241909384727478, 'label': 'woman'}, {'bbox': [1402, 933, 3072, 2608], 'confidence': 0.2803356647491455, 'label': 'woman'}, {'bbox': [1400, 931, 3073, 2606], 'confidence': 0.21583585441112518, 'label': ''}, {'bbox': [268, 1546, 509, 1813], 'confidence': 0.245175302028656, 'label': ''}]\nbbox_viz /tmp/cog-runner-tmp-3577462926/4d7fb9f68d625f23/result.png",
"output": {
"blurred_image": "https://replicate.delivery/xezq/fZVGYqMrfwqOEEJBgdCAZR1kXoZZICa2E56k9jdpVIPCukOVA/portrait_blur.jpg",
"depth_debug": null
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-25T17:12:19.973Z",
"started_at": "2025-08-25T17:12:20.676622Z",
"completed_at": "2025-08-25T17:12:34.673432Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/5bmst6kd0nrma0crw8vr5cy3x0/cancel",
"children": "https://api.replicate.com/v1/predictions/5bmst6kd0nrma0crw8vr5cy3x0/children",
"get": "https://api.replicate.com/v1/predictions/5bmst6kd0nrma0crw8vr5cy3x0",
"root": "https://api.replicate.com/v1/predictions/5bmst6kd0nrma0crw8vr5cy3x0",
"web": "https://replicate.com/p/5bmst6kd0nrma0crw8vr5cy3x0"
},
"metrics": {
"predict_time": 13.996809915,
"total_time": 14.700432
}
}
