analiza aiqbench
This article is about a new AI image generation model, FLUX.3 Image Klein, and its availability in Hugging Face Diffusers, so it passes the topic gate. Among the AI categories, it best fits AI Products: it covers a released model, its checkpoints, quantized weights, training scripts, and how to use it. The most notable technical addition is bounding-box layout control, which lets users specify where elements go in a generated or edited image. Readers should note that the performance claims (such as roughly 2 seconds per 1024×1024 image on an H100) are vendor-reported and not independently verified.
Welcome FLUX.3 Image Klein in Diffusers
Black Forest Labs FLUX.3 Image Klein is here, and it runs in Diffusers from day one. One model does text-to-image and multi-reference image-to-image, and it adds something new, the layout control. You write bounding boxes into the prompt to say where each part of the image should go, or which parts of a reference image to move.
Both open checkpoints are in the FLUX.3 Image Klein collection:
You can head on to the Hugging Face space and generate some images right now!
One model for text-to-image, multi-reference image-to-image, and bounding-box layout control.
The distilled checkpoint makes a 1024 × 1024 image in about 2 seconds on an H100.
NVFP4 and FP8 weights load with from_single_file, for smaller GPUs.
LoRA training scripts for both text-to-image and image editing.
Ships as a Modular Diffusers pipeline, so you can pop blocks out or add your own.
What FLUX.3 can do
What FLUX.3 can do
FLUX.3 responds best to a full scene description with the subject, the setting, the light, the composition, and the style. The official prompting guide from Black Forest Labs has more tips. The distilled checkpoint generates a 1024 × 1024 image in 16 steps by default. Pass height, width, or num_inference_steps to change them.
Pass a reference image (or more) with the image argument. Write the prompt as a caption of the image you want, with the change included.
With several references, refer to them in the prompt as <ref_image_0>, <ref_image_1>, ... in the order they are passed to image:
Add a JSON list of regions after the caption. Each region has an id, a bbox, and a desc, and the caption mentions it as <id>.
Boxes are written as [y_min, x_min, y_max, x_max], y first, on a 0–1000 scale. Because the scale is normalized, the same box works at any image size.
Boxes are written as [y_min, x_min, y_max, x_max], y first, on a 0–1000 scale. Because the scale is normalized, the same box works at any image size.
For edits, each region says where its content comes from (src_bbox in the reference) and where it goes (tgt_bbox in the output). A region with the same two boxes stays where it is.
Everything above uses the distilled checkpoint. The base checkpoint runs 50 steps with classifier-free guidance, and it's the one to fine-tune (see LoRA finetuning).
Black Forest Labs also ships the transformer as a single file, in bf16 and in two quantized formats: fp8r (rowwise FP8) and nvfp4. Load any of them with from_single_file, then load the other components by name so the bf16 transformer isn't downloaded too.
For the unquantized single file, use https://huggingface.co/{model_id}/blob/main/model.safetensors and drop quantization_config.
Compute capability 8.9+ (Ada, Hopper, Blackwell)
FLUX.3 works for both text-to-image and image-to-image, which makes it a great base for custom LoRAs. diffusers ships DreamBooth LoRA training scripts for both tasks (you can also train with Ostris' AI Toolkit).
To reduce memory usage, add a few optimization flags: --gradient_checkpointing \ --cache_latents \ --use_8bit_adam --gradient_checkpointing recomputes activations in the backward pass (lower VRAM, slightly slower), --cache_latents pre-encodes the images and frees the VAE, and --use_8bit_adam keeps the optimizer states in 8-bit.
--gradient_checkpointing recomputes activations in the backward pass (lower VRAM, slightly slower), --cache_latents pre-encodes the images and frees the VAE, and --use_8bit_adam keeps the optimizer states in 8-bit.
A couple of knobs are worth experimenting with. The grid below trains the same tarot style with different LoRA ranks and optimizers; the adapters are on the Hub at diffusers-modular/flux3-tarot-lora. More training features and configurations are documented in the DreamBooth FLUX.3 README.
For instruction-based editing, the image-to-image script (train_dreambooth_lora_flux3_klein_img2img.py) trains on (reference image, target image, instruction) triplets, where the reference is addressed in the prompt as <ref_image_0>.
See the DreamBooth FLUX.3 README for all options and the full image-to-image example.
In this section, we will talk about the memory consumption and the speed of generation of the models.
Load a quantized transformer.
Run the text encoder separately and free it. It only runs once per image, before denoising (see Encode once, generate many).
Single NVIDIA H100 80GB, no offloading, default attention backend.
Single NVIDIA H100 80GB, no offloading, default attention backend.
A reference image roughly doubles the time. Reference tokens join the same sequence as the text and the image being generated, so a 1024 × 1024 reference adds 4,096 tokens to every transformer call
Let's open the model up, one piece at a time. The model takes three kinds of tokens:
FLUX.3 is a latent-space flow model for image generation. This means that the denoiser takes latents as inputs and produces latents as outputs. We use a VAE to decode the latents back to pixels. FLUX.3 uses the same VAE architecture as Flux.2.
The FLUX.2 VAE compresses an image 8× in each direction into 32 channels, and then every 2 × 2 patch of that latent is packed into a single token with 128 channels.
So one token covers a 16 × 16 pixel patch, and a 1024 × 1024 image becomes a 64 × 64 grid of 4,096 tokens. The noisy image starts as random noise of exactly that shape. A reference image goes through the same VAE encoder and packing, and keeps its own size.
The text encoder is Qwen3-VL, a vision-language model. FLUX.3 doesn't just take its last layer. It reads the hidden states of eight of its 36 layers (layers 4, 8, …, 32) and stacks them, so each text token becomes a 8 × 2560 = 20,480-dimensional vector before a linear layer projects it to the transformer's width of 3072.
This gives the transformer features from several depths of the language model, not just its final layer. The prompt is padded to a multiple of 80 tokens, and the transformer attends to the padding too, which is why the pipeline takes one prompt per call.
Stage 1: per-mode blocks. Each stream goes through 5 blocks with its own weights. Text has its own blocks, the noisy image has its own, and the reference images have their own.
Stage 2: joint blocks. The streams are concatenated into one sequence, [text | image | reference], which goes through 28 blocks that share one set of weights.
The two stages differ in who can attend to whom.
In stage 1, each stream only attends to itself, so each kind of token gets refined on its own terms first. In stage 2, everything attends to everything, where the image learns from the text and from the references. For comparison, FLUX.2's double-stream blocks also give text and image separate weights, but let them attend to each other from the start. FLUX.3 keeps the streams fully apart first, then merges them.
At the end, the text and reference tokens are simply dropped. Only the image tokens go through the output layers, which predict how to move them one step toward a clean image.
Every block, in either stage, has the same shape. Attention and the MLP run in parallel on the same normalized input, and their sum is added back to the residual stream.
Each block starts with a LayerNorm that has no learned scale or shift of its own. The scale, shift, and gate come from a timestep embedding instead (this is called modulation). Inside the attention, the queries and keys are RMS-normalized and get rotary position embeddings (RoPE), which we look at below.
In a joint block, all tokens share the same weights, but text, image, and reference tokens each get their own scale, shift, and gate.
In FLUX.1 and FLUX.2, one timestep embedding modulates every token. In FLUX.3, the modulation depends on the kind of token.
The noisy image tokens are modulated by the current timestep t. The text and reference tokens are always modulated by timestep 0, which means "clean, nothing to denoise here". So even a reference that looks almost the same as the output is marked as given context, not as something to generate.
The distilled checkpoint is a flow map. It is also told the timestep each step jumps to. That second timestep gets its own embedding, which is added to every token's modulation, so each of its 16 steps can make a larger jump.
Attention on its own doesn't know where a token is (this phenomenon is called permutation equivariance). RoPE fixes that by rotating each query and key by an amount that depends on the token's position. FLUX.3 uses four position axes, (t, h, w, l) (timestep, height, width, length of sequence), and gives each one a quarter (32 dimensions) of every 128-dimensional attention head:
Text tokens line up along l, like words in a sentence. The image and the references are 2D grids in (h, w), separated from each other along l. Because a reference uses the same (h, w) coordinates as the output, "the same spot in the reference" has a precise meaning to the model, which is what the src_bbox / tgt_bbox editing relies on.
FLUX.3 is a flow-matching model. Generation starts from pure noise, and at each of the 50 steps the transformer predicts a velocity. This is the direction from noise toward a clean image. The scheduler takes one step along it.
At every step you can also read off the model's current guess of the final image. Decoding that guess at a few steps shows how the image takes shape:
The fox, its pose, and the light are already in place by step 10, while the noise level is still 0.97. The snow-laden branches and the texture of the fur only appear in the last few steps. FLUX.3's scheduler uses a large time shift (6.93), which keeps the noise level high for most of the run: 44 of the 50 steps happen above σ = 0.5. We built this figure by adding one small block to the pipeline, which brings us to Modular Diffusers.
If you are new to flow matching, we have a beginner friendly tutorial and a video for you to understand how it works.
If you are new to flow matching, we have a beginner friendly tutorial and a video for you to understand how it works.
FLUX.3 ships as a Modular Diffusers pipeline.
You can list the workflows and print the exact blocks of each one, without loading any weights.
get_workflow() resolves the auto branches and gives you the plain sequence of steps that will run. print(blocks.get_workflow("image_conditioned").doc) prints the components, inputs, defaults, and outputs of that workflow.
Pop the text encoder out, encode the prompt once, free it, and generate from the cached embeddings.
Models: FLUX.3 Image Klein collection
Docs: FLUX.3 in Diffusers
Built something with FLUX.3? Share your LoRAs and pipelines on the Hub. We'd love to see them! 😎
Text integral sub licența deschisă a publicației · 1777 cuvinte
Subiecte conexe

[AINews] Agents disprove Polysemanticity; greatly improve Interpretability & Alignment
Latent Space · 16 oct. 2026
[AINews] High Taste Testers Ep. 1
Latent Space · 17 oct. 2026
Bringing Nunchaku 4-bit Diffusion Inference to Diffusers
Hugging Face · 23 iul. 2026

Fine-tune video and image models at scale with NVIDIA NeMo Automodel and 🤗 Diffusers
Hugging Face · 17 iul. 2026