defaultAn astronaut riding a rainbow unicorn
typetext
{
"apply_watermark": false,
"guidance_scale": 7.5,
"height": 768,
"high_noise_frac": 0.8,
"lora_scale": 0.6,
"negative_prompt": "",
"num_inference_steps": 25,
"num_outputs": 1,
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
"prompt_strength": 0.8,
"refine": "expert_ensemble_refiner",
"scheduler": "K_EULER",
"width": 768
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_3mL**********************************
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:c221b2b8ef527988fb59bf24a8b97c4561f1c671f73bd389f866bfb27c061316",
{
input: {
apply_watermark: false,
guidance_scale: 7.5,
height: 768,
high_noise_frac: 0.8,
lora_scale: 0.6,
negative_prompt: "",
num_inference_steps: 25,
num_outputs: 1,
prompt: "An astronaut riding a rainbow unicorn, cinematic, dramatic",
prompt_strength: 0.8,
refine: "expert_ensemble_refiner",
scheduler: "K_EULER",
width: 768
}
}
);
// 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_3mL**********************************
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:c221b2b8ef527988fb59bf24a8b97c4561f1c671f73bd389f866bfb27c061316",
input={
"apply_watermark": False,
"guidance_scale": 7.5,
"height": 768,
"high_noise_frac": 0.8,
"lora_scale": 0.6,
"negative_prompt": "",
"num_inference_steps": 25,
"num_outputs": 1,
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
"prompt_strength": 0.8,
"refine": "expert_ensemble_refiner",
"scheduler": "K_EULER",
"width": 768
}
)
# 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_3mL**********************************
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:c221b2b8ef527988fb59bf24a8b97c4561f1c671f73bd389f866bfb27c061316",
"input": {
"apply_watermark": false,
"guidance_scale": 7.5,
"height": 768,
"high_noise_frac": 0.8,
"lora_scale": 0.6,
"negative_prompt": "",
"num_inference_steps": 25,
"num_outputs": 1,
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
"prompt_strength": 0.8,
"refine": "expert_ensemble_refiner",
"scheduler": "K_EULER",
"width": 768
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "dzsqmb3bg4lqpjkz2iptjqgccm",
"model": "stability-ai/sdxl",
"version": "c221b2b8ef527988fb59bf24a8b97c4561f1c671f73bd389f866bfb27c061316",
"input": {
"apply_watermark": false,
"guidance_scale": 7.5,
"height": 768,
"high_noise_frac": 0.8,
"lora_scale": 0.6,
"negative_prompt": "",
"num_inference_steps": 25,
"num_outputs": 1,
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
"prompt_strength": 0.8,
"refine": "expert_ensemble_refiner",
"scheduler": "K_EULER",
"width": 768
},
"logs": "Using seed: 16010\nPrompt: An astronaut riding a rainbow unicorn, cinematic, dramatic\ntxt2img mode\n 0%| | 0/16 [00:00<?, ?it/s]\n 6%|▋ | 1/16 [00:00<00:01, 7.96it/s]\n 12%|█▎ | 2/16 [00:00<00:01, 7.89it/s]\n 19%|█▉ | 3/16 [00:00<00:01, 7.86it/s]\n 25%|██▌ | 4/16 [00:00<00:01, 7.85it/s]\n 31%|███▏ | 5/16 [00:00<00:01, 7.83it/s]\n 38%|███▊ | 6/16 [00:00<00:01, 7.82it/s]\n 44%|████▍ | 7/16 [00:00<00:01, 7.81it/s]\n 50%|█████ | 8/16 [00:01<00:01, 7.80it/s]\n 56%|█████▋ | 9/16 [00:01<00:00, 7.80it/s]\n 62%|██████▎ | 10/16 [00:01<00:00, 7.78it/s]\n 69%|██████▉ | 11/16 [00:01<00:00, 7.79it/s]\n 75%|███████▌ | 12/16 [00:01<00:00, 7.79it/s]\n 81%|████████▏ | 13/16 [00:01<00:00, 7.78it/s]\n 88%|████████▊ | 14/16 [00:01<00:00, 7.79it/s]\n 94%|█████████▍| 15/16 [00:01<00:00, 7.79it/s]\n100%|██████████| 16/16 [00:02<00:00, 7.79it/s]\n100%|██████████| 16/16 [00:02<00:00, 7.81it/s]\n 0%| | 0/5 [00:00<?, ?it/s]\n 20%|██ | 1/5 [00:00<00:00, 7.47it/s]\n 40%|████ | 2/5 [00:00<00:00, 7.42it/s]\n 60%|██████ | 3/5 [00:00<00:00, 7.40it/s]\n 80%|████████ | 4/5 [00:00<00:00, 7.39it/s]\n100%|██████████| 5/5 [00:00<00:00, 7.39it/s]\n100%|██████████| 5/5 [00:00<00:00, 7.40it/s]",
"output": [
"https://pbxt.replicate.delivery/YXbcLudoHBIYHV6L0HbcTx5iRzLFMwygLr3vhGpZI35caXbE/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-10-12T17:10:07.956869Z",
"started_at": "2023-10-12T17:10:07.927942Z",
"completed_at": "2023-10-12T17:10:12.909279Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/dzsqmb3bg4lqpjkz2iptjqgccm/cancel",
"get": "https://api.replicate.com/v1/predictions/dzsqmb3bg4lqpjkz2iptjqgccm"
},
"metrics": {
"predict_time": 4.981337,
"total_time": 4.95241
}
}