defaultSelf-portrait oil painting, a beautiful cyborg with golden hair, 8k
typetext
{
"guidance_scale": 8,
"height": 768,
"num_images": 1,
"num_inference_steps": 8,
"prompt": "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k",
"width": 768
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_QNl**********************************
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 luosiallen/latent-consistency-model using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"luosiallen/latent-consistency-model:553803fd018b3cf875a8bc774c99da9b33f36647badfd88a6eec90d61c5f62fc",
{
input: {
guidance_scale: 8,
height: 768,
num_images: 1,
num_inference_steps: 8,
prompt: "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k",
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_QNl**********************************
This is your API token. Keep it to yourself.
import replicate
Run luosiallen/latent-consistency-model using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"luosiallen/latent-consistency-model:553803fd018b3cf875a8bc774c99da9b33f36647badfd88a6eec90d61c5f62fc",
input={
"guidance_scale": 8,
"height": 768,
"num_images": 1,
"num_inference_steps": 8,
"prompt": "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k",
"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_QNl**********************************
This is your API token. Keep it to yourself.
Run luosiallen/latent-consistency-model 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": "luosiallen/latent-consistency-model:553803fd018b3cf875a8bc774c99da9b33f36647badfd88a6eec90d61c5f62fc",
"input": {
"guidance_scale": 8,
"height": 768,
"num_images": 1,
"num_inference_steps": 8,
"prompt": "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k",
"width": 768
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "5lwbdqdbyrilvvsm62mphlbghu",
"model": "luosiallen/latent-consistency-model",
"version": "553803fd018b3cf875a8bc774c99da9b33f36647badfd88a6eec90d61c5f62fc",
"input": {
"guidance_scale": 8,
"height": 768,
"num_images": 1,
"num_inference_steps": 8,
"prompt": "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k",
"width": 768
},
"logs": "Using seed: 49296\n 0%| | 0/8 [00:00<?, ?it/s]\n 12%|█▎ | 1/8 [00:00<00:01, 3.73it/s]\n 25%|██▌ | 2/8 [00:00<00:01, 4.96it/s]\n 38%|███▊ | 3/8 [00:00<00:00, 5.53it/s]\n 50%|█████ | 4/8 [00:00<00:00, 5.85it/s]\n 62%|██████▎ | 5/8 [00:00<00:00, 6.04it/s]\n 75%|███████▌ | 6/8 [00:01<00:00, 6.16it/s]\n 88%|████████▊ | 7/8 [00:01<00:00, 6.23it/s]\n100%|██████████| 8/8 [00:01<00:00, 6.27it/s]\n100%|██████████| 8/8 [00:01<00:00, 5.88it/s]",
"output": [
"https://pbxt.replicate.delivery/lE1UZOlbLiY7DpYlLvdUmyyt0Z0pu7tTTpgFn8a0ug3Jb4bE/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-10-18T23:23:35.514094Z",
"started_at": "2023-10-18T23:24:21.281248Z",
"completed_at": "2023-10-18T23:24:24.305624Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/5lwbdqdbyrilvvsm62mphlbghu/cancel",
"get": "https://api.replicate.com/v1/predictions/5lwbdqdbyrilvvsm62mphlbghu"
},
"metrics": {
"predict_time": 3.024376,
"total_time": 48.79153
}
}