typetext
{
"aspect_ratio": "1:1",
"go_fast": true,
"guidance": 3,
"lora_scale": 0.7,
"lora_weights": "davisbrown/flux-half-illustration",
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "In the style of TOK, a photo editorial avant-garde dramatic action pose of a person wearing 90s round wacky sunglasses pulling glasses down looking forward, in Tokyo with large marble structures and bonsai trees at sunset with a vibrant illustrated jacket surrounded by illustrations of flowers, smoke, flames, ice cream, sparkles, rock and roll",
"prompt_strength": 0.8
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Nkb**********************************
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 black-forest-labs/flux-dev-lora using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "1:1",
go_fast: true,
guidance: 3,
lora_scale: 0.7,
lora_weights: "davisbrown/flux-half-illustration",
megapixels: "1",
num_inference_steps: 28,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
prompt: "In the style of TOK, a photo editorial avant-garde dramatic action pose of a person wearing 90s round wacky sunglasses pulling glasses down looking forward, in Tokyo with large marble structures and bonsai trees at sunset with a vibrant illustrated jacket surrounded by illustrations of flowers, smoke, flames, ice cream, sparkles, rock and roll",
prompt_strength: 0.8
};
const output = await replicate.run("black-forest-labs/flux-dev-lora", { input });
// 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_Nkb**********************************
This is your API token. Keep it to yourself.
import replicate
Run black-forest-labs/flux-dev-lora using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"black-forest-labs/flux-dev-lora",
input={
"aspect_ratio": "1:1",
"go_fast": True,
"guidance": 3,
"lora_scale": 0.7,
"lora_weights": "davisbrown/flux-half-illustration",
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "In the style of TOK, a photo editorial avant-garde dramatic action pose of a person wearing 90s round wacky sunglasses pulling glasses down looking forward, in Tokyo with large marble structures and bonsai trees at sunset with a vibrant illustrated jacket surrounded by illustrations of flowers, smoke, flames, ice cream, sparkles, rock and roll",
"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_Nkb**********************************
This is your API token. Keep it to yourself.
Run black-forest-labs/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 $'{
"input": {
"aspect_ratio": "1:1",
"go_fast": true,
"guidance": 3,
"lora_scale": 0.7,
"lora_weights": "davisbrown/flux-half-illustration",
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "In the style of TOK, a photo editorial avant-garde dramatic action pose of a person wearing 90s round wacky sunglasses pulling glasses down looking forward, in Tokyo with large marble structures and bonsai trees at sunset with a vibrant illustrated jacket surrounded by illustrations of flowers, smoke, flames, ice cream, sparkles, rock and roll",
"prompt_strength": 0.8
}
}' \
https://api.replicate.com/v1/models/black-forest-labs/flux-dev-lora/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "h1nykv9z3drme0ck506ay2gjyr",
"model": "black-forest-labs/flux-dev-lora",
"version": "hidden",
"input": {
"aspect_ratio": "1:1",
"go_fast": true,
"guidance": 3,
"lora_scale": 0.7,
"lora_weights": "davisbrown/flux-half-illustration",
"megapixels": "1",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "In the style of TOK, a photo editorial avant-garde dramatic action pose of a person wearing 90s round wacky sunglasses pulling glasses down looking forward, in Tokyo with large marble structures and bonsai trees at sunset with a vibrant illustrated jacket surrounded by illustrations of flowers, smoke, flames, ice cream, sparkles, rock and roll",
"prompt_strength": 0.8
},
"logs": "Lora davisbrown/flux-half-illustration already loaded\nrunning quantized prediction\nUsing seed: 3287284191\n 0%| | 0/28 [00:00<?, ?it/s]\n 7%|▋ | 2/28 [00:00<00:01, 17.81it/s]\n 14%|█▍ | 4/28 [00:00<00:01, 12.93it/s]\n 21%|██▏ | 6/28 [00:00<00:01, 11.87it/s]\n 29%|██▊ | 8/28 [00:00<00:01, 11.45it/s]\n 36%|███▌ | 10/28 [00:00<00:01, 11.20it/s]\n 43%|████▎ | 12/28 [00:01<00:01, 10.83it/s]\n 50%|█████ | 14/28 [00:01<00:01, 10.83it/s]\n 57%|█████▋ | 16/28 [00:01<00:01, 10.78it/s]\n 64%|██████▍ | 18/28 [00:01<00:00, 10.78it/s]\n 71%|███████▏ | 20/28 [00:01<00:00, 10.76it/s]\n 79%|███████▊ | 22/28 [00:01<00:00, 10.65it/s]\n 86%|████████▌ | 24/28 [00:02<00:00, 10.63it/s]\n 93%|█████████▎| 26/28 [00:02<00:00, 10.64it/s]\n100%|██████████| 28/28 [00:02<00:00, 10.66it/s]\n100%|██████████| 28/28 [00:02<00:00, 10.99it/s]\nTotal safe images: 1 out of 1",
"output": [
"https://replicate.delivery/xezq/v9eRgadlfiqktkbyFy4R6ki6LTBJSYvkpsBHbLxmrPViSvwTA/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-11-14T00:21:51.515Z",
"started_at": "2024-11-14T00:21:51.520605Z",
"completed_at": "2024-11-14T00:21:54.387601Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/h1nykv9z3drme0ck506ay2gjyr/cancel",
"get": "https://api.replicate.com/v1/predictions/h1nykv9z3drme0ck506ay2gjyr",
"stream": "https://stream.replicate.com/v1/files/bcwr-lxfcbwtkjxau7zcdzsqewijy5ha26bambvx7ykrlbkjqbarqlz6q",
"web": "https://replicate.com/p/h1nykv9z3drme0ck506ay2gjyr"
},
"metrics": {
"image_count": 1,
"predict_time": 2.866995538,
"total_time": 2.872601
}
}