defaultAn astronaut riding a rainbow unicorn
typetext
{
"guidance_scale": 7.5,
"height": 640,
"high_noise_frac": 0.8,
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "a drawing of a llama typing",
"prompt_strength": 0.8,
"refine": "expert_ensemble_refiner",
"scheduler": "K_EULER",
"width": 1200
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_TZ3**********************************
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:2b017d9b67edd2ee1401238df49d75da53c523f36e363881e057f5dc3ed3c5b2",
{
input: {
guidance_scale: 7.5,
height: 640,
high_noise_frac: 0.8,
num_inference_steps: 50,
num_outputs: 1,
prompt: "a drawing of a llama typing",
prompt_strength: 0.8,
refine: "expert_ensemble_refiner",
scheduler: "K_EULER",
width: 1200
}
}
);
// 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_TZ3**********************************
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:2b017d9b67edd2ee1401238df49d75da53c523f36e363881e057f5dc3ed3c5b2",
input={
"guidance_scale": 7.5,
"height": 640,
"high_noise_frac": 0.8,
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "a drawing of a llama typing",
"prompt_strength": 0.8,
"refine": "expert_ensemble_refiner",
"scheduler": "K_EULER",
"width": 1200
}
)
# 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_TZ3**********************************
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:2b017d9b67edd2ee1401238df49d75da53c523f36e363881e057f5dc3ed3c5b2",
"input": {
"guidance_scale": 7.5,
"height": 640,
"high_noise_frac": 0.8,
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "a drawing of a llama typing",
"prompt_strength": 0.8,
"refine": "expert_ensemble_refiner",
"scheduler": "K_EULER",
"width": 1200
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "v3iew5tb5m7mmqwvem235turre",
"model": "stability-ai/sdxl",
"version": "2b017d9b67edd2ee1401238df49d75da53c523f36e363881e057f5dc3ed3c5b2",
"input": {
"guidance_scale": 7.5,
"height": 640,
"high_noise_frac": 0.8,
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "a drawing of a llama typing",
"prompt_strength": 0.8,
"refine": "expert_ensemble_refiner",
"scheduler": "K_EULER",
"width": 1200
},
"logs": "Using seed: 24950\ntxt2img mode\n 0%| | 0/40 [00:00<?, ?it/s]\n 2%|▎ | 1/40 [00:00<00:05, 6.50it/s]\n 5%|▌ | 2/40 [00:00<00:05, 6.44it/s]\n 8%|▊ | 3/40 [00:00<00:05, 6.42it/s]\n 10%|█ | 4/40 [00:00<00:05, 6.41it/s]\n 12%|█▎ | 5/40 [00:00<00:05, 6.40it/s]\n 15%|█▌ | 6/40 [00:00<00:05, 6.39it/s]\n 18%|█▊ | 7/40 [00:01<00:05, 6.38it/s]\n 20%|██ | 8/40 [00:01<00:05, 6.38it/s]\n 22%|██▎ | 9/40 [00:01<00:04, 6.38it/s]\n 25%|██▌ | 10/40 [00:01<00:04, 6.39it/s]\n 28%|██▊ | 11/40 [00:01<00:04, 6.38it/s]\n 30%|███ | 12/40 [00:01<00:04, 6.38it/s]\n 32%|███▎ | 13/40 [00:02<00:04, 6.38it/s]\n 35%|███▌ | 14/40 [00:02<00:04, 6.38it/s]\n 38%|███▊ | 15/40 [00:02<00:03, 6.38it/s]\n 40%|████ | 16/40 [00:02<00:03, 6.38it/s]\n 42%|████▎ | 17/40 [00:02<00:03, 6.38it/s]\n 45%|████▌ | 18/40 [00:02<00:03, 6.36it/s]\n 48%|████▊ | 19/40 [00:02<00:03, 6.36it/s]\n 50%|█████ | 20/40 [00:03<00:03, 6.36it/s]\n 52%|█████▎ | 21/40 [00:03<00:02, 6.36it/s]\n 55%|█████▌ | 22/40 [00:03<00:02, 6.36it/s]\n 57%|█████▊ | 23/40 [00:03<00:02, 6.36it/s]\n 60%|██████ | 24/40 [00:03<00:02, 6.36it/s]\n 62%|██████▎ | 25/40 [00:03<00:02, 6.36it/s]\n 65%|██████▌ | 26/40 [00:04<00:02, 6.36it/s]\n 68%|██████▊ | 27/40 [00:04<00:02, 6.36it/s]\n 70%|███████ | 28/40 [00:04<00:01, 6.36it/s]\n 72%|███████▎ | 29/40 [00:04<00:01, 6.37it/s]\n 75%|███████▌ | 30/40 [00:04<00:01, 6.36it/s]\n 78%|███████▊ | 31/40 [00:04<00:01, 6.36it/s]\n 80%|████████ | 32/40 [00:05<00:01, 6.36it/s]\n 82%|████████▎ | 33/40 [00:05<00:01, 6.36it/s]\n 85%|████████▌ | 34/40 [00:05<00:00, 6.35it/s]\n 88%|████████▊ | 35/40 [00:05<00:00, 6.35it/s]\n 90%|█████████ | 36/40 [00:05<00:00, 6.35it/s]\n 92%|█████████▎| 37/40 [00:05<00:00, 6.35it/s]\n 95%|█████████▌| 38/40 [00:05<00:00, 6.36it/s]\n 98%|█████████▊| 39/40 [00:06<00:00, 6.35it/s]\n100%|██████████| 40/40 [00:06<00:00, 6.35it/s]\n100%|██████████| 40/40 [00:06<00:00, 6.37it/s]\n 0%| | 0/10 [00:00<?, ?it/s]\n 10%|█ | 1/10 [00:00<00:01, 5.97it/s]\n 20%|██ | 2/10 [00:00<00:01, 5.93it/s]\n 30%|███ | 3/10 [00:00<00:01, 5.92it/s]\n 40%|████ | 4/10 [00:00<00:01, 5.90it/s]\n 50%|█████ | 5/10 [00:00<00:00, 5.91it/s]\n 60%|██████ | 6/10 [00:01<00:00, 5.90it/s]\n 70%|███████ | 7/10 [00:01<00:00, 5.90it/s]\n 80%|████████ | 8/10 [00:01<00:00, 5.91it/s]\n 90%|█████████ | 9/10 [00:01<00:00, 5.91it/s]\n100%|██████████| 10/10 [00:01<00:00, 5.91it/s]\n100%|██████████| 10/10 [00:01<00:00, 5.91it/s]",
"output": [
"https://replicate.delivery/pbxt/dif2rir5BUy2Pqx5pdvRcg33Y6H1GfFHOOfFZtpLrJR9F3oiA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-28T18:19:34.020706Z",
"started_at": "2023-07-28T18:19:34.003188Z",
"completed_at": "2023-07-28T18:19:43.721513Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/v3iew5tb5m7mmqwvem235turre/cancel",
"get": "https://api.replicate.com/v1/predictions/v3iew5tb5m7mmqwvem235turre"
},
"metrics": {
"predict_time": 9.718325,
"total_time": 9.700807
}
}