Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
fofr /latent-consistency-model:d6ea4b06
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run fofr/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(
"fofr/latent-consistency-model:d6ea4b0610c9121f3dd0fcbb1d47eb1b10f8d944b6ce4ac3d8aadcec9695dd53",
{
input: {
width: 768,
height: 768,
prompt: "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k\nSelf-portrait oil painting, a beautiful cyborg with purple hair, 8k\nSelf-portrait oil painting, a beautiful cyborg with ginger hair, 8k\nSelf-portrait oil painting, a beautiful cyborg with green hair, 8k",
num_images: 1,
guidance_scale: 8,
archive_outputs: false,
prompt_strength: 0.45,
sizing_strategy: "width/height",
lcm_origin_steps: 50,
canny_low_threshold: 100,
num_inference_steps: 4,
canny_high_threshold: 200,
control_guidance_end: 1,
control_guidance_start: 0,
controlnet_conditioning_scale: 2
}
}
);
// 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run fofr/latent-consistency-model using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/latent-consistency-model:d6ea4b0610c9121f3dd0fcbb1d47eb1b10f8d944b6ce4ac3d8aadcec9695dd53",
input={
"width": 768,
"height": 768,
"prompt": "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k\nSelf-portrait oil painting, a beautiful cyborg with purple hair, 8k\nSelf-portrait oil painting, a beautiful cyborg with ginger hair, 8k\nSelf-portrait oil painting, a beautiful cyborg with green hair, 8k",
"num_images": 1,
"guidance_scale": 8,
"archive_outputs": False,
"prompt_strength": 0.45,
"sizing_strategy": "width/height",
"lcm_origin_steps": 50,
"canny_low_threshold": 100,
"num_inference_steps": 4,
"canny_high_threshold": 200,
"control_guidance_end": 1,
"control_guidance_start": 0,
"controlnet_conditioning_scale": 2
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run fofr/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": "fofr/latent-consistency-model:d6ea4b0610c9121f3dd0fcbb1d47eb1b10f8d944b6ce4ac3d8aadcec9695dd53",
"input": {
"width": 768,
"height": 768,
"prompt": "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k\\nSelf-portrait oil painting, a beautiful cyborg with purple hair, 8k\\nSelf-portrait oil painting, a beautiful cyborg with ginger hair, 8k\\nSelf-portrait oil painting, a beautiful cyborg with green hair, 8k",
"num_images": 1,
"guidance_scale": 8,
"archive_outputs": false,
"prompt_strength": 0.45,
"sizing_strategy": "width/height",
"lcm_origin_steps": 50,
"canny_low_threshold": 100,
"num_inference_steps": 4,
"canny_high_threshold": 200,
"control_guidance_end": 1,
"control_guidance_start": 0,
"controlnet_conditioning_scale": 2
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2023-11-16T10:45:02.316006Z",
"created_at": "2023-11-16T10:43:26.640869Z",
"data_removed": false,
"error": null,
"id": "nnhfewdbjde7sphjmzl3k2avmu",
"input": {
"width": 768,
"height": 768,
"prompt": "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k\nSelf-portrait oil painting, a beautiful cyborg with purple hair, 8k\nSelf-portrait oil painting, a beautiful cyborg with ginger hair, 8k\nSelf-portrait oil painting, a beautiful cyborg with green hair, 8k",
"num_images": 1,
"guidance_scale": 8,
"archive_outputs": false,
"prompt_strength": 0.45,
"sizing_strategy": "width/height",
"lcm_origin_steps": 50,
"canny_low_threshold": 100,
"num_inference_steps": 4,
"canny_high_threshold": 200,
"control_guidance_end": 1,
"control_guidance_start": 0,
"controlnet_conditioning_scale": 2
},
"logs": "Using seed: 32287\nFound 4 prompts:\n- Self-portrait oil painting, a beautiful cyborg with golden hair, 8k\n- Self-portrait oil painting, a beautiful cyborg with purple hair, 8k\n- Self-portrait oil painting, a beautiful cyborg with ginger hair, 8k\n- Self-portrait oil painting, a beautiful cyborg with green hair, 8k\nMaking 4 images\ntxt2img mode\n 0%| | 0/4 [00:00<?, ?it/s]\n 25%|██▌ | 1/4 [00:00<00:00, 3.52it/s]\n 50%|█████ | 2/4 [00:00<00:00, 4.37it/s]\n 75%|███████▌ | 3/4 [00:00<00:00, 4.73it/s]\n100%|██████████| 4/4 [00:00<00:00, 4.92it/s]\n100%|██████████| 4/4 [00:00<00:00, 4.67it/s]",
"metrics": {
"predict_time": 5.59005,
"total_time": 95.675137
},
"output": [
"https://replicate.delivery/pbxt/eTbeue6ymKb3YIkWA48CfvePUfjK6W7GPucK7YTIeNs0VJd8IA/out-0.png",
"https://replicate.delivery/pbxt/DsOPJafrjt24L65eY3yAFq8rLiaNE8UCscqaznqTLthsS64RA/out-1.png",
"https://replicate.delivery/pbxt/kB9ELGAmN8YfXqtNHtjB7lpdohOh2kGZj7tA743fBQutS64RA/out-2.png",
"https://replicate.delivery/pbxt/iffO9dQXPphT9kp6zhS1yFIDiFp0rNMyR37ygXsJuNjtS64RA/out-3.png"
],
"started_at": "2023-11-16T10:44:56.725956Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/nnhfewdbjde7sphjmzl3k2avmu",
"cancel": "https://api.replicate.com/v1/predictions/nnhfewdbjde7sphjmzl3k2avmu/cancel"
},
"version": "d6ea4b0610c9121f3dd0fcbb1d47eb1b10f8d944b6ce4ac3d8aadcec9695dd53"
}
Using seed: 32287
Found 4 prompts:
- Self-portrait oil painting, a beautiful cyborg with golden hair, 8k
- Self-portrait oil painting, a beautiful cyborg with purple hair, 8k
- Self-portrait oil painting, a beautiful cyborg with ginger hair, 8k
- Self-portrait oil painting, a beautiful cyborg with green hair, 8k
Making 4 images
txt2img mode
0%| | 0/4 [00:00<?, ?it/s]
25%|██▌ | 1/4 [00:00<00:00, 3.52it/s]
50%|█████ | 2/4 [00:00<00:00, 4.37it/s]
75%|███████▌ | 3/4 [00:00<00:00, 4.73it/s]
100%|██████████| 4/4 [00:00<00:00, 4.92it/s]
100%|██████████| 4/4 [00:00<00:00, 4.67it/s]