Readme
It utilizes the dev-lora.yaml configuration from the cog-flux repository.
FLUX.1 [dev] (LoRA) with several optimizations such as FP8 Quantization
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 invisibleuniverse/flux-dev-lora using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"invisibleuniverse/flux-dev-lora:245d305ecb1c7717b90204dcbc217f667042e13b15e8756b072b91087bf267ac",
{
input: {
prompt: "a white-haired young woman wearing a flower crown, a very large fiery dragon, castle in the background, illustration in the style of WHMSCPE001",
go_fast: true,
guidance: 3,
lora_scale: 1,
megapixels: "1",
num_outputs: 1,
aspect_ratio: "1:1",
lora_weights: "bingbangboom-lab/flux-new-whimscape",
output_format: "webp",
output_quality: 80,
prompt_strength: 0.8,
num_inference_steps: 28
}
}
);
// 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 invisibleuniverse/flux-dev-lora using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"invisibleuniverse/flux-dev-lora:245d305ecb1c7717b90204dcbc217f667042e13b15e8756b072b91087bf267ac",
input={
"prompt": "a white-haired young woman wearing a flower crown, a very large fiery dragon, castle in the background, illustration in the style of WHMSCPE001",
"go_fast": True,
"guidance": 3,
"lora_scale": 1,
"megapixels": "1",
"num_outputs": 1,
"aspect_ratio": "1:1",
"lora_weights": "bingbangboom-lab/flux-new-whimscape",
"output_format": "webp",
"output_quality": 80,
"prompt_strength": 0.8,
"num_inference_steps": 28
}
)
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 invisibleuniverse/flux-dev-lora 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": "245d305ecb1c7717b90204dcbc217f667042e13b15e8756b072b91087bf267ac",
"input": {
"prompt": "a white-haired young woman wearing a flower crown, a very large fiery dragon, castle in the background, illustration in the style of WHMSCPE001",
"go_fast": true,
"guidance": 3,
"lora_scale": 1,
"megapixels": "1",
"num_outputs": 1,
"aspect_ratio": "1:1",
"lora_weights": "bingbangboom-lab/flux-new-whimscape",
"output_format": "webp",
"output_quality": 80,
"prompt_strength": 0.8,
"num_inference_steps": 28
}
}' \
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
{
"completed_at": "2024-11-14T23:56:54.751160Z",
"created_at": "2024-11-14T23:56:18.866000Z",
"data_removed": false,
"error": null,
"id": "7zv8fshr69rj40ck5mdt7dh4zg",
"input": {
"prompt": "a white-haired young woman wearing a flower crown, a very large fiery dragon, castle in the background, illustration in the style of WHMSCPE001",
"go_fast": true,
"guidance": 3,
"lora_scale": 1,
"megapixels": "1",
"num_outputs": 1,
"aspect_ratio": "1:1",
"lora_weights": "bingbangboom-lab/flux-new-whimscape",
"output_format": "webp",
"output_quality": 80,
"prompt_strength": 0.8,
"num_inference_steps": 28
},
"logs": "2024-11-14 23:56:33.807 | DEBUG | fp8.lora_loading:apply_lora_to_model:547 - Extracting keys\n2024-11-14 23:56:33.807 | DEBUG | fp8.lora_loading:apply_lora_to_model:554 - Keys extracted\nApplying LoRA: 0%| | 0/304 [00:00<?, ?it/s]\nApplying LoRA: 100%|██████████| 304/304 [00:00<00:00, 9393.12it/s]\n2024-11-14 23:56:33.840 | SUCCESS | fp8.lora_loading:unload_loras:537 - LoRAs unloaded in 0.033s\nfree=4100372529152\nDownloading weights\n2024-11-14T23:56:33Z | INFO | [ Initiating ] chunk_size=150M dest=/tmp/tmpneafn7e0/weights url=https://replicate.com/bingbangboom-lab/flux-new-whimscape/_weights\n2024-11-14T23:56:34Z | INFO | [ Redirect ] redirect_url=https://replicate.delivery/yhqm/AWKuvAwZat5RJpucihcXh8QVq4jrWwK65bjpqAVjEftoXCuJA/trained_model.tar url=https://replicate.com/bingbangboom-lab/flux-new-whimscape/_weights\n2024-11-14T23:56:35Z | INFO | [ Complete ] dest=/tmp/tmpneafn7e0/weights size=\"172 MB\" total_elapsed=2.036s url=https://replicate.com/bingbangboom-lab/flux-new-whimscape/_weights\nDownloaded weights in 2.06s\n2024-11-14 23:56:35.907 | INFO | fp8.lora_loading:load_lora:497 - Loading LoRA weights for /src/weights-cache/703d0a25bd278d30\n2024-11-14 23:56:36.006 | INFO | fp8.lora_loading:load_lora:518 - LoRA weights loaded\n2024-11-14 23:56:36.007 | DEBUG | fp8.lora_loading:apply_lora_to_model:547 - Extracting keys\n2024-11-14 23:56:36.007 | DEBUG | fp8.lora_loading:apply_lora_to_model:554 - Keys extracted\nApplying LoRA: 0%| | 0/304 [00:00<?, ?it/s]\nApplying LoRA: 29%|██▉ | 89/304 [00:00<00:00, 870.95it/s]\nApplying LoRA: 58%|█████▊ | 177/304 [00:00<00:00, 597.23it/s]\nApplying LoRA: 80%|███████▉ | 242/304 [00:00<00:00, 540.16it/s]\nApplying LoRA: 98%|█████████▊| 299/304 [00:00<00:00, 503.42it/s]\nApplying LoRA: 100%|██████████| 304/304 [00:00<00:00, 543.98it/s]\n2024-11-14 23:56:36.566 | SUCCESS | fp8.lora_loading:load_lora:521 - LoRA applied in 0.66s\nrunning quantized prediction\nUsing seed: 3863150506\n 0%| | 0/28 [00:00<?, ?it/s]\n 7%|▋ | 2/28 [00:00<00:08, 2.99it/s]\n 11%|█ | 3/28 [00:01<00:11, 2.18it/s]\n 14%|█▍ | 4/28 [00:01<00:12, 1.91it/s]\n 18%|█▊ | 5/28 [00:02<00:12, 1.78it/s]\n 21%|██▏ | 6/28 [00:03<00:12, 1.71it/s]\n 25%|██▌ | 7/28 [00:03<00:12, 1.67it/s]\n 29%|██▊ | 8/28 [00:04<00:12, 1.64it/s]\n 32%|███▏ | 9/28 [00:05<00:11, 1.62it/s]\n 36%|███▌ | 10/28 [00:05<00:11, 1.61it/s]\n 39%|███▉ | 11/28 [00:06<00:10, 1.60it/s]\n 43%|████▎ | 12/28 [00:06<00:10, 1.59it/s]\n 46%|████▋ | 13/28 [00:07<00:09, 1.59it/s]\n 50%|█████ | 14/28 [00:08<00:08, 1.59it/s]\n 54%|█████▎ | 15/28 [00:08<00:08, 1.58it/s]\n 57%|█████▋ | 16/28 [00:09<00:07, 1.58it/s]\n 61%|██████ | 17/28 [00:10<00:06, 1.58it/s]\n 64%|██████▍ | 18/28 [00:10<00:06, 1.58it/s]\n 68%|██████▊ | 19/28 [00:11<00:05, 1.58it/s]\n 71%|███████▏ | 20/28 [00:12<00:05, 1.58it/s]\n 75%|███████▌ | 21/28 [00:12<00:04, 1.58it/s]\n 79%|███████▊ | 22/28 [00:13<00:03, 1.58it/s]\n 82%|████████▏ | 23/28 [00:13<00:03, 1.58it/s]\n 86%|████████▌ | 24/28 [00:14<00:02, 1.58it/s]\n 89%|████████▉ | 25/28 [00:15<00:01, 1.58it/s]\n 93%|█████████▎| 26/28 [00:15<00:01, 1.58it/s]\n 96%|█████████▋| 27/28 [00:16<00:00, 1.58it/s]\n100%|██████████| 28/28 [00:17<00:00, 1.58it/s]\n100%|██████████| 28/28 [00:17<00:00, 1.64it/s]\nTotal safe images: 1 out of 1",
"metrics": {
"predict_time": 20.942549811,
"total_time": 35.88516
},
"output": [
"https://replicate.delivery/yhqm/hfuuv7DdTevkZ0l4ZdQYTHo55hVqTT2v9aNwYZzS4HeNCIinA/out-0.webp"
],
"started_at": "2024-11-14T23:56:33.808611Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/qoxq-76lfhkod3awzsouxo7yp2ixss6otperakrauoxyodzg627gncxxq",
"get": "https://api.replicate.com/v1/predictions/7zv8fshr69rj40ck5mdt7dh4zg",
"cancel": "https://api.replicate.com/v1/predictions/7zv8fshr69rj40ck5mdt7dh4zg/cancel"
},
"version": "245d305ecb1c7717b90204dcbc217f667042e13b15e8756b072b91087bf267ac"
}
2024-11-14 23:56:33.807 | DEBUG | fp8.lora_loading:apply_lora_to_model:547 - Extracting keys
2024-11-14 23:56:33.807 | DEBUG | fp8.lora_loading:apply_lora_to_model:554 - Keys extracted
Applying LoRA: 0%| | 0/304 [00:00<?, ?it/s]
Applying LoRA: 100%|██████████| 304/304 [00:00<00:00, 9393.12it/s]
2024-11-14 23:56:33.840 | SUCCESS | fp8.lora_loading:unload_loras:537 - LoRAs unloaded in 0.033s
free=4100372529152
Downloading weights
2024-11-14T23:56:33Z | INFO | [ Initiating ] chunk_size=150M dest=/tmp/tmpneafn7e0/weights url=https://replicate.com/bingbangboom-lab/flux-new-whimscape/_weights
2024-11-14T23:56:34Z | INFO | [ Redirect ] redirect_url=https://replicate.delivery/yhqm/AWKuvAwZat5RJpucihcXh8QVq4jrWwK65bjpqAVjEftoXCuJA/trained_model.tar url=https://replicate.com/bingbangboom-lab/flux-new-whimscape/_weights
2024-11-14T23:56:35Z | INFO | [ Complete ] dest=/tmp/tmpneafn7e0/weights size="172 MB" total_elapsed=2.036s url=https://replicate.com/bingbangboom-lab/flux-new-whimscape/_weights
Downloaded weights in 2.06s
2024-11-14 23:56:35.907 | INFO | fp8.lora_loading:load_lora:497 - Loading LoRA weights for /src/weights-cache/703d0a25bd278d30
2024-11-14 23:56:36.006 | INFO | fp8.lora_loading:load_lora:518 - LoRA weights loaded
2024-11-14 23:56:36.007 | DEBUG | fp8.lora_loading:apply_lora_to_model:547 - Extracting keys
2024-11-14 23:56:36.007 | DEBUG | fp8.lora_loading:apply_lora_to_model:554 - Keys extracted
Applying LoRA: 0%| | 0/304 [00:00<?, ?it/s]
Applying LoRA: 29%|██▉ | 89/304 [00:00<00:00, 870.95it/s]
Applying LoRA: 58%|█████▊ | 177/304 [00:00<00:00, 597.23it/s]
Applying LoRA: 80%|███████▉ | 242/304 [00:00<00:00, 540.16it/s]
Applying LoRA: 98%|█████████▊| 299/304 [00:00<00:00, 503.42it/s]
Applying LoRA: 100%|██████████| 304/304 [00:00<00:00, 543.98it/s]
2024-11-14 23:56:36.566 | SUCCESS | fp8.lora_loading:load_lora:521 - LoRA applied in 0.66s
running quantized prediction
Using seed: 3863150506
0%| | 0/28 [00:00<?, ?it/s]
7%|▋ | 2/28 [00:00<00:08, 2.99it/s]
11%|█ | 3/28 [00:01<00:11, 2.18it/s]
14%|█▍ | 4/28 [00:01<00:12, 1.91it/s]
18%|█▊ | 5/28 [00:02<00:12, 1.78it/s]
21%|██▏ | 6/28 [00:03<00:12, 1.71it/s]
25%|██▌ | 7/28 [00:03<00:12, 1.67it/s]
29%|██▊ | 8/28 [00:04<00:12, 1.64it/s]
32%|███▏ | 9/28 [00:05<00:11, 1.62it/s]
36%|███▌ | 10/28 [00:05<00:11, 1.61it/s]
39%|███▉ | 11/28 [00:06<00:10, 1.60it/s]
43%|████▎ | 12/28 [00:06<00:10, 1.59it/s]
46%|████▋ | 13/28 [00:07<00:09, 1.59it/s]
50%|█████ | 14/28 [00:08<00:08, 1.59it/s]
54%|█████▎ | 15/28 [00:08<00:08, 1.58it/s]
57%|█████▋ | 16/28 [00:09<00:07, 1.58it/s]
61%|██████ | 17/28 [00:10<00:06, 1.58it/s]
64%|██████▍ | 18/28 [00:10<00:06, 1.58it/s]
68%|██████▊ | 19/28 [00:11<00:05, 1.58it/s]
71%|███████▏ | 20/28 [00:12<00:05, 1.58it/s]
75%|███████▌ | 21/28 [00:12<00:04, 1.58it/s]
79%|███████▊ | 22/28 [00:13<00:03, 1.58it/s]
82%|████████▏ | 23/28 [00:13<00:03, 1.58it/s]
86%|████████▌ | 24/28 [00:14<00:02, 1.58it/s]
89%|████████▉ | 25/28 [00:15<00:01, 1.58it/s]
93%|█████████▎| 26/28 [00:15<00:01, 1.58it/s]
96%|█████████▋| 27/28 [00:16<00:00, 1.58it/s]
100%|██████████| 28/28 [00:17<00:00, 1.58it/s]
100%|██████████| 28/28 [00:17<00:00, 1.64it/s]
Total safe images: 1 out of 1
This model runs on Nvidia A100 (80GB) GPU hardware. We don't yet have enough runs of this model to provide performance information.
It utilizes the dev-lora.yaml configuration from the cog-flux repository.
This model is cold. You'll get a fast response if the model is warm and already running, and a slower response if the model is cold and starting up.
Choose a file from your machine
Hint: you can also drag files onto the input
2024-11-14 23:56:33.807 | DEBUG | fp8.lora_loading:apply_lora_to_model:547 - Extracting keys
2024-11-14 23:56:33.807 | DEBUG | fp8.lora_loading:apply_lora_to_model:554 - Keys extracted
Applying LoRA: 0%| | 0/304 [00:00<?, ?it/s]
Applying LoRA: 100%|██████████| 304/304 [00:00<00:00, 9393.12it/s]
2024-11-14 23:56:33.840 | SUCCESS | fp8.lora_loading:unload_loras:537 - LoRAs unloaded in 0.033s
free=4100372529152
Downloading weights
2024-11-14T23:56:33Z | INFO | [ Initiating ] chunk_size=150M dest=/tmp/tmpneafn7e0/weights url=https://replicate.com/bingbangboom-lab/flux-new-whimscape/_weights
2024-11-14T23:56:34Z | INFO | [ Redirect ] redirect_url=https://replicate.delivery/yhqm/AWKuvAwZat5RJpucihcXh8QVq4jrWwK65bjpqAVjEftoXCuJA/trained_model.tar url=https://replicate.com/bingbangboom-lab/flux-new-whimscape/_weights
2024-11-14T23:56:35Z | INFO | [ Complete ] dest=/tmp/tmpneafn7e0/weights size="172 MB" total_elapsed=2.036s url=https://replicate.com/bingbangboom-lab/flux-new-whimscape/_weights
Downloaded weights in 2.06s
2024-11-14 23:56:35.907 | INFO | fp8.lora_loading:load_lora:497 - Loading LoRA weights for /src/weights-cache/703d0a25bd278d30
2024-11-14 23:56:36.006 | INFO | fp8.lora_loading:load_lora:518 - LoRA weights loaded
2024-11-14 23:56:36.007 | DEBUG | fp8.lora_loading:apply_lora_to_model:547 - Extracting keys
2024-11-14 23:56:36.007 | DEBUG | fp8.lora_loading:apply_lora_to_model:554 - Keys extracted
Applying LoRA: 0%| | 0/304 [00:00<?, ?it/s]
Applying LoRA: 29%|██▉ | 89/304 [00:00<00:00, 870.95it/s]
Applying LoRA: 58%|█████▊ | 177/304 [00:00<00:00, 597.23it/s]
Applying LoRA: 80%|███████▉ | 242/304 [00:00<00:00, 540.16it/s]
Applying LoRA: 98%|█████████▊| 299/304 [00:00<00:00, 503.42it/s]
Applying LoRA: 100%|██████████| 304/304 [00:00<00:00, 543.98it/s]
2024-11-14 23:56:36.566 | SUCCESS | fp8.lora_loading:load_lora:521 - LoRA applied in 0.66s
running quantized prediction
Using seed: 3863150506
0%| | 0/28 [00:00<?, ?it/s]
7%|▋ | 2/28 [00:00<00:08, 2.99it/s]
11%|█ | 3/28 [00:01<00:11, 2.18it/s]
14%|█▍ | 4/28 [00:01<00:12, 1.91it/s]
18%|█▊ | 5/28 [00:02<00:12, 1.78it/s]
21%|██▏ | 6/28 [00:03<00:12, 1.71it/s]
25%|██▌ | 7/28 [00:03<00:12, 1.67it/s]
29%|██▊ | 8/28 [00:04<00:12, 1.64it/s]
32%|███▏ | 9/28 [00:05<00:11, 1.62it/s]
36%|███▌ | 10/28 [00:05<00:11, 1.61it/s]
39%|███▉ | 11/28 [00:06<00:10, 1.60it/s]
43%|████▎ | 12/28 [00:06<00:10, 1.59it/s]
46%|████▋ | 13/28 [00:07<00:09, 1.59it/s]
50%|█████ | 14/28 [00:08<00:08, 1.59it/s]
54%|█████▎ | 15/28 [00:08<00:08, 1.58it/s]
57%|█████▋ | 16/28 [00:09<00:07, 1.58it/s]
61%|██████ | 17/28 [00:10<00:06, 1.58it/s]
64%|██████▍ | 18/28 [00:10<00:06, 1.58it/s]
68%|██████▊ | 19/28 [00:11<00:05, 1.58it/s]
71%|███████▏ | 20/28 [00:12<00:05, 1.58it/s]
75%|███████▌ | 21/28 [00:12<00:04, 1.58it/s]
79%|███████▊ | 22/28 [00:13<00:03, 1.58it/s]
82%|████████▏ | 23/28 [00:13<00:03, 1.58it/s]
86%|████████▌ | 24/28 [00:14<00:02, 1.58it/s]
89%|████████▉ | 25/28 [00:15<00:01, 1.58it/s]
93%|█████████▎| 26/28 [00:15<00:01, 1.58it/s]
96%|█████████▋| 27/28 [00:16<00:00, 1.58it/s]
100%|██████████| 28/28 [00:17<00:00, 1.58it/s]
100%|██████████| 28/28 [00:17<00:00, 1.64it/s]
Total safe images: 1 out of 1