defaultAn astronaut riding a rainbow unicorn, cinematic, dramatic
typetext
{
"apply_watermark": true,
"guidance_scale": 1,
"height": 1024,
"lora_scale": 0.6,
"negative_prompt": "",
"num_inference_steps": 4,
"num_outputs": 1,
"prompt": "close-up photography of a panda standing in the rain at night in a yellow jacket, under a clear umbrella, urban setting, in a street lit by lamps, facing camera, leica 35mm summilux",
"prompt_strength": 0.8,
"scheduler": "LCM",
"seed": 29070,
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_0Ij**********************************
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 lucataco/sdxl-lcm using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/sdxl-lcm:fbbd475b1084de80c47c35bfe4ae64b964294aa7e237e6537eed938cfd24903d",
{
input: {
apply_watermark: true,
guidance_scale: 1,
height: 1024,
lora_scale: 0.6,
negative_prompt: "",
num_inference_steps: 4,
num_outputs: 1,
prompt: "close-up photography of a panda standing in the rain at night in a yellow jacket, under a clear umbrella, urban setting, in a street lit by lamps, facing camera, leica 35mm summilux",
prompt_strength: 0.8,
scheduler: "LCM",
seed: 29070,
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_0Ij**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/sdxl-lcm using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/sdxl-lcm:fbbd475b1084de80c47c35bfe4ae64b964294aa7e237e6537eed938cfd24903d",
input={
"apply_watermark": True,
"guidance_scale": 1,
"height": 1024,
"lora_scale": 0.6,
"negative_prompt": "",
"num_inference_steps": 4,
"num_outputs": 1,
"prompt": "close-up photography of a panda standing in the rain at night in a yellow jacket, under a clear umbrella, urban setting, in a street lit by lamps, facing camera, leica 35mm summilux",
"prompt_strength": 0.8,
"scheduler": "LCM",
"seed": 29070,
"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_0Ij**********************************
This is your API token. Keep it to yourself.
Run lucataco/sdxl-lcm 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": "lucataco/sdxl-lcm:fbbd475b1084de80c47c35bfe4ae64b964294aa7e237e6537eed938cfd24903d",
"input": {
"apply_watermark": true,
"guidance_scale": 1,
"height": 1024,
"lora_scale": 0.6,
"negative_prompt": "",
"num_inference_steps": 4,
"num_outputs": 1,
"prompt": "close-up photography of a panda standing in the rain at night in a yellow jacket, under a clear umbrella, urban setting, in a street lit by lamps, facing camera, leica 35mm summilux",
"prompt_strength": 0.8,
"scheduler": "LCM",
"seed": 29070,
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "x0cwyhz955rma0ckkq9rwsdma4",
"model": "lucataco/sdxl-lcm",
"version": "fbbd475b1084de80c47c35bfe4ae64b964294aa7e237e6537eed938cfd24903d",
"input": {
"apply_watermark": true,
"guidance_scale": 1,
"height": 1024,
"lora_scale": 0.6,
"negative_prompt": "",
"num_inference_steps": 4,
"num_outputs": 1,
"prompt": "close-up photography of a panda standing in the rain at night in a yellow jacket, under a clear umbrella, urban setting, in a street lit by lamps, facing camera, leica 35mm summilux",
"prompt_strength": 0.8,
"scheduler": "LCM",
"seed": 29070,
"width": 1024
},
"logs": "Using seed: 29070\nPrompt: close-up photography of a panda standing in the rain at night in a yellow jacket, under a clear umbrella, urban setting, in a street lit by lamps, facing camera, leica 35mm summilux\ntxt2img mode\nThe config attributes {'skip_prk_steps': True} were passed to LCMScheduler, but are not expected and will be ignored. Please verify your scheduler_config.json configuration file.\n 0%| | 0/4 [00:00<?, ?it/s]\n 25%|██▌ | 1/4 [00:00<00:00, 5.64it/s]\n 75%|███████▌ | 3/4 [00:00<00:00, 11.00it/s]\n100%|██████████| 4/4 [00:00<00:00, 11.11it/s]",
"output": [
"https://replicate.delivery/xezq/CFULEO2b1eX9XKslkybMQhQLatPS79fBwMTles4k77lqdjwnA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-12-06T21:15:30.985Z",
"started_at": "2024-12-06T21:16:36.115986Z",
"completed_at": "2024-12-06T21:16:37.410075Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/x0cwyhz955rma0ckkq9rwsdma4/cancel",
"get": "https://api.replicate.com/v1/predictions/x0cwyhz955rma0ckkq9rwsdma4",
"stream": "https://stream.replicate.com/v1/files/bcwr-io5mndnonhmajwh7s5f44wihmd63d3gbo3qv3dcmj3jhyrmukuta",
"web": "https://replicate.com/p/x0cwyhz955rma0ckkq9rwsdma4"
},
"metrics": {
"predict_time": 1.294088758,
"total_time": 66.425075
}
}