defaultAn astronaut riding a rainbow unicorn
typetext
{
"apply_watermark": true,
"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",
"seed": 16010,
"tile_refine": true,
"tile_refine_conditioning_strength": 0.5,
"tile_refine_steps": 20,
"tile_refine_strength": 0.5,
"width": 768
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_aUP**********************************
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 fermatresearch/sdxl-improved-refiner using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"fermatresearch/sdxl-improved-refiner:58534db966a6866fa7e699482ebf8b508a8c39e197bb8ed7ce2d9b1e1cc6527e",
{
input: {
apply_watermark: true,
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",
seed: 16010,
tile_refine: true,
tile_refine_conditioning_strength: 0.5,
tile_refine_steps: 20,
tile_refine_strength: 0.5,
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_aUP**********************************
This is your API token. Keep it to yourself.
import replicate
Run fermatresearch/sdxl-improved-refiner using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fermatresearch/sdxl-improved-refiner:58534db966a6866fa7e699482ebf8b508a8c39e197bb8ed7ce2d9b1e1cc6527e",
input={
"apply_watermark": True,
"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",
"seed": 16010,
"tile_refine": True,
"tile_refine_conditioning_strength": 0.5,
"tile_refine_steps": 20,
"tile_refine_strength": 0.5,
"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_aUP**********************************
This is your API token. Keep it to yourself.
Run fermatresearch/sdxl-improved-refiner 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": "fermatresearch/sdxl-improved-refiner:58534db966a6866fa7e699482ebf8b508a8c39e197bb8ed7ce2d9b1e1cc6527e",
"input": {
"apply_watermark": true,
"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",
"seed": 16010,
"tile_refine": true,
"tile_refine_conditioning_strength": 0.5,
"tile_refine_steps": 20,
"tile_refine_strength": 0.5,
"width": 768
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "d5uroutbzbbvo44gmehlqzalay",
"model": "fermatresearch/sdxl-improved-refiner",
"version": "58534db966a6866fa7e699482ebf8b508a8c39e197bb8ed7ce2d9b1e1cc6527e",
"input": {
"apply_watermark": true,
"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",
"seed": 16010,
"tile_refine": true,
"tile_refine_conditioning_strength": 0.5,
"tile_refine_steps": 20,
"tile_refine_strength": 0.5,
"width": 768
},
"logs": "Using seed: 16010\nPrompt: An astronaut riding a rainbow unicorn, cinematic, dramatic\ntxt2img mode\n 0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:00<00:05, 3.59it/s]\n 10%|█ | 2/20 [00:00<00:03, 5.40it/s]\n 15%|█▌ | 3/20 [00:00<00:02, 6.43it/s]\n 20%|██ | 4/20 [00:00<00:02, 7.05it/s]\n 25%|██▌ | 5/20 [00:00<00:02, 7.44it/s]\n 30%|███ | 6/20 [00:00<00:01, 7.69it/s]\n 35%|███▌ | 7/20 [00:01<00:01, 7.86it/s]\n 40%|████ | 8/20 [00:01<00:01, 7.97it/s]\n 45%|████▌ | 9/20 [00:01<00:01, 8.05it/s]\n 50%|█████ | 10/20 [00:01<00:01, 8.11it/s]\n 55%|█████▌ | 11/20 [00:01<00:01, 8.16it/s]\n 60%|██████ | 12/20 [00:01<00:00, 8.20it/s]\n 65%|██████▌ | 13/20 [00:01<00:00, 8.22it/s]\n 70%|███████ | 14/20 [00:01<00:00, 8.24it/s]\n 75%|███████▌ | 15/20 [00:01<00:00, 8.25it/s]\n 80%|████████ | 16/20 [00:02<00:00, 8.25it/s]\n 85%|████████▌ | 17/20 [00:02<00:00, 8.26it/s]\n 90%|█████████ | 18/20 [00:02<00:00, 8.26it/s]\n 95%|█████████▌| 19/20 [00:02<00:00, 8.26it/s]\n100%|██████████| 20/20 [00:02<00:00, 8.27it/s]\n100%|██████████| 20/20 [00:02<00:00, 7.76it/s]\n 0%| | 0/5 [00:00<?, ?it/s]\n 20%|██ | 1/5 [00:00<00:00, 7.31it/s]\n 40%|████ | 2/5 [00:00<00:00, 7.66it/s]\n 60%|██████ | 3/5 [00:00<00:00, 7.78it/s]\n 80%|████████ | 4/5 [00:00<00:00, 7.83it/s]\n100%|██████████| 5/5 [00:00<00:00, 7.87it/s]\n100%|██████████| 5/5 [00:00<00:00, 7.79it/s]\n 0%| | 0/10 [00:00<?, ?it/s]\n 10%|█ | 1/10 [00:00<00:01, 5.82it/s]\n 30%|███ | 3/10 [00:00<00:00, 8.12it/s]\n 40%|████ | 4/10 [00:00<00:00, 7.73it/s]\n 50%|█████ | 5/10 [00:00<00:00, 7.49it/s]\n 60%|██████ | 6/10 [00:00<00:00, 7.35it/s]\n 70%|███████ | 7/10 [00:00<00:00, 7.25it/s]\n 80%|████████ | 8/10 [00:01<00:00, 7.18it/s]\n 90%|█████████ | 9/10 [00:01<00:00, 7.14it/s]\n100%|██████████| 10/10 [00:01<00:00, 7.12it/s]\n100%|██████████| 10/10 [00:01<00:00, 7.27it/s]",
"output": [
"https://replicate.delivery/pbxt/uVlVR57RGYrNIJRQZ1NwDEs8xhoEQfLhxnkJO0bkddJdHjGJA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-01-16T16:38:46.808996Z",
"started_at": "2024-01-16T16:41:24.224533Z",
"completed_at": "2024-01-16T16:41:31.780825Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/d5uroutbzbbvo44gmehlqzalay/cancel",
"get": "https://api.replicate.com/v1/predictions/d5uroutbzbbvo44gmehlqzalay"
},
"metrics": {
"predict_time": 7.556292,
"total_time": 164.971829
}
}