typefile
{
"image": "https://fastly.4sqi.net/img/general/128x128/518599985_KXFqFh337i1lrVzVrgUJQGxw8PffI0lEKL9HHvJfqFA.jpg",
"max_batch_size": 8,
"output_format": "webp",
"output_quality": 80
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_1nM**********************************
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 zsxkib/aura-sr-v2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"zsxkib/aura-sr-v2:5c137257cce8d5ce16e8a334b70e9e025106b5580affed0bc7d48940b594e74c",
{
input: {
image: "https://fastly.4sqi.net/img/general/128x128/518599985_KXFqFh337i1lrVzVrgUJQGxw8PffI0lEKL9HHvJfqFA.jpg",
max_batch_size: 8,
output_format: "webp",
output_quality: 80
}
}
);
// 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_1nM**********************************
This is your API token. Keep it to yourself.
import replicate
Run zsxkib/aura-sr-v2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"zsxkib/aura-sr-v2:5c137257cce8d5ce16e8a334b70e9e025106b5580affed0bc7d48940b594e74c",
input={
"image": "https://fastly.4sqi.net/img/general/128x128/518599985_KXFqFh337i1lrVzVrgUJQGxw8PffI0lEKL9HHvJfqFA.jpg",
"max_batch_size": 8,
"output_format": "webp",
"output_quality": 80
}
)
# 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_1nM**********************************
This is your API token. Keep it to yourself.
Run zsxkib/aura-sr-v2 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": "zsxkib/aura-sr-v2:5c137257cce8d5ce16e8a334b70e9e025106b5580affed0bc7d48940b594e74c",
"input": {
"image": "https://fastly.4sqi.net/img/general/128x128/518599985_KXFqFh337i1lrVzVrgUJQGxw8PffI0lEKL9HHvJfqFA.jpg",
"max_batch_size": 8,
"output_format": "webp",
"output_quality": 80
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Loading...
{
"id": "f951m1rahnrgj0ch17zaasn4n0",
"model": "zsxkib/aura-sr-v2",
"version": "5c137257cce8d5ce16e8a334b70e9e025106b5580affed0bc7d48940b594e74c",
"input": {
"image": "https://fastly.4sqi.net/img/general/128x128/518599985_KXFqFh337i1lrVzVrgUJQGxw8PffI0lEKL9HHvJfqFA.jpg",
"max_batch_size": 8,
"output_format": "webp",
"output_quality": 80
},
"logs": "",
"output": "https://replicate.delivery/pbxt/96xe6QsDIRS9GyOdnYmcq63Qk9t1mGxSelRxBfAgXgKzDGcmA/output.webp",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-07-31T18:12:09.485Z",
"started_at": "2024-07-31T18:12:09.493025Z",
"completed_at": "2024-07-31T18:12:10.087029Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/f951m1rahnrgj0ch17zaasn4n0/cancel",
"get": "https://api.replicate.com/v1/predictions/f951m1rahnrgj0ch17zaasn4n0",
"web": "https://replicate.com/p/f951m1rahnrgj0ch17zaasn4n0"
},
"metrics": {
"predict_time": 0.594004262,
"total_time": 0.602029
}
}