typefile
{
"input_image": "https://replicate.delivery/pbxt/I9uDZgopnhz6X956zgaBoorFWbUmu5HHDyjkd3BY3ZnxVAdu/1.jpg",
"model_name": "Artistic",
"render_factor": 35
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_BMt**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run arielreplicate/deoldify_image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"arielreplicate/deoldify_image:376c74a2c9eb442a2ff9391b84dc5b949cd4e80b4dc0565115be0a19b7df0ae6",
{
input: {
input_image: "https://replicate.delivery/pbxt/I9uDZgopnhz6X956zgaBoorFWbUmu5HHDyjkd3BY3ZnxVAdu/1.jpg",
model_name: "Artistic",
render_factor: 35
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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_BMt**********************************
This is your API token. Keep it to yourself.
import replicate
Run arielreplicate/deoldify_image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"arielreplicate/deoldify_image:376c74a2c9eb442a2ff9391b84dc5b949cd4e80b4dc0565115be0a19b7df0ae6",
input={
"input_image": "https://replicate.delivery/pbxt/I9uDZgopnhz6X956zgaBoorFWbUmu5HHDyjkd3BY3ZnxVAdu/1.jpg",
"model_name": "Artistic",
"render_factor": 35
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_BMt**********************************
This is your API token. Keep it to yourself.
Run arielreplicate/deoldify_image 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": "arielreplicate/deoldify_image:376c74a2c9eb442a2ff9391b84dc5b949cd4e80b4dc0565115be0a19b7df0ae6",
"input": {
"input_image": "https://replicate.delivery/pbxt/I9uDZgopnhz6X956zgaBoorFWbUmu5HHDyjkd3BY3ZnxVAdu/1.jpg",
"model_name": "Artistic",
"render_factor": 35
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "5ml3jdzxxba7xevvvgetgbzi5a",
"model": "arielreplicate/deoldify_image",
"version": "376c74a2c9eb442a2ff9391b84dc5b949cd4e80b4dc0565115be0a19b7df0ae6",
"input": {
"input_image": "https://replicate.delivery/pbxt/I9uDZgopnhz6X956zgaBoorFWbUmu5HHDyjkd3BY3ZnxVAdu/1.jpg",
"model_name": "Artistic",
"render_factor": 35
},
"logs": "/root/.pyenv/versions/3.8.16/lib/python3.8/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.\nwarnings.warn(\n/root/.pyenv/versions/3.8.16/lib/python3.8/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=ResNet34_Weights.IMAGENET1K_V1`. You can also use `weights=ResNet34_Weights.DEFAULT` to get the most up-to-date weights.\nwarnings.warn(msg)",
"output": "https://replicate.delivery/pbxt/QDMDijnVRXYWNNW32rxQbbClRDwaIfgJSVG1rfvXVeyFB5qgA/tmpvp0xc_2a1.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-01-18T15:53:43.474682Z",
"started_at": "2023-01-18T15:53:43.519614Z",
"completed_at": "2023-01-18T15:54:11.067921Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/5ml3jdzxxba7xevvvgetgbzi5a/cancel",
"get": "https://api.replicate.com/v1/predictions/5ml3jdzxxba7xevvvgetgbzi5a"
},
"metrics": {
"predict_time": 27.548307,
"total_time": 27.593239
}
}
