typetext
{
"guidance_scale_decoder": 0,
"guidance_scale_prior": 4,
"height": 1024,
"num_images": 1,
"prompt": "A man with hoodie on, illustration",
"steps_decoder": 10,
"steps_prior": 20,
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_D4C**********************************
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 jyoung105/stable-cascade using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jyoung105/stable-cascade:8421cef7df50baf406ca9467682cce6209d3c829bd81e3c197c21d6d67c47fbd",
{
input: {
guidance_scale_decoder: 0,
guidance_scale_prior: 4,
height: 1024,
num_images: 1,
prompt: "A man with hoodie on, illustration",
steps_decoder: 10,
steps_prior: 20,
width: 1024
}
}
);
// 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_D4C**********************************
This is your API token. Keep it to yourself.
import replicate
Run jyoung105/stable-cascade using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jyoung105/stable-cascade:8421cef7df50baf406ca9467682cce6209d3c829bd81e3c197c21d6d67c47fbd",
input={
"guidance_scale_decoder": 0,
"guidance_scale_prior": 4,
"height": 1024,
"num_images": 1,
"prompt": "A man with hoodie on, illustration",
"steps_decoder": 10,
"steps_prior": 20,
"width": 1024
}
)
# 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_D4C**********************************
This is your API token. Keep it to yourself.
Run jyoung105/stable-cascade 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": "jyoung105/stable-cascade:8421cef7df50baf406ca9467682cce6209d3c829bd81e3c197c21d6d67c47fbd",
"input": {
"guidance_scale_decoder": 0,
"guidance_scale_prior": 4,
"height": 1024,
"num_images": 1,
"prompt": "A man with hoodie on, illustration",
"steps_decoder": 10,
"steps_prior": 20,
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "trgp1xx19srgm0cjvs7tsqmg70",
"model": "jyoung105/stable-cascade",
"version": "8421cef7df50baf406ca9467682cce6209d3c829bd81e3c197c21d6d67c47fbd",
"input": {
"guidance_scale_decoder": 0,
"guidance_scale_prior": 4,
"height": 1024,
"num_images": 1,
"prompt": "A man with hoodie on, illustration",
"steps_decoder": 10,
"steps_prior": 20,
"width": 1024
},
"logs": "DEVICE: cuda\nDTYPE: torch.float16\nUsing seed: 50236\nFinish setup in 0.00011014938354492188 secs.\n[Debug] Prompt: A man with hoodie on, illustration, best quality, high detail, sharp focus\n 0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:01<00:29, 1.54s/it]\n 10%|█ | 2/20 [00:01<00:12, 1.40it/s]\n 15%|█▌ | 3/20 [00:01<00:07, 2.21it/s]\n 20%|██ | 4/20 [00:01<00:05, 3.04it/s]\n 25%|██▌ | 5/20 [00:02<00:03, 3.83it/s]\n 30%|███ | 6/20 [00:02<00:03, 4.54it/s]\n 35%|███▌ | 7/20 [00:02<00:02, 5.14it/s]\n 40%|████ | 8/20 [00:02<00:02, 5.63it/s]\n 45%|████▌ | 9/20 [00:02<00:01, 6.03it/s]\n 50%|█████ | 10/20 [00:02<00:01, 6.33it/s]\n 55%|█████▌ | 11/20 [00:02<00:01, 6.54it/s]\n 60%|██████ | 12/20 [00:03<00:01, 6.70it/s]\n 65%|██████▌ | 13/20 [00:03<00:01, 6.78it/s]\n 70%|███████ | 14/20 [00:03<00:00, 6.89it/s]\n 75%|███████▌ | 15/20 [00:03<00:00, 6.94it/s]\n 80%|████████ | 16/20 [00:03<00:00, 6.97it/s]\n 85%|████████▌ | 17/20 [00:03<00:00, 7.00it/s]\n 90%|█████████ | 18/20 [00:03<00:00, 7.03it/s]\n 95%|█████████▌| 19/20 [00:04<00:00, 7.06it/s]\n100%|██████████| 20/20 [00:04<00:00, 7.07it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.75it/s]\n 0%| | 0/10 [00:00<?, ?it/s]\n 10%|█ | 1/10 [00:01<00:17, 1.93s/it]\n 20%|██ | 2/10 [00:02<00:07, 1.12it/s]\n 30%|███ | 3/10 [00:02<00:03, 1.79it/s]\n 40%|████ | 4/10 [00:02<00:02, 2.48it/s]\n 50%|█████ | 5/10 [00:02<00:01, 3.17it/s]\n 60%|██████ | 6/10 [00:02<00:01, 3.80it/s]\n 70%|███████ | 7/10 [00:02<00:00, 4.34it/s]\n 80%|████████ | 8/10 [00:03<00:00, 4.80it/s]\n 90%|█████████ | 9/10 [00:03<00:00, 5.16it/s]\n100%|██████████| 10/10 [00:03<00:00, 5.43it/s]\n100%|██████████| 10/10 [00:03<00:00, 2.95it/s]\nFinish generation in 12.288098096847534 secs.",
"output": [
"https://replicate.delivery/pbxt/DaRCXH5n0q6cONKxRffWbRVA66P70kdti4CPcbWl1y0flCYnA/out_0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-30T16:43:33.582Z",
"started_at": "2024-10-30T16:45:39.145624Z",
"completed_at": "2024-10-30T16:45:53.1651Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/trgp1xx19srgm0cjvs7tsqmg70/cancel",
"get": "https://api.replicate.com/v1/predictions/trgp1xx19srgm0cjvs7tsqmg70",
"web": "https://replicate.com/p/trgp1xx19srgm0cjvs7tsqmg70"
},
"metrics": {
"predict_time": 14.019475308,
"total_time": 139.5831
}
}