Logo
Flux FIne-Tuning API
fluxfine-tuningapiflux apiflux fine tuning
Feb 07 2025

Flux FIne-Tuning API

When Black Forest Labs (BFL) released Flux Dev fine-tuning, the AI community went nuts because of how cool that anyone can teach the model to recognize and generate new concepts by showing it a small set of example images, allowing you to customize the model’s output for specific styles, characters, or objects.

It quickly became one of the best image model fine-tuning solutions on the market. If you’re interested in knowing how to fine-tune the Flux Dev model, check out this guide:

How To Train Flux AI Image Model To Generate Unlimited Photos of Yourself
Today, you can fine-tune the most capable open-weight image model, Flux, from Black Forest Labs to generate unlimited…generativeai.pub

Today, BFL has taken things a step further by allowing users to fine-tune the Flux Pro model via API.

According to BFL, users need only as few as 1–5 example images to easily reimagine user-provided content via text prompts. The images can be in different formats, like JPG, JPEG, PNG, or WebP, with resolutions capped at one megapixel for optimal results.

Here are some sample input images:

The training duration depends on the number of images used and the number of iterations set by the user. Below are some example results:

Additionally, the Flux Pro fine-tuned model supports inpainting for iterative editing of a given image. This technique combines subjects from input images for enhanced results.

Here’s a breakdown of the pricing for all Flux models on BFL’s API:

  • Flux 1.1 Pro Ultra: $0.06 per image
  • Flux 1.1 Pro: $0.04 per image
  • Flux 1.0 Pro: $0.05 per image
  • Flux 1.0 Dev: $0.025 per image

How to try Flux Pro Finetuning

The easiest and most straightforward way to try Flux Pro finetuning is on Fal AI. Look for the fal-ai/flux-pro-trainer model in the explore page and you should see the screen below.

In the Data URL, upload your set of input images, or upload a zip file containing the images. Optionally, modify the fine-tune comment and trigger word.

Add your portrait image as a training input. Leave other settings as default, and click the Start button.

Notice that the trigger word was changed to Jimportrait and the training steps are set to 300. You can push this value all the way to 1000 to get the best results, but it’s also gonna take a long time and is more costly.

When training completes, you’ll see a “completed” status and a fine-tune ID on the right-hand side of the screen.

To generate images from the trained model, click the Run Inference button. Use a sample prompt like this:

Prompt: Jimportrait in a modern office setting. He is wearing a well-fitted dark suit and a crisp white shirt, with a confident and approachable expression. The office features a sleek, minimalist design, with large windows letting in natural light, a desk with a laptop, and a few bookshelves in the background.

I don’t know what I am doing wrong here because the result is not even close to what I was expecting. I tried to play with the parameters and the settings, but I couldn’t get it to work properly.

In terms of cost, check out the following details:

  • Requests under 150 iterations cost $2.
  • Requests between 150 and 500 iterations cost $4.
  • Requests over 500 iterations cost $6.

You can also access the finetuning model via Fal’s API. Simply open the API tab and follow the instructions on how to integrate the API into your own app.

Here’s a sample NPM call:

import { fal } from "@fal-ai/client";const result = await fal.subscribe("fal-ai/flux-pro-trainer", { input: { data_url: "", finetune_comment: "test-1" }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } },});console.log(result.data);console.log(result.requestId);

Note: The generated images on Fal are commercial-free, so you can use the results for commercial purposes.

How to try Flux Pro Finetuning API

Okay, now if you are interested in using the APIs directly from Black Forest Labs, follow these steps.

To get started, add an API key to be able to get authorized when trying to access the image models.

The fine-tuning API reference can be found in this interactive documentation.

Here’s a sample POST request. Make sure to replace the YOUR_SECRET_TOKEN parameter with your own API key.

fetch('https://api.us1.bfl.ai/v1/finetune', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Key': 'YOUR_SECRET_TOKEN' }})
Take note of the parameters in the body section of the POST request.
{ "file_data": "", "finetune_comment": "my-first-finetune", "trigger_word": "TOK", "mode": "general", "iterations": 300, "learning_rate": 1, "captioning": true, "priority": "quality", "finetune_type": "full", "lora_rank": 32}

Let’s Talk About the Pricing

Black Forest Labs has kept the pricing simple so you can focus on your projects.

Here’s the pricing breakdown:

  • Under 150 iterations: Costs $2 for quick tests or small-scale experiments.
  • 150 to 500 iterations: Costs $4 for most projects where quality matters without going overboard.
  • Over 500 Iterations: Costs $6 for complex tasks that need more precision and detail.

You’ll also pay separately for generating images from the fine-tuned model.

While the older Flux Dev model allowed for fine-tuning and image generation at significantly lower rates, the jump in cost with Flux Pro reflects its increased capabilities. However, this might make it less accessible for users who are on a tight budget or those who were used to the affordability of Flux Dev.

Still, for those who value higher-quality outputs and the convenience of advanced fine-tuning features, Flux Pro might justify the added expense. It’s a trade-off between cost and capability.

Let’s Talk About the Upside and the Downside

BFL conducted a user study and found that 68.9% of respondents preferred the results from Flux Pro fine-tuning over other existing fine-tuning services.

Black Forest Labs has shared specific recommendations for different use cases. For character model training, they recommend using images with a single character. In style transfer tasks, increasing fine-tuning intensity often produces better results.

However, to those who don’t know it yet, Flux Pro is not open-weight. It means you can’t download the model from the internet and run it on your local machine. They only let you train a lora for Flux Pro via API.

What does this mean?

It means you need to pay for each training via BFL’s API.

It means you need to pay for each image generated from the fine-tuned model.

Final Thoughts

As a developer using AI to build web apps, this is big news for me. I launched Flux Labs AI four months ago, letting users create custom LoRAs with the Flux image model. While it’s been great, some users have pointed out that the generated images don’t always match the input examples.

I’m hopeful that upgrading to Flux Pro fine-tuning will make a big difference in fixing this issue and improving the quality of fine-tuned images. The idea of needing just 1–5 images for fine-tuning sounds like a game-changer.

On the downside, the cost of fine-tuning is higher now, and since Flux Pro isn’t open-weight, we’re limited to using BFL’s API for training and generating images. That means fewer custom LoRAs will likely be available, which is disappointing.

Even so, this is an exciting update. I’d love to see API access expand to platforms like Fal AI and Replicate, as they’re super easy to work with for developers. Hopefully, this is just the start of more improvements to come.

Share This Post:

Related Articles

Flux FIne-Tuning API
fluxfine-tuningapiflux apiflux fine tuning

Flux FIne-Tuning API...

Feb 07 2025
Flux 1.1 Pro is Now on Freepik
technologyartificial intelligencefluxflux labs ai

Flux 1.1 Pro is Now on Freepik...

Nov 16 2024
Flux.1 is a Mind-Blowing Open-Weights AI Image Generator with 12B Parameters
techologyartificial intelligenceflux

Flux.1 is a Mind-Blowing Open-Weights AI Ima...

Sep 09 2024