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.
doriandarko /lcm-hiroshinagai:b43c25e9
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";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run doriandarko/lcm-hiroshinagai using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"doriandarko/lcm-hiroshinagai:b43c25e9643af233e1258c839b6c6726504cbc25a1843ff80d83d911b8c99faa",
{
input: {
width: 1024,
height: 1024,
prompt: "In the style of TOK, a car in the countryside",
scheduler: "LCM",
lora_scale: 0.6,
num_outputs: 4,
guidance_scale: 2,
apply_watermark: true,
negative_prompt: "black and white, ugly, ",
prompt_strength: 0.8,
num_inference_steps: 6
}
}
);
// 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 doriandarko/lcm-hiroshinagai using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"doriandarko/lcm-hiroshinagai:b43c25e9643af233e1258c839b6c6726504cbc25a1843ff80d83d911b8c99faa",
input={
"width": 1024,
"height": 1024,
"prompt": "In the style of TOK, a car in the countryside",
"scheduler": "LCM",
"lora_scale": 0.6,
"num_outputs": 4,
"guidance_scale": 2,
"apply_watermark": True,
"negative_prompt": "black and white, ugly, ",
"prompt_strength": 0.8,
"num_inference_steps": 6
}
)
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 doriandarko/lcm-hiroshinagai 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": "doriandarko/lcm-hiroshinagai:b43c25e9643af233e1258c839b6c6726504cbc25a1843ff80d83d911b8c99faa",
"input": {
"width": 1024,
"height": 1024,
"prompt": "In the style of TOK, a car in the countryside",
"scheduler": "LCM",
"lora_scale": 0.6,
"num_outputs": 4,
"guidance_scale": 2,
"apply_watermark": true,
"negative_prompt": "black and white, ugly, ",
"prompt_strength": 0.8,
"num_inference_steps": 6
}
}' \
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-15T05:16:34.537473Z",
"created_at": "2023-11-15T05:16:18.166860Z",
"data_removed": false,
"error": null,
"id": "pbnkr4tbfqd3pahwxyfv3ab24a",
"input": {
"width": 1024,
"height": 1024,
"prompt": "In the style of TOK, a car in the countryside",
"scheduler": "LCM",
"lora_scale": 0.6,
"num_outputs": 4,
"guidance_scale": 2,
"apply_watermark": true,
"negative_prompt": "black and white, ugly, ",
"prompt_strength": 0.8,
"num_inference_steps": 6
},
"logs": "Using seed: 48493\nEnsuring enough disk space...\nFree disk space: 1429398622208\nDownloading weights: https://replicate.delivery/pbxt/2qPgVBQfv02WJapYb0CrvfE0tEPGSWInWTo3Of2QTKDZZAxjA/trained_model.tar\nb'Downloaded 186 MB bytes in 0.660s (282 MB/s)\\nExtracted 186 MB in 0.065s (2.9 GB/s)\\n'\nDownloaded weights in 0.9539430141448975 seconds\nLoading fine-tuned model\nDoes not have Unet. assume we are using LoRA\nLoading Unet LoRA\nPrompt: In the style of <s0><s1>, a car in the countryside\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/6 [00:00<?, ?it/s]/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/diffusers/models/attention_processor.py:1821: FutureWarning: `LoRAAttnProcessor2_0` is deprecated and will be removed in version 0.26.0. Make sure use AttnProcessor2_0 instead by settingLoRA layers to `self.{to_q,to_k,to_v,to_out[0]}.lora_layer` respectively. This will be done automatically when using `LoraLoaderMixin.load_lora_weights`\ndeprecate(\n 17%|█▋ | 1/6 [00:01<00:05, 1.13s/it]\n 33%|███▎ | 2/6 [00:02<00:04, 1.04s/it]\n 50%|█████ | 3/6 [00:03<00:03, 1.02s/it]\n 67%|██████▋ | 4/6 [00:04<00:02, 1.01s/it]\n 83%|████████▎ | 5/6 [00:05<00:00, 1.00it/s]\n100%|██████████| 6/6 [00:06<00:00, 1.00it/s]\n100%|██████████| 6/6 [00:06<00:00, 1.01s/it]",
"metrics": {
"predict_time": 14.691208,
"total_time": 16.370613
},
"output": [
"https://replicate.delivery/pbxt/90BuEtogj0qtJJhLnL7S1QDh0Yc2VoKWTIU4y1e9fUzvYg4RA/out-0.png",
"https://replicate.delivery/pbxt/bJnt9cRo1trePqWQnmrTMLip6XCDG3PU1nIkfQ8TyT4xYg4RA/out-1.png",
"https://replicate.delivery/pbxt/222CgQeIeImZB0OqmH5JTLjS5F8oW5NDfit1vT0UlOljxAxjA/out-2.png",
"https://replicate.delivery/pbxt/WZzbeAUZbQWDQCGPzppipFABshrtEEcrmVcWSaBH24HZMQ8IA/out-3.png"
],
"started_at": "2023-11-15T05:16:19.846265Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/pbnkr4tbfqd3pahwxyfv3ab24a",
"cancel": "https://api.replicate.com/v1/predictions/pbnkr4tbfqd3pahwxyfv3ab24a/cancel"
},
"version": "b43c25e9643af233e1258c839b6c6726504cbc25a1843ff80d83d911b8c99faa"
}
Using seed: 48493
Ensuring enough disk space...
Free disk space: 1429398622208
Downloading weights: https://replicate.delivery/pbxt/2qPgVBQfv02WJapYb0CrvfE0tEPGSWInWTo3Of2QTKDZZAxjA/trained_model.tar
b'Downloaded 186 MB bytes in 0.660s (282 MB/s)\nExtracted 186 MB in 0.065s (2.9 GB/s)\n'
Downloaded weights in 0.9539430141448975 seconds
Loading fine-tuned model
Does not have Unet. assume we are using LoRA
Loading Unet LoRA
Prompt: In the style of <s0><s1>, a car in the countryside
txt2img mode
The 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.
0%| | 0/6 [00:00<?, ?it/s]/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/diffusers/models/attention_processor.py:1821: FutureWarning: `LoRAAttnProcessor2_0` is deprecated and will be removed in version 0.26.0. Make sure use AttnProcessor2_0 instead by settingLoRA layers to `self.{to_q,to_k,to_v,to_out[0]}.lora_layer` respectively. This will be done automatically when using `LoraLoaderMixin.load_lora_weights`
deprecate(
17%|█▋ | 1/6 [00:01<00:05, 1.13s/it]
33%|███▎ | 2/6 [00:02<00:04, 1.04s/it]
50%|█████ | 3/6 [00:03<00:03, 1.02s/it]
67%|██████▋ | 4/6 [00:04<00:02, 1.01s/it]
83%|████████▎ | 5/6 [00:05<00:00, 1.00it/s]
100%|██████████| 6/6 [00:06<00:00, 1.00it/s]
100%|██████████| 6/6 [00:06<00:00, 1.01s/it]