typefile
{
"image": "https://replicate.delivery/pbxt/KK3v1DvsmnfiKf8pm3IAPUpzR43QwrNw9FV0fNiuxSUyrpf0/low-quality-face.jpg",
"jpeg": 40,
"noise": 15,
"task_type": "Real-World Image Super-Resolution-Large"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_e2R**********************************
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 jingyunliang/swinir using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jingyunliang/swinir:660d922d33153019e8c263a3bba265de882e7f4f70396546b6c9c8f9d47a021a",
{
input: {
image: "https://replicate.delivery/pbxt/KK3v1DvsmnfiKf8pm3IAPUpzR43QwrNw9FV0fNiuxSUyrpf0/low-quality-face.jpg",
jpeg: 40,
noise: 15,
task_type: "Real-World Image Super-Resolution-Large"
}
}
);
// 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_e2R**********************************
This is your API token. Keep it to yourself.
import replicate
Run jingyunliang/swinir using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jingyunliang/swinir:660d922d33153019e8c263a3bba265de882e7f4f70396546b6c9c8f9d47a021a",
input={
"image": "https://replicate.delivery/pbxt/KK3v1DvsmnfiKf8pm3IAPUpzR43QwrNw9FV0fNiuxSUyrpf0/low-quality-face.jpg",
"jpeg": 40,
"noise": 15,
"task_type": "Real-World Image Super-Resolution-Large"
}
)
# 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_e2R**********************************
This is your API token. Keep it to yourself.
Run jingyunliang/swinir 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": "jingyunliang/swinir:660d922d33153019e8c263a3bba265de882e7f4f70396546b6c9c8f9d47a021a",
"input": {
"image": "https://replicate.delivery/pbxt/KK3v1DvsmnfiKf8pm3IAPUpzR43QwrNw9FV0fNiuxSUyrpf0/low-quality-face.jpg",
"jpeg": 40,
"noise": 15,
"task_type": "Real-World Image Super-Resolution-Large"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Loading...
{
"id": "moebbcrbvcomdvlhgaqwfjciri",
"model": "jingyunliang/swinir",
"version": "660d922d33153019e8c263a3bba265de882e7f4f70396546b6c9c8f9d47a021a",
"input": {
"image": "https://replicate.delivery/pbxt/KK3v1DvsmnfiKf8pm3IAPUpzR43QwrNw9FV0fNiuxSUyrpf0/low-quality-face.jpg",
"jpeg": 40,
"noise": 15,
"task_type": "Real-World Image Super-Resolution-Large"
},
"logs": "",
"output": "https://replicate.delivery/pbxt/ubfAZISy9twyVi0XIN9bwgjrVrD8rnRTmPdh1v724dGtdAJJA/out.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-01-31T14:44:39.240222Z",
"started_at": "2024-01-31T14:44:39.252464Z",
"completed_at": "2024-01-31T14:44:43.307724Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/moebbcrbvcomdvlhgaqwfjciri/cancel",
"get": "https://api.replicate.com/v1/predictions/moebbcrbvcomdvlhgaqwfjciri"
},
"metrics": {
"predict_time": 4.05526,
"total_time": 4.067502
}
}