typetext
{
"aspect_ratio": "1:1",
"go_fast": true,
"guidance": 3,
"lora_scale": 1,
"lora_weights": "bingbangboom-lab/flux-new-whimscape",
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"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",
"prompt_strength": 0.8
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_DHS**********************************
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 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: {
aspect_ratio: "1:1",
go_fast: true,
guidance: 3,
lora_scale: 1,
lora_weights: "bingbangboom-lab/flux-new-whimscape",
megapixels: "1",
num_inference_steps: 28,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
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",
prompt_strength: 0.8
}
}
);
// 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_DHS**********************************
This is your API token. Keep it to yourself.
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={
"aspect_ratio": "1:1",
"go_fast": True,
"guidance": 3,
"lora_scale": 1,
"lora_weights": "bingbangboom-lab/flux-new-whimscape",
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"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",
"prompt_strength": 0.8
}
)
# 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_DHS**********************************
This is your API token. Keep it to yourself.
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": "invisibleuniverse/flux-dev-lora:245d305ecb1c7717b90204dcbc217f667042e13b15e8756b072b91087bf267ac",
"input": {
"aspect_ratio": "1:1",
"go_fast": true,
"guidance": 3,
"lora_scale": 1,
"lora_weights": "bingbangboom-lab/flux-new-whimscape",
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"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",
"prompt_strength": 0.8
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "7zv8fshr69rj40ck5mdt7dh4zg",
"model": "invisibleuniverse/flux-dev-lora",
"version": "245d305ecb1c7717b90204dcbc217f667042e13b15e8756b072b91087bf267ac",
"input": {
"aspect_ratio": "1:1",
"go_fast": true,
"guidance": 3,
"lora_scale": 1,
"lora_weights": "bingbangboom-lab/flux-new-whimscape",
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"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",
"prompt_strength": 0.8
},
"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",
"output": [
"https://replicate.delivery/yhqm/hfuuv7DdTevkZ0l4ZdQYTHo55hVqTT2v9aNwYZzS4HeNCIinA/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-11-14T23:56:18.866Z",
"started_at": "2024-11-14T23:56:33.808611Z",
"completed_at": "2024-11-14T23:56:54.75116Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/7zv8fshr69rj40ck5mdt7dh4zg/cancel",
"get": "https://api.replicate.com/v1/predictions/7zv8fshr69rj40ck5mdt7dh4zg",
"stream": "https://stream.replicate.com/v1/files/qoxq-76lfhkod3awzsouxo7yp2ixss6otperakrauoxyodzg627gncxxq",
"web": "https://replicate.com/p/7zv8fshr69rj40ck5mdt7dh4zg"
},
"metrics": {
"predict_time": 20.942549811,
"total_time": 35.88516
}
}