typefile
{
"image": "https://replicate.delivery/mgxm/93f6afac-40db-41f9-a518-e81d09869ebd/10.png"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_V6G**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run codeslake/ifan-defocus-deblur using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"codeslake/ifan-defocus-deblur:db878f8bd6cfdefffddf35de70dd9b0777ff5b1a07ac8db674a7a9bca17c421b",
{
input: {
image: "https://replicate.delivery/mgxm/93f6afac-40db-41f9-a518-e81d09869ebd/10.png"
}
}
);
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_V6G**********************************
This is your API token. Keep it to yourself.
import replicate
Run codeslake/ifan-defocus-deblur using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"codeslake/ifan-defocus-deblur:db878f8bd6cfdefffddf35de70dd9b0777ff5b1a07ac8db674a7a9bca17c421b",
input={
"image": "https://replicate.delivery/mgxm/93f6afac-40db-41f9-a518-e81d09869ebd/10.png"
}
)
# The codeslake/ifan-defocus-deblur model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/codeslake/ifan-defocus-deblur/api#output-schema
print(item)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_V6G**********************************
This is your API token. Keep it to yourself.
Run codeslake/ifan-defocus-deblur 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 $'{
"version": "codeslake/ifan-defocus-deblur:db878f8bd6cfdefffddf35de70dd9b0777ff5b1a07ac8db674a7a9bca17c421b",
"input": {
"image": "https://replicate.delivery/mgxm/93f6afac-40db-41f9-a518-e81d09869ebd/10.png"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"outputType": "object",
"properties": {
"file": {
"outputType": "uri",
"mimeType": "image/png",
"inferred": false,
"outputValue": "https://replicate.delivery/mgxm/d2d8381b-0c38-4be1-a625-fe84ba63885a/out.png",
"typeMismatch": false
}
},
"inferred": false,
"outputValue": {
"file": "https://replicate.delivery/mgxm/d2d8381b-0c38-4be1-a625-fe84ba63885a/out.png"
},
"typeMismatch": false
}{
"id": "lms3mtp3xnef7pb6w5vb2wrrx4",
"model": "codeslake/ifan-defocus-deblur",
"version": "db878f8bd6cfdefffddf35de70dd9b0777ff5b1a07ac8db674a7a9bca17c421b",
"input": {
"image": "https://replicate.delivery/mgxm/93f6afac-40db-41f9-a518-e81d09869ebd/10.png"
},
"logs": "",
"output": [
{
"file": "https://replicate.delivery/mgxm/d2d8381b-0c38-4be1-a625-fe84ba63885a/out.png"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2021-10-06T06:23:12.780246Z",
"started_at": "2022-02-01T22:24:10.609325Z",
"completed_at": "2021-10-06T06:25:07.577529Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/lms3mtp3xnef7pb6w5vb2wrrx4/cancel",
"get": "https://api.replicate.com/v1/predictions/lms3mtp3xnef7pb6w5vb2wrrx4"
},
"metrics": {
"total_time": 114.797283
}
}