Instructions to use black-forest-labs/FLUX.2-klein-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use black-forest-labs/FLUX.2-klein-9B with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-9B", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Diffusion Single File
How to use black-forest-labs/FLUX.2-klein-9B with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Inference
- Notebooks
- Google Colab
- Kaggle
- AMD Developer Cloud
Requesting clarification regarding commercial use
The license of FLUX.2-klein-9B states that
You may use Output for any purpose (including for commercial purposes) [...]
It also states that
If you want to use a FLUX Model or a Derivative for any purpose that is not expressly authorized under this License, such as for a commercial activity, you must request a license from Company [...]
My question:
Is using the FLUX.2-klein-9B model in order to GENERATE Outputs - with the intention of using those Outputs for commercial purposes - considered a "commercial activity" as defined in the license?
Specifically, if I download the FLUX.2-klein-9B model and use the model locally on my machine in order to generate or edit images - with the intention of using those images for commercial purposes - do I need to purchase a commercial license in order to use the model?
I would like to get an official response from a Black Forest Labs representative, not just the personal opinions of members of the community.
Thank you.
There seems to be a genuine contradiction in a Flux Non-commercial 2.1 license. I too would very much want to hear from @ablattmann , @xl-sr or anyone else from BFL
Just to make this a bit clearer, I've run the text through LLM for clarity DISCLAIMER: not a real legal analysis
Reading 1: The Strict Reading
"Outputs are data produced by the model. Section 4(a) bans commercial use of data produced. Therefore, commercial use of outputs is banned."
Under this reading, the "including for commercial purposes" parenthetical in Section 2(d) is effectively dead text - overridden by Section 4(a) via the "except as expressly prohibited" clause.
Reading 2: The Harmonizing Reading
"Section 2(d) specifically addresses outputs and specifically permits commercial use. Section 4(a) is a general restrictions clause aimed at model deployment, reverse engineering, and misuse. 'Data produced' refers to technical byproducts - logits, attention maps, intermediate weights - not the final images a user creates from a prompt."
Under this reading, both sections survive: you can sell images, but you can't sell internal model data or host it without buying commercial license.
Even if Reading 2 wins and we can sell the images, there's a second problem.
The license grants rights to use the model only for "Non-Commercial Purposes." That definition explicitly excludes:
- Revenue-generating activity
- Anything connected to commercial activities, business operations, or employment responsibilities
So the contradiction runs deeper than outputs vs. data. It's this:
- Selling the image: Allowed (Section 2(d)).
- Running the model to create that image as part of paid work: Arguably not allowed (Section 1(c) + 2(b)). You own the fruit, but you may be trespassing in the orchard to pick it.
@arifqai can you elaborate on what you are referring to?
The only relevant part I can see on that page is this quote from FAQ section
Can I use outputs commercially with a Commercial Weights License?
Yes, with a few caveats. Our license allows you to use model outputs commercially, and we make no ownership claim over those outputs. However, we do not make representations or warranties with respect to the content of those outputs. It remains your responsibility to determine whether the outputs are appropriate for commercial use in your specific context.
But that us just FAQ section on the website referring to commercial license not the one that is posted here
The HF repo where these weights are located still points to Flux Non-Commercial license 2.1 with ambiguous wording
@arifqai can you elaborate on what you are referring to?
Quote from "Who is the FLUX Commercial Weights License for?" block:
If you're generating images for products you charge for, creating assets for clients, or incorporating model weights into software you distribute, you need a commercial license.
Looks like @arifqai is correct (emphasis mine):
This includes developers and startups building image generation into their products, agencies producing assets for clients, media and content companies, and enterprises that need full deployment control and commercial protection.
For me that encompasses illustrators, concept artists etc. I already operated under that assumption - after all, the license is called Non-Commercial License - but it's nice to finally have a confirmation.