typetext
{
"go_fast_af": false,
"guidance_scale": 7.5,
"image_height": 512,
"image_width": 512,
"num_images": 1,
"num_inference_steps": 50,
"prompt": "a red apple on a table",
"seed": -1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_J2E**********************************
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 prunaai/stable-diffusion-cheetah using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"prunaai/stable-diffusion-cheetah:bce45013ec9e0034b87dbb81bca9458b57922c0dbdae6901603780ba6ca15fb6",
{
input: {
go_fast_af: false,
guidance_scale: 7.5,
image_height: 512,
image_width: 512,
num_images: 1,
num_inference_steps: 50,
prompt: "a red apple on a table",
seed: -1
}
}
);
// 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_J2E**********************************
This is your API token. Keep it to yourself.
import replicate
Run prunaai/stable-diffusion-cheetah using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"prunaai/stable-diffusion-cheetah:bce45013ec9e0034b87dbb81bca9458b57922c0dbdae6901603780ba6ca15fb6",
input={
"go_fast_af": False,
"guidance_scale": 7.5,
"image_height": 512,
"image_width": 512,
"num_images": 1,
"num_inference_steps": 50,
"prompt": "a red apple on a table",
"seed": -1
}
)
# 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_J2E**********************************
This is your API token. Keep it to yourself.
Run prunaai/stable-diffusion-cheetah 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": "prunaai/stable-diffusion-cheetah:bce45013ec9e0034b87dbb81bca9458b57922c0dbdae6901603780ba6ca15fb6",
"input": {
"go_fast_af": false,
"guidance_scale": 7.5,
"image_height": 512,
"image_width": 512,
"num_images": 1,
"num_inference_steps": 50,
"prompt": "a red apple on a table",
"seed": -1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "x844dqthq9rj40cnwa98cdkd64",
"model": "prunaai/stable-diffusion-cheetah",
"version": "bce45013ec9e0034b87dbb81bca9458b57922c0dbdae6901603780ba6ca15fb6",
"input": {
"go_fast_af": false,
"guidance_scale": 7.5,
"image_height": 512,
"image_width": 512,
"num_images": 1,
"num_inference_steps": 50,
"prompt": "a red apple on a table",
"seed": -1
},
"logs": "0%| | 0/50 [00:00<?, ?it/s]\n 30%|███ | 15/50 [00:00<00:00, 62.21it/s]\n 66%|██████▌ | 33/50 [00:00<00:00, 105.02it/s]\n100%|██████████| 50/50 [00:00<00:00, 120.93it/s]",
"output": "https://replicate.delivery/yhqm/xR5S88Khtj7YAVafK4O37eQtVjNZgX4HG9ikgm8Zb8FTccdUA/output.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-03-29T15:43:14.874Z",
"started_at": "2025-03-29T15:43:14.881608Z",
"completed_at": "2025-03-29T15:43:15.440441Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/x844dqthq9rj40cnwa98cdkd64/cancel",
"get": "https://api.replicate.com/v1/predictions/x844dqthq9rj40cnwa98cdkd64",
"stream": "https://stream.replicate.com/v1/files/yswh-gntyvtmcpjs5l4ojvvmixvxptankkmog7gyphmxxtie5fit426zq",
"web": "https://replicate.com/p/x844dqthq9rj40cnwa98cdkd64"
},
"metrics": {
"predict_time": 0.558833093,
"total_time": 0.566441
}
}