Image-to-Image
Diffusers
Safetensors
Diffusion Single File
English
Flux2KleinPipeline
text-to-image
image-editing
flux
Instructions to use black-forest-labs/FLUX.2-klein-4B 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-4B 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-4B", 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-4B 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
Link model to paper and add library metadata
Browse filesThis PR improves the model card by:
1. Adding `library_name: diffusers` to the metadata, which enables the "Use in Diffusers" button and code snippets.
2. Linking the model to the research paper: ["A Hybrid Approach for Closing the Sim2real Appearance Gap in Game Engine Synthetic Datasets"](https://huggingface.co/papers/2605.02291).
3. Adding a link to the official [GitHub repository](https://github.com/stefanos50/Hybrid-Sim2Real) for the hybrid approach investigated in the paper.
4. Adding the BibTeX citation for the paper.
README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
language:
|
| 4 |
- en
|
|
|
|
| 5 |
pipeline_tag: image-to-image
|
|
|
|
| 6 |
tags:
|
| 7 |
- text-to-image
|
| 8 |
- image-editing
|
|
@@ -16,6 +17,8 @@ tags:
|
|
| 16 |
|
| 17 |
The FLUX.2 [klein] model family are our fastest image models to date. FLUX.2 [klein] unifies generation and editing in a single compact architecture, **delivering state-of-the-art quality with end-to-end inference in as low as under a second**. Built for applications that require real-time image generation without sacrificing quality, and runs on consumer hardware, with as little as 13GB VRAM.
|
| 18 |
|
|
|
|
|
|
|
| 19 |
FLUX.2 [klein] 4B is a 4 billion parameter rectified flow transformer capable of generating images from text descriptions and supports multi-reference editing capabilities.
|
| 20 |
|
| 21 |
Fully open under Apache 2.0. Our most accessible model runs on consumer GPUs like the RTX 3090/4070. Compact but capable: supports text-to-image, image editing, and multi-reference at quality that punches above its size. Built for local development, edge deployment, and production use.
|
|
@@ -73,9 +76,8 @@ image = pipe(
|
|
| 73 |
image.save("flux-klein.png")
|
| 74 |
```
|
| 75 |
|
| 76 |
-
|
| 77 |
---
|
| 78 |
-
Limitations
|
| 79 |
|
| 80 |
- This model is not intended or able to provide factual information.
|
| 81 |
- While the model can output text, text rendered may be inaccurate or subject to distortion.
|
|
@@ -83,7 +85,7 @@ Limitations
|
|
| 83 |
- The model may fail to generate output that matches the prompts.
|
| 84 |
- Prompt following is heavily influenced by the prompting style.
|
| 85 |
|
| 86 |
-
Out-of-Scope Use
|
| 87 |
|
| 88 |
The model and its derivatives may not be used:
|
| 89 |
|
|
@@ -97,12 +99,12 @@ The model and its derivatives may not be used:
|
|
| 97 |
|
| 98 |
Nothing contained in this Model Card should be interpreted as or deemed a restriction or modification to the license the model is released under.
|
| 99 |
|
| 100 |
-
Hardware
|
| 101 |
|
| 102 |
The FLUX.2 [klein] 4B model fits in ~13GB VRAM and is accessible on NVIDIA RTX 3090/4070 and above.
|
| 103 |
|
| 104 |
---
|
| 105 |
-
Responsible AI Development
|
| 106 |
|
| 107 |
Black Forest Labs is committed to the responsible development and deployment of our models. Prior to releasing the FLUX.2 family of models, we evaluated and mitigated a number of risks in our model checkpoints and hosted services, including the generation of unlawful content, including child sexual abuse material (CSAM) and nonconsensual intimate imagery (NCII). We implemented a series of pre-release mitigations to help prevent misuse by third parties, with additional post-release mitigations to help address residual risks:
|
| 108 |
|
|
@@ -116,10 +118,24 @@ Black Forest Labs is committed to the responsible development and deployment of
|
|
| 116 |
8. Safety. Black Forest Labs takes model safety seriously. We provide a dedicated email address (safety@blackforestlabs.ai) to solicit feedback from the community. We maintain a reporting relationship with organizations such as the https://www.iwf.org.uk/ and the https://www.missingkids.org/, and welcome ongoing engagement with authorities, developers, and researchers to share intelligence about emerging risks and develop effective mitigations.
|
| 117 |
|
| 118 |
---
|
| 119 |
-
License
|
| 120 |
|
| 121 |
-
This model is licensed under the
|
| 122 |
|
| 123 |
-
Trademarks & IP
|
| 124 |
|
| 125 |
This project may contain trademarks or logos for projects, products, or services. Use of Black Forest Labs and FLUX trademarks or logos in modified versions of this project must not cause confusion or imply sponsorship or endorsement. Any use of third-party trademarks, intellectual property or logos are subject to those third-party's policies.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
pipeline_tag: image-to-image
|
| 6 |
+
library_name: diffusers
|
| 7 |
tags:
|
| 8 |
- text-to-image
|
| 9 |
- image-editing
|
|
|
|
| 17 |
|
| 18 |
The FLUX.2 [klein] model family are our fastest image models to date. FLUX.2 [klein] unifies generation and editing in a single compact architecture, **delivering state-of-the-art quality with end-to-end inference in as low as under a second**. Built for applications that require real-time image generation without sacrificing quality, and runs on consumer hardware, with as little as 13GB VRAM.
|
| 19 |
|
| 20 |
+
This model was evaluated in the paper [A Hybrid Approach for Closing the Sim2real Appearance Gap in Game Engine Synthetic Datasets](https://huggingface.co/papers/2605.02291). The associated code for the hybrid sim2real approach can be found at [stefanos50/Hybrid-Sim2Real](https://github.com/stefanos50/Hybrid-Sim2Real).
|
| 21 |
+
|
| 22 |
FLUX.2 [klein] 4B is a 4 billion parameter rectified flow transformer capable of generating images from text descriptions and supports multi-reference editing capabilities.
|
| 23 |
|
| 24 |
Fully open under Apache 2.0. Our most accessible model runs on consumer GPUs like the RTX 3090/4070. Compact but capable: supports text-to-image, image editing, and multi-reference at quality that punches above its size. Built for local development, edge deployment, and production use.
|
|
|
|
| 76 |
image.save("flux-klein.png")
|
| 77 |
```
|
| 78 |
|
|
|
|
| 79 |
---
|
| 80 |
+
# Limitations
|
| 81 |
|
| 82 |
- This model is not intended or able to provide factual information.
|
| 83 |
- While the model can output text, text rendered may be inaccurate or subject to distortion.
|
|
|
|
| 85 |
- The model may fail to generate output that matches the prompts.
|
| 86 |
- Prompt following is heavily influenced by the prompting style.
|
| 87 |
|
| 88 |
+
# Out-of-Scope Use
|
| 89 |
|
| 90 |
The model and its derivatives may not be used:
|
| 91 |
|
|
|
|
| 99 |
|
| 100 |
Nothing contained in this Model Card should be interpreted as or deemed a restriction or modification to the license the model is released under.
|
| 101 |
|
| 102 |
+
# Hardware
|
| 103 |
|
| 104 |
The FLUX.2 [klein] 4B model fits in ~13GB VRAM and is accessible on NVIDIA RTX 3090/4070 and above.
|
| 105 |
|
| 106 |
---
|
| 107 |
+
# Responsible AI Development
|
| 108 |
|
| 109 |
Black Forest Labs is committed to the responsible development and deployment of our models. Prior to releasing the FLUX.2 family of models, we evaluated and mitigated a number of risks in our model checkpoints and hosted services, including the generation of unlawful content, including child sexual abuse material (CSAM) and nonconsensual intimate imagery (NCII). We implemented a series of pre-release mitigations to help prevent misuse by third parties, with additional post-release mitigations to help address residual risks:
|
| 110 |
|
|
|
|
| 118 |
8. Safety. Black Forest Labs takes model safety seriously. We provide a dedicated email address (safety@blackforestlabs.ai) to solicit feedback from the community. We maintain a reporting relationship with organizations such as the https://www.iwf.org.uk/ and the https://www.missingkids.org/, and welcome ongoing engagement with authorities, developers, and researchers to share intelligence about emerging risks and develop effective mitigations.
|
| 119 |
|
| 120 |
---
|
| 121 |
+
# License
|
| 122 |
|
| 123 |
+
This model is licensed under the Apache 2.0 License.
|
| 124 |
|
| 125 |
+
# Trademarks & IP
|
| 126 |
|
| 127 |
This project may contain trademarks or logos for projects, products, or services. Use of Black Forest Labs and FLUX trademarks or logos in modified versions of this project must not cause confusion or imply sponsorship or endorsement. Any use of third-party trademarks, intellectual property or logos are subject to those third-party's policies.
|
| 128 |
+
|
| 129 |
+
# Citation
|
| 130 |
+
|
| 131 |
+
```bibtex
|
| 132 |
+
@misc{pasios2026hybridapproachclosingsim2real,
|
| 133 |
+
title={A Hybrid Approach for Closing the Sim2real Appearance Gap in Game Engine Synthetic Datasets},
|
| 134 |
+
author={Stefanos Pasios},
|
| 135 |
+
year={2026},
|
| 136 |
+
eprint={2605.02291},
|
| 137 |
+
archivePrefix={arXiv},
|
| 138 |
+
primaryClass={cs.CV},
|
| 139 |
+
url={https://arxiv.org/abs/2605.02291},
|
| 140 |
+
}
|
| 141 |
+
```
|