Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2d22e4c
Add Flux2KleinInpaintPipeline
adi776borate Jan 26, 2026
d213e59
Fixed mask channel mismatch and a bit of cleaning
adi776borate Jan 26, 2026
738ac43
Added tests and minor refactors
adi776borate Jan 27, 2026
6fd76dd
Added support for reference images for inpainting
adi776borate Jan 28, 2026
2516f06
Style fixes
adi776borate Jan 28, 2026
c44b69a
Fixed the example docstring
adi776borate Jan 28, 2026
9502d77
Corrected mask latent preparation for correct dimensional alignment
adi776borate Jan 29, 2026
f85ee3b
replace masked_image_latents context with clean_source_latents, fix m…
adi776borate Mar 14, 2026
b6262b0
Merge branch 'main' into feature/flux2-klein-inpaint
adi776borate Mar 14, 2026
9ffef8f
Fix T-coordinate collision for conditioning
adi776borate Mar 15, 2026
c5865a0
Merge branch 'feature/flux2-klein-inpaint' of https://github.com/adi7…
adi776borate Mar 15, 2026
766072f
Merge branch 'main' into feature/flux2-klein-inpaint
adi776borate Mar 15, 2026
b202267
Changed the default strength from 0.6 to 0.8
adi776borate Mar 15, 2026
ca52e06
Merge branch 'feature/flux2-klein-inpaint' of https://github.com/adi7…
adi776borate Mar 15, 2026
d75204c
Added reference image test and updated the frozenset
adi776borate Mar 15, 2026
bcfba17
Validated ref image, latent passing support and fixed ref image prepr…
adi776borate Mar 17, 2026
b8aaa19
Refined preprocessing with 1MP resolution cap and timestep tracking
adi776borate Mar 20, 2026
edcbaba
Updated typing, improved validation and changed the example docstring
adi776borate Mar 21, 2026
5e4f20e
Style fixes
adi776borate Mar 21, 2026
60e1ed2
Fixed batch inference discrepancy and addressed review comments
adi776borate Mar 26, 2026
a026f0f
Fixed a typo
adi776borate Mar 26, 2026
e8f590b
Apply suggestion from @asomoza
adi776borate Apr 1, 2026
2d83f13
Reused encoded latents and fix channel check consistency
adi776borate Apr 1, 2026
41d8a98
fixed pre-encoded latent preprocessing for source and ref images
adi776borate Apr 9, 2026
eac2a72
Apply style fixes
github-actions[bot] Apr 9, 2026
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
2 changes: 2 additions & 0 deletions src/diffusers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@
"EasyAnimateControlPipeline",
"EasyAnimateInpaintPipeline",
"EasyAnimatePipeline",
"Flux2KleinInpaintPipeline",
"Flux2KleinKVPipeline",
"Flux2KleinPipeline",
"Flux2Pipeline",
Expand Down Expand Up @@ -1267,6 +1268,7 @@
EasyAnimateControlPipeline,
EasyAnimateInpaintPipeline,
EasyAnimatePipeline,
Flux2KleinInpaintPipeline,
Flux2KleinKVPipeline,
Flux2KleinPipeline,
Flux2Pipeline,
Expand Down
9 changes: 7 additions & 2 deletions src/diffusers/pipelines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@
]
_import_structure["bria"] = ["BriaPipeline"]
_import_structure["bria_fibo"] = ["BriaFiboPipeline", "BriaFiboEditPipeline"]
_import_structure["flux2"] = ["Flux2Pipeline", "Flux2KleinPipeline", "Flux2KleinKVPipeline"]
_import_structure["flux2"] = [
"Flux2Pipeline",
"Flux2KleinPipeline",
"Flux2KleinInpaintPipeline",
"Flux2KleinKVPipeline",
]
_import_structure["flux"] = [
"FluxControlPipeline",
"FluxControlInpaintPipeline",
Expand Down Expand Up @@ -671,7 +676,7 @@
FluxPriorReduxPipeline,
ReduxImageEncoder,
)
from .flux2 import Flux2KleinKVPipeline, Flux2KleinPipeline, Flux2Pipeline
from .flux2 import Flux2KleinInpaintPipeline, Flux2KleinKVPipeline, Flux2KleinPipeline, Flux2Pipeline
from .glm_image import GlmImagePipeline
from .helios import HeliosPipeline, HeliosPyramidPipeline
from .hidream_image import HiDreamImagePipeline
Expand Down
2 changes: 2 additions & 0 deletions src/diffusers/pipelines/flux2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
else:
_import_structure["pipeline_flux2"] = ["Flux2Pipeline"]
_import_structure["pipeline_flux2_klein"] = ["Flux2KleinPipeline"]
_import_structure["pipeline_flux2_klein_inpaint"] = ["Flux2KleinInpaintPipeline"]
_import_structure["pipeline_flux2_klein_kv"] = ["Flux2KleinKVPipeline"]
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
try:
Expand All @@ -34,6 +35,7 @@
else:
from .pipeline_flux2 import Flux2Pipeline
from .pipeline_flux2_klein import Flux2KleinPipeline
from .pipeline_flux2_klein_inpaint import Flux2KleinInpaintPipeline
from .pipeline_flux2_klein_kv import Flux2KleinKVPipeline
else:
import sys
Expand Down
8 changes: 8 additions & 0 deletions src/diffusers/pipelines/flux2/image_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ class Flux2ImageProcessor(VaeImageProcessor):
VAE latent channels.
do_normalize (`bool`, *optional*, defaults to `True`):
Whether to normalize the image to [-1,1].
do_binarize (`bool`, *optional*, defaults to `False`):
Whether to binarize the image to 0/1.
do_convert_rgb (`bool`, *optional*, defaults to be `True`):
Whether to convert the images to RGB format.
do_convert_grayscale (`bool`, *optional*, defaults to be `False`):
Whether to convert the images to grayscale format.
"""

@register_to_config
Expand All @@ -46,14 +50,18 @@ def __init__(
vae_scale_factor: int = 16,
vae_latent_channels: int = 32,
do_normalize: bool = True,
do_binarize: bool = False,
do_convert_rgb: bool = True,
do_convert_grayscale: bool = False,
):
super().__init__(
do_resize=do_resize,
vae_scale_factor=vae_scale_factor,
vae_latent_channels=vae_latent_channels,
do_normalize=do_normalize,
do_binarize=do_binarize,
do_convert_rgb=do_convert_rgb,
do_convert_grayscale=do_convert_grayscale,
)

@staticmethod
Expand Down
Loading
Loading