Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
fce87b3
add vae
yiyixuxu Nov 13, 2025
a1f2ba1
Initial commit for Flux 2 Transformer implementation
dg845 Nov 14, 2025
e470643
add pipeline part
yiyixuxu Nov 14, 2025
7456a49
small edits to the pipeline and conversion
sayakpaul Nov 14, 2025
f340599
Merge pull request #3 from huggingface/flux2-small-edits
yiyixuxu Nov 14, 2025
b10e629
update conversion script
yiyixuxu Nov 14, 2025
7382358
fix
yiyixuxu Nov 14, 2025
78ea69d
Merge branch 'flux2' of github.com:huggingface/diffusers-new-model-ad…
yiyixuxu Nov 14, 2025
524b123
up up
yiyixuxu Nov 14, 2025
8a48adc
finish pipeline
yiyixuxu Nov 15, 2025
429d2cf
Remove Flux IP Adapter logic for now
dg845 Nov 15, 2025
2d7bad7
Remove deprecated 3D id logic
dg845 Nov 15, 2025
c67f582
Remove ControlNet logic for now
dg845 Nov 15, 2025
7acd7da
Add link to ViT-22B paper as reference for parallel transformer block…
dg845 Nov 15, 2025
6604086
update pipeline
Nov 15, 2025
a200780
Don't use biases for input projs and output AdaNorm
dg845 Nov 15, 2025
f7148a0
up
Nov 15, 2025
54c6080
Remove bias for double stream block text QKV projections
dg845 Nov 15, 2025
dba4c1f
Add script to convert Flux 2 transformer to diffusers
dg845 Nov 15, 2025
cceffc4
make style and make quality
dg845 Nov 15, 2025
e93a746
fix a few things.
sayakpaul Nov 15, 2025
cfdd005
allow sft files to go.
sayakpaul Nov 15, 2025
edacb52
Merge pull request #4 from huggingface/flux2-model-cpu
yiyixuxu Nov 15, 2025
1483980
fix image processor
Nov 15, 2025
62231ef
fix batch
Nov 16, 2025
68db178
style a bit
Nov 16, 2025
89e42d9
Merge pull request #5 from huggingface/small-flux2-transformer-fix
dg845 Nov 17, 2025
f6c82a3
Fix some bugs in Flux 2 transformer implementation
dg845 Nov 17, 2025
4082c43
Fix dummy input preparation and fix some test bugs
dg845 Nov 17, 2025
2b5b2e3
fix dtype casting in timestep guidance module.
sayakpaul Nov 17, 2025
247770f
Merge pull request #6 from huggingface/fix-dtype
dg845 Nov 17, 2025
3d022b8
resolve conflicts.,
sayakpaul Nov 17, 2025
ffb0061
remove ip adapter stuff.
sayakpaul Nov 17, 2025
6820d6c
Fix Flux 2 transformer consistency test
dg845 Nov 17, 2025
f6059b7
Fix bug in Flux2TransformerBlock (double stream block)
dg845 Nov 17, 2025
5a108f0
merge
sayakpaul Nov 17, 2025
05fcddb
Get remaining Flux 2 transformer tests passing
dg845 Nov 17, 2025
ac4f61a
make style; make quality; make fix-copies
dg845 Nov 17, 2025
20f9b83
remove stuff.
sayakpaul Nov 17, 2025
e8d71ab
Merge branch 'flux2-transformer' into full-flux2
sayakpaul Nov 17, 2025
546e60d
fix type annotaton.
sayakpaul Nov 17, 2025
eeb52c2
remove unneeded stuff from tests
sayakpaul Nov 17, 2025
771e17b
tests
sayakpaul Nov 17, 2025
28da679
up
sayakpaul Nov 17, 2025
14f9866
up
sayakpaul Nov 17, 2025
6d16975
add sf support
DN6 Nov 17, 2025
be6604b
Remove unused IP Adapter and ControlNet logic from transformer (#9)
dg845 Nov 18, 2025
ec0a2ad
copied from
sayakpaul Nov 18, 2025
980bcc8
Apply suggestions from code review
sayakpaul Nov 18, 2025
e1d46ce
up
sayakpaul Nov 18, 2025
de99344
up
sayakpaul Nov 18, 2025
739c31b
up
sayakpaul Nov 18, 2025
ded81a9
up
sayakpaul Nov 18, 2025
c0086ea
up
sayakpaul Nov 18, 2025
4f1f67a
Refactor Flux2Attention into separate classes for double stream and s…
dg845 Nov 18, 2025
b8e3760
Add _supports_qkv_fusion to AttentionModuleMixin to allow subclasses …
dg845 Nov 19, 2025
24159ac
Have Flux2ParallelSelfAttention inherit from AttentionModuleMixin wit…
dg845 Nov 19, 2025
cb21400
Log debug message when calling fuse_projections on a AttentionModuleM…
dg845 Nov 19, 2025
ba52a59
Address review comments
dg845 Nov 19, 2025
cc74755
Merge pull request #11 from huggingface/fix-fused-projections
dg845 Nov 19, 2025
697a43c
Update src/diffusers/pipelines/flux2/pipeline_flux2.py
sayakpaul Nov 19, 2025
aba48dd
up
sayakpaul Nov 19, 2025
963ed57
Remove maybe_allow_in_graph decorators for Flux 2 transformer blocks …
dg845 Nov 19, 2025
997dfc2
up
sayakpaul Nov 19, 2025
842a849
Merge branch 'main' into full-flux2
sayakpaul Nov 20, 2025
8d8bb3d
support ostris loras. (#13)
sayakpaul Nov 20, 2025
454cef8
up
sayakpaul Nov 24, 2025
6bf955a
Merge branch 'main' into full-flux2
sayakpaul Nov 24, 2025
fc1bd89
update schdule
Nov 25, 2025
29b02b8
up
sayakpaul Nov 25, 2025
24ff10e
Merge pull request #15 from huggingface/final-update
yiyixuxu Nov 25, 2025
4ef0285
Merge pull request #14 from huggingface/transformer-single-file-support
DN6 Nov 25, 2025
823f4c3
up (#17)
sayakpaul Nov 25, 2025
5419877
add training scripts (#16)
sayakpaul Nov 25, 2025
0a5a477
up
sayakpaul Nov 25, 2025
cb9f124
Merge branch 'main' into full-flux2
sayakpaul Nov 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/source/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@
title: DiTTransformer2DModel
- local: api/models/easyanimate_transformer3d
title: EasyAnimateTransformer3DModel
- local: api/models/flux2_transformer
title: Flux2Transformer2DModel
- local: api/models/flux_transformer
title: FluxTransformer2DModel
- local: api/models/hidream_image_transformer
Expand Down Expand Up @@ -525,6 +527,8 @@
title: EasyAnimate
- local: api/pipelines/flux
title: Flux
- local: api/pipelines/flux2
title: Flux2
- local: api/pipelines/control_flux_inpaint
title: FluxControlInpaint
- local: api/pipelines/hidream
Expand Down
7 changes: 6 additions & 1 deletion docs/source/en/api/loaders/lora.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ LoRA is a fast and lightweight training method that inserts and trains a signifi
- [`CogView4LoraLoaderMixin`] provides similar functions for [CogView4](https://huggingface.co/docs/diffusers/main/en/api/pipelines/cogview4).
- [`AmusedLoraLoaderMixin`] is for the [`AmusedPipeline`].
- [`HiDreamImageLoraLoaderMixin`] provides similar functions for [HiDream Image](https://huggingface.co/docs/diffusers/main/en/api/pipelines/hidream)
- [`QwenImageLoraLoaderMixin`] provides similar functions for [Qwen Image](https://huggingface.co/docs/diffusers/main/en/api/pipelines/qwen)
- [`QwenImageLoraLoaderMixin`] provides similar functions for [Qwen Image](https://huggingface.co/docs/diffusers/main/en/api/pipelines/qwen).
- [`Flux2LoraLoaderMixin`] provides similar functions for [Flux2](https://huggingface.co/docs/diffusers/main/en/api/pipelines/flux2).
- [`LoraBaseMixin`] provides a base class with several utility methods to fuse, unfuse, unload, LoRAs and more.

> [!TIP]
Expand All @@ -56,6 +57,10 @@ LoRA is a fast and lightweight training method that inserts and trains a signifi

[[autodoc]] loaders.lora_pipeline.FluxLoraLoaderMixin

## Flux2LoraLoaderMixin

[[autodoc]] loaders.lora_pipeline.Flux2LoraLoaderMixin

## CogVideoXLoraLoaderMixin

[[autodoc]] loaders.lora_pipeline.CogVideoXLoraLoaderMixin
Expand Down
19 changes: 19 additions & 0 deletions docs/source/en/api/models/flux2_transformer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Flux2Transformer2DModel

A Transformer model for image-like data from [Flux2](https://hf.co/black-forest-labs/FLUX.2-dev).

## Flux2Transformer2DModel

[[autodoc]] Flux2Transformer2DModel
33 changes: 33 additions & 0 deletions docs/source/en/api/pipelines/flux2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Flux2

<div class="flex flex-wrap space-x-1">
<img alt="LoRA" src="https://img.shields.io/badge/LoRA-d8b4fe?style=flat"/>
<img alt="MPS" src="https://img.shields.io/badge/MPS-000000?style=flat&logo=apple&logoColor=white%22">
</div>

Flux.2 is the recent series of image generation models from Black Forest Labs, preceded by the [Flux.1](./flux.md) series. It is an entirely new model with a new architecture and pre-training done from scratch!

Original model checkpoints for Flux can be found [here](https://huggingface.co/black-forest-labs). Original inference code can be found [here](https://github.com/black-forest-labs/flux2-dev).

> [!TIP]
> Flux2 can be quite expensive to run on consumer hardware devices. However, you can perform a suite of optimizations to run it faster and in a more memory-friendly manner. Check out [this section](https://huggingface.co/blog/sd3#memory-optimizations-for-sd3) for more details. Additionally, Flux can benefit from quantization for memory efficiency with a trade-off in inference latency. Refer to [this blog post](https://huggingface.co/blog/quanto-diffusers) to learn more.
>
> [Caching](../../optimization/cache) may also speed up inference by storing and reusing intermediate outputs.

## Flux2Pipeline

[[autodoc]] Flux2Pipeline
- all
- __call__
Loading
Loading