typetext
{
"denoising_strength": 0.5,
"enable_hr": false,
"guidance_scale": 7.5,
"height": 512,
"hr_scale": 2,
"hr_steps": 20,
"hr_upscaler": "Latent",
"negative_prompt": "",
"num_inference_steps": 20,
"num_outputs": 1,
"prompt": " a man",
"scheduler": "DPM++ SDE Karras",
"seed": -1,
"width": 512
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_TF1**********************************
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 llsean/cog-a1111-webui using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"llsean/cog-a1111-webui:f254d34e1d79fa724fd80b5649ddd99eb128b9fdab16c988bf59f4a27c45f656",
{
input: {
denoising_strength: 0.5,
enable_hr: false,
guidance_scale: 7.5,
height: 512,
hr_scale: 2,
hr_steps: 20,
hr_upscaler: "Latent",
negative_prompt: "",
num_inference_steps: 20,
num_outputs: 1,
prompt: " a man",
scheduler: "DPM++ SDE Karras",
seed: -1,
width: 512
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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_TF1**********************************
This is your API token. Keep it to yourself.
import replicate
Run llsean/cog-a1111-webui using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"llsean/cog-a1111-webui:f254d34e1d79fa724fd80b5649ddd99eb128b9fdab16c988bf59f4a27c45f656",
input={
"denoising_strength": 0.5,
"enable_hr": False,
"guidance_scale": 7.5,
"height": 512,
"hr_scale": 2,
"hr_steps": 20,
"hr_upscaler": "Latent",
"negative_prompt": "",
"num_inference_steps": 20,
"num_outputs": 1,
"prompt": " a man",
"scheduler": "DPM++ SDE Karras",
"seed": -1,
"width": 512
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].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_TF1**********************************
This is your API token. Keep it to yourself.
Run llsean/cog-a1111-webui 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": "llsean/cog-a1111-webui:f254d34e1d79fa724fd80b5649ddd99eb128b9fdab16c988bf59f4a27c45f656",
"input": {
"denoising_strength": 0.5,
"enable_hr": false,
"guidance_scale": 7.5,
"height": 512,
"hr_scale": 2,
"hr_steps": 20,
"hr_upscaler": "Latent",
"negative_prompt": "",
"num_inference_steps": 20,
"num_outputs": 1,
"prompt": " a man",
"scheduler": "DPM++ SDE Karras",
"seed": -1,
"width": 512
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "kf4ltl3b6up5en3upoo6qhldka",
"model": "llsean/cog-a1111-webui",
"version": "f254d34e1d79fa724fd80b5649ddd99eb128b9fdab16c988bf59f4a27c45f656",
"input": {
"denoising_strength": 0.5,
"enable_hr": false,
"guidance_scale": 7.5,
"height": 512,
"hr_scale": 2,
"hr_steps": 20,
"hr_upscaler": "Latent",
"negative_prompt": "",
"num_inference_steps": 20,
"num_outputs": 1,
"prompt": " a man",
"scheduler": "DPM++ SDE Karras",
"seed": -1,
"width": 512
},
"logs": "0%| | 0/20 [00:00<?, ?it/s]\nTotal progress: 0%| | 0/20 [00:00<?, ?it/s]\u001b[A\n 5%|▌ | 1/20 [00:00<00:02, 7.24it/s]\n 10%|█ | 2/20 [00:00<00:02, 7.23it/s]\nTotal progress: 10%|█ | 2/20 [00:00<00:01, 15.05it/s]\u001b[A\n 15%|█▌ | 3/20 [00:00<00:02, 7.24it/s]\n 20%|██ | 4/20 [00:00<00:02, 7.21it/s]\nTotal progress: 20%|██ | 4/20 [00:00<00:01, 9.20it/s]\u001b[A\n 25%|██▌ | 5/20 [00:00<00:02, 7.21it/s]\nTotal progress: 30%|███ | 6/20 [00:00<00:01, 8.13it/s]\u001b[A\n 30%|███ | 6/20 [00:00<00:01, 7.20it/s]\nTotal progress: 35%|███▌ | 7/20 [00:00<00:01, 7.90it/s]\u001b[A\n 35%|███▌ | 7/20 [00:00<00:01, 7.24it/s]\nTotal progress: 40%|████ | 8/20 [00:00<00:01, 7.72it/s]\u001b[A\n 40%|████ | 8/20 [00:01<00:01, 7.21it/s]\nTotal progress: 45%|████▌ | 9/20 [00:01<00:01, 7.55it/s]\u001b[A\n 45%|████▌ | 9/20 [00:01<00:01, 7.15it/s]\nTotal progress: 50%|█████ | 10/20 [00:01<00:01, 7.38it/s]\u001b[A\n 50%|█████ | 10/20 [00:01<00:01, 7.10it/s]\nTotal progress: 55%|█████▌ | 11/20 [00:01<00:01, 7.27it/s]\u001b[A\n 55%|█████▌ | 11/20 [00:01<00:01, 7.12it/s]\nTotal progress: 60%|██████ | 12/20 [00:01<00:01, 7.27it/s]\u001b[A\n 60%|██████ | 12/20 [00:01<00:01, 7.17it/s]\nTotal progress: 65%|██████▌ | 13/20 [00:01<00:00, 7.26it/s]\u001b[A\n 65%|██████▌ | 13/20 [00:01<00:00, 7.20it/s]\nTotal progress: 70%|███████ | 14/20 [00:01<00:00, 7.27it/s]\u001b[A\n 70%|███████ | 14/20 [00:01<00:00, 7.15it/s]\nTotal progress: 75%|███████▌ | 15/20 [00:01<00:00, 7.20it/s]\u001b[A\n 75%|███████▌ | 15/20 [00:02<00:00, 7.21it/s]\nTotal progress: 80%|████████ | 16/20 [00:02<00:00, 7.25it/s]\u001b[A\n 80%|████████ | 16/20 [00:02<00:00, 7.27it/s]\nTotal progress: 85%|████████▌ | 17/20 [00:02<00:00, 7.30it/s]\u001b[A\n 85%|████████▌ | 17/20 [00:02<00:00, 7.27it/s]\nTotal progress: 90%|█████████ | 18/20 [00:02<00:00, 7.26it/s]\u001b[A\n 90%|█████████ | 18/20 [00:02<00:00, 7.33it/s]\nTotal progress: 95%|█████████▌| 19/20 [00:02<00:00, 7.33it/s]\u001b[A\n 95%|█████████▌| 19/20 [00:02<00:00, 7.42it/s]\n100%|██████████| 20/20 [00:02<00:00, 7.44it/s]\nTotal progress: 100%|██████████| 20/20 [00:02<00:00, 7.44it/s]\u001b[A\nTotal progress: 100%|██████████| 20/20 [00:02<00:00, 7.44it/s]\u001b[A\nTotal progress: 100%|██████████| 20/20 [00:02<00:00, 7.44it/s]",
"output": [
"https://replicate.delivery/pbxt/wQxI0jRZbX7kDNGQU7YcZz6ednDbNZVIUmyCOeSKLotlg68RA/1747788793-aad5be04-8df8-11ee-95d7-eefb0558db96.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-11-28T14:16:02.342583Z",
"started_at": "2023-11-28T14:16:02.37407Z",
"completed_at": "2023-11-28T14:16:06.398065Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/kf4ltl3b6up5en3upoo6qhldka/cancel",
"get": "https://api.replicate.com/v1/predictions/kf4ltl3b6up5en3upoo6qhldka"
},
"metrics": {
"predict_time": 4.023995,
"total_time": 4.055482
}
}