defaultAn astronaut riding a rainbow unicorn
typetext
{
"apply_watermark": true,
"guidance_scale": 7.5,
"height": 1024,
"high_noise_frac": 0.8,
"lora_scale": 0.6,
"negative_prompt": "beautiful",
"num_inference_steps": 20,
"num_outputs": 4,
"prompt": "a pencil drawing made by a 3 year old child, the drawing shows a badly drawn old smiling computer monitor, loose lines, scribbles, badly drawn, funny",
"prompt_strength": 0.8,
"refine": "no_refiner",
"scheduler": "KarrasDPM",
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_XAe**********************************
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 stability-ai/sdxl using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"stability-ai/sdxl:a00d0b7dcbb9c3fbb34ba87d2d5b46c56969c84a628bf778a7fdaec30b1b99c5",
{
input: {
apply_watermark: true,
guidance_scale: 7.5,
height: 1024,
high_noise_frac: 0.8,
lora_scale: 0.6,
negative_prompt: "beautiful",
num_inference_steps: 20,
num_outputs: 4,
prompt: "a pencil drawing made by a 3 year old child, the drawing shows a badly drawn old smiling computer monitor, loose lines, scribbles, badly drawn, funny",
prompt_strength: 0.8,
refine: "no_refiner",
scheduler: "KarrasDPM",
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_XAe**********************************
This is your API token. Keep it to yourself.
import replicate
Run stability-ai/sdxl using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"stability-ai/sdxl:a00d0b7dcbb9c3fbb34ba87d2d5b46c56969c84a628bf778a7fdaec30b1b99c5",
input={
"apply_watermark": True,
"guidance_scale": 7.5,
"height": 1024,
"high_noise_frac": 0.8,
"lora_scale": 0.6,
"negative_prompt": "beautiful",
"num_inference_steps": 20,
"num_outputs": 4,
"prompt": "a pencil drawing made by a 3 year old child, the drawing shows a badly drawn old smiling computer monitor, loose lines, scribbles, badly drawn, funny",
"prompt_strength": 0.8,
"refine": "no_refiner",
"scheduler": "KarrasDPM",
"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_XAe**********************************
This is your API token. Keep it to yourself.
Run stability-ai/sdxl 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": "stability-ai/sdxl:a00d0b7dcbb9c3fbb34ba87d2d5b46c56969c84a628bf778a7fdaec30b1b99c5",
"input": {
"apply_watermark": true,
"guidance_scale": 7.5,
"height": 1024,
"high_noise_frac": 0.8,
"lora_scale": 0.6,
"negative_prompt": "beautiful",
"num_inference_steps": 20,
"num_outputs": 4,
"prompt": "a pencil drawing made by a 3 year old child, the drawing shows a badly drawn old smiling computer monitor, loose lines, scribbles, badly drawn, funny",
"prompt_strength": 0.8,
"refine": "no_refiner",
"scheduler": "KarrasDPM",
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "ouay3edbxektev3sfroq37gv2u",
"model": "stability-ai/sdxl",
"version": "a00d0b7dcbb9c3fbb34ba87d2d5b46c56969c84a628bf778a7fdaec30b1b99c5",
"input": {
"apply_watermark": true,
"guidance_scale": 7.5,
"height": 1024,
"high_noise_frac": 0.8,
"lora_scale": 0.6,
"negative_prompt": "beautiful",
"num_inference_steps": 20,
"num_outputs": 4,
"prompt": "a pencil drawing made by a 3 year old child, the drawing shows a badly drawn old smiling computer monitor, loose lines, scribbles, badly drawn, funny",
"prompt_strength": 0.8,
"refine": "no_refiner",
"scheduler": "KarrasDPM",
"width": 1024
},
"logs": "Using seed: 40868\nPrompt: a pencil drawing made by a 3 year old child, the drawing shows a badly drawn old smiling computer monitor, loose lines, scribbles, badly drawn, funny\ntxt2img mode\n 0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:00<00:14, 1.33it/s]\n 10%|█ | 2/20 [00:01<00:13, 1.33it/s]\n 15%|█▌ | 3/20 [00:02<00:12, 1.32it/s]\n 20%|██ | 4/20 [00:03<00:12, 1.32it/s]\n 25%|██▌ | 5/20 [00:03<00:11, 1.32it/s]\n 30%|███ | 6/20 [00:04<00:10, 1.32it/s]\n 35%|███▌ | 7/20 [00:05<00:09, 1.32it/s]\n 40%|████ | 8/20 [00:06<00:09, 1.32it/s]\n 45%|████▌ | 9/20 [00:06<00:08, 1.32it/s]\n 50%|█████ | 10/20 [00:07<00:07, 1.32it/s]\n 55%|█████▌ | 11/20 [00:08<00:06, 1.32it/s]\n 60%|██████ | 12/20 [00:09<00:06, 1.32it/s]\n 65%|██████▌ | 13/20 [00:09<00:05, 1.32it/s]\n 70%|███████ | 14/20 [00:10<00:04, 1.32it/s]\n 75%|███████▌ | 15/20 [00:11<00:03, 1.32it/s]\n 80%|████████ | 16/20 [00:12<00:03, 1.32it/s]\n 85%|████████▌ | 17/20 [00:12<00:02, 1.32it/s]\n 90%|█████████ | 18/20 [00:13<00:01, 1.32it/s]\n 95%|█████████▌| 19/20 [00:14<00:00, 1.32it/s]\n100%|██████████| 20/20 [00:15<00:00, 1.32it/s]\n100%|██████████| 20/20 [00:15<00:00, 1.32it/s]",
"output": [
"https://replicate.delivery/pbxt/ve9W3WqB5WXsFCmEO3e1xh9xy1SN4PlDhgHad6Tw2MY7iVaRA/out-0.png",
"https://replicate.delivery/pbxt/QmOnTHWO88ZFNlFB9Mfpw1gy6hO1lMzQCRg36ndAbTHeiVaRA/out-1.png",
"https://replicate.delivery/pbxt/2JRAC4BoC9bvNxB8sN7Z7CR9hxkK9VrCjgkIBwfcRsCeiVaRA/out-2.png",
"https://replicate.delivery/pbxt/mGfSEktfFBsYoE9jYkdZtzJGE6geK68Mk9WC5e0fdpknXsSLC/out-3.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-08-15T16:24:09.23949Z",
"started_at": "2023-08-15T16:24:09.220346Z",
"completed_at": "2023-08-15T16:24:29.170828Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/ouay3edbxektev3sfroq37gv2u/cancel",
"get": "https://api.replicate.com/v1/predictions/ouay3edbxektev3sfroq37gv2u"
},
"metrics": {
"predict_time": 19.950482,
"total_time": 19.931338
}
}


