typefile
{
"batch_size": 1,
"decoder": "finetuned_840k",
"eta": 1,
"guidance_scale": 1,
"image": "https://replicate.delivery/pbxt/IHlAm5lcJQkjWUh0cHS6L7SZff9ODH0TyFvplbFg8VOcOwmR/out-2.png",
"noise_aug_type": "gaussian",
"num_samples": 1,
"sampler": "k_dpm_adaptive",
"scale": "4",
"steps": 10,
"tol_scale": 0.25
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_DnB**********************************
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 jagilley/stable-diffusion-upscaler using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jagilley/stable-diffusion-upscaler:4d0aeee7387b1170b0f6f42bdf14c7d9d8e00a15430d95446ad7426dc61fc3d8",
{
input: {
batch_size: 1,
decoder: "finetuned_840k",
eta: 1,
guidance_scale: 1,
image: "https://replicate.delivery/pbxt/IHlAm5lcJQkjWUh0cHS6L7SZff9ODH0TyFvplbFg8VOcOwmR/out-2.png",
noise_aug_type: "gaussian",
num_samples: 1,
sampler: "k_dpm_adaptive",
scale: "4",
steps: 10,
tol_scale: 0.25
}
}
);
// 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_DnB**********************************
This is your API token. Keep it to yourself.
import replicate
Run jagilley/stable-diffusion-upscaler using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jagilley/stable-diffusion-upscaler:4d0aeee7387b1170b0f6f42bdf14c7d9d8e00a15430d95446ad7426dc61fc3d8",
input={
"batch_size": 1,
"decoder": "finetuned_840k",
"eta": 1,
"guidance_scale": 1,
"image": "https://replicate.delivery/pbxt/IHlAm5lcJQkjWUh0cHS6L7SZff9ODH0TyFvplbFg8VOcOwmR/out-2.png",
"noise_aug_type": "gaussian",
"num_samples": 1,
"sampler": "k_dpm_adaptive",
"scale": "4",
"steps": 10,
"tol_scale": 0.25
}
)
# 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_DnB**********************************
This is your API token. Keep it to yourself.
Run jagilley/stable-diffusion-upscaler 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": "jagilley/stable-diffusion-upscaler:4d0aeee7387b1170b0f6f42bdf14c7d9d8e00a15430d95446ad7426dc61fc3d8",
"input": {
"batch_size": 1,
"decoder": "finetuned_840k",
"eta": 1,
"guidance_scale": 1,
"image": "https://replicate.delivery/pbxt/IHlAm5lcJQkjWUh0cHS6L7SZff9ODH0TyFvplbFg8VOcOwmR/out-2.png",
"noise_aug_type": "gaussian",
"num_samples": 1,
"sampler": "k_dpm_adaptive",
"scale": "4",
"steps": 10,
"tol_scale": 0.25
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "wxfk3ovh3jbwxgrjkhlncttfyq",
"model": "jagilley/stable-diffusion-upscaler",
"version": "4d0aeee7387b1170b0f6f42bdf14c7d9d8e00a15430d95446ad7426dc61fc3d8",
"input": {
"batch_size": 1,
"decoder": "finetuned_840k",
"eta": 1,
"guidance_scale": 1,
"image": "https://replicate.delivery/pbxt/IHlAm5lcJQkjWUh0cHS6L7SZff9ODH0TyFvplbFg8VOcOwmR/out-2.png",
"noise_aug_type": "gaussian",
"num_samples": 1,
"sampler": "k_dpm_adaptive",
"scale": "4",
"steps": 10,
"tol_scale": 0.25
},
"logs": "No seed was provided, using the current time.\nGenerating with seed=1675968995\nGlobal seed set to 1675968995",
"output": "https://replicate.delivery/pbxt/foEQN48ZDfp3KkSnjlL3hRh1laiFy06NmdJPHh3AyXg0PvcQA/tmp0nfc05ncout-2.png.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-02-09T18:56:35.170496Z",
"started_at": "2023-02-09T18:56:35.231045Z",
"completed_at": "2023-02-09T18:56:53.342769Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/wxfk3ovh3jbwxgrjkhlncttfyq/cancel",
"get": "https://api.replicate.com/v1/predictions/wxfk3ovh3jbwxgrjkhlncttfyq"
},
"metrics": {
"predict_time": 18.111724,
"total_time": 18.172273
}
}
