Commit Graph

6249 Commits

Author SHA1 Message Date
Álvaro Somoza
b0dc51da31 [LTX2] Fix wrong lora mixin (#13144)
change lora mixin

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-02-15 11:36:17 +05:30
YiYi Xu
c919ec0611 [Modular] add explicit workflow support (#13028)
* up

* up up

* update outputs

* style

* add modular_auto_docstring!

* more auto docstring

* style

* up up up

* more more

* up

* address feedbacks

* add TODO in the description for empty docstring

* refactor based on dhruv's feedback: remove the class method

* add template method

* up

* up up up

* apply auto docstring

* make style

* rmove space in make docstring

* Apply suggestions from code review

* revert change in z

* fix

* Apply style fixes

* include auto-docstring check in the modular ci. (#13004)

* initial support: workflow

* up up

* treeat loop sequential pipeline blocks as leaf

* update qwen image docstring note

* add workflow support for sdxl

* add a test suit

* add test for qwen-image

* refactor flux a bit, seperate modular_blocks into modular_blocks_flux and modular_blocks_flux_kontext + support workflow

* refactor flux2: seperate blocks for klein_base + workflow

* qwen: remove import support for stuff other than the default blocks

* add workflow support for wan

* sdxl: remove some imports:

* refactor z

* update flux2 auto core denoise

* add workflow test for z and flux2

* Apply suggestions from code review

* Apply suggestions from code review

* add test for flux

* add workflow test for flux

* add test for flux-klein

* sdxl: modular_blocks.py -> modular_blocks_stable_diffusion_xl.py

* style

* up

* add auto docstring

* workflow_names -> available_workflows

* fix workflow test for klein base

* Apply suggestions from code review

Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>

* fix workflow tests

* qwen: edit -> image_conditioned to be consistent with flux kontext/2 such

* remove Optional

* update type hints

* update guider update_components

* fix more

* update docstring auto again

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal>
Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-161-123.ec2.internal>
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>
2026-02-14 16:18:48 -10:00
YiYi Xu
3c7506b294 [Modular] update doc for ModularPipeline (#13100)
* update create pipeline section

* update more

* update more

* more

* add a section on running pipeline moduarly

* refactor update_components, remove support for spec

* style

* bullet points

* update the pipeline block

* small fix in state doc

* update sequential doc

* fix link

* small update on quikstart

* add a note on how to run pipeline without the componen4ts manager

* Apply suggestions from code review

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* remove the supported models mention

* update more

* up

* revert type hint changes

---------

Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal>
Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-161-123.ec2.internal>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
2026-02-14 11:43:28 -10:00
YiYi Xu
19ab0ecb9e fix guider (#13147)
fix
2026-02-14 11:12:22 -10:00
YiYi Xu
5b00a18374 fix MT5Tokenizer (#13146)
up
2026-02-14 09:40:07 -10:00
YiYi Xu
6141ae2348 [Modular] add different pipeine blocks to init (#13145)
* up

* style + copies

* fix

---------

Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal>
2026-02-13 18:36:47 -10:00
Sayak Paul
3c1c62ec9d [docs] fix ltx2 i2v docstring. (#13135)
* fix ltx2 i2v docstring.

* up
2026-02-14 08:40:16 +05:30
Sayak Paul
8abcf351c9 feat: implement apply_lora_scale to remove boilerplate. (#12994)
* feat: implement apply_lora_scale to remove boilerplate.

* apply to the rest.

* up

* remove more.

* remove.

* fix

* apply feedback.
2026-02-13 23:25:46 +05:30
Sayak Paul
2843b3d37a Sunset Python 3.8 & get rid of explicit typing exports where possible (#12524)
* drop python 3.8

* remove list, tuple, dict from typing

* fold Unions into |

* up

* fix a bunch and please me.

* up

* up

* up

* up

* up

* up

* enforce 3.10.0.

* up

* up

* up

* up

* up

* up

* up

* up

* Update setup.py

Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>

* up.

* python 3.10.

* ifx

* up

* up

* up

* up

* final

* up

* fix typing utils.

* up

* up

* up

* up

* up

* up

* fix

* up

* up

* up

* up

* up

* up

* handle modern types.

* up

* up

* fix ip adapter type checking.

* up

* up

* up

* up

* up

* up

* up

* revert docstring changes.

* keep deleted files deleted.

* keep deleted files deleted.

---------

Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>
2026-02-13 18:16:51 +05:30
Sayak Paul
76af013a41 fix cosmos transformer typing. (#13134) 2026-02-13 14:51:19 +05:30
dg845
277e305589 [CI] Fix setuptools pkg_resources Bug for PR GPU Tests (#13132)
Try to fix setuptools pkg_resources error for PR GPU test workflow
2026-02-13 10:09:32 +05:30
David El Malih
5f3ea22513 docs: improve docstring scheduling_flow_match_heun_discrete.py (#13130)
Improve docstring scheduling flow match heun discrete
2026-02-12 14:32:04 -08:00
dg845
427472eb00 [CI] Fix setuptools pkg_resources Errors (#13129)
Try to fix setuptools pkg_resources issue on CI
2026-02-12 17:48:44 +05:30
dg845
985d83c948 Fix LTX-2 Inference when num_videos_per_prompt > 1 and CFG is Enabled (#13121)
Fix LTX-2 inference when num_videos_per_prompt > 1 and CFG is enabled
2026-02-11 22:35:29 -08:00
Sayak Paul
ed77a246c9 [modular] add tests for robust model loading. (#13120)
* add tests for robust model loading.

* apply review feedback.
2026-02-12 10:04:29 +05:30
Miguel Martin
a1816166a5 Cosmos Transfer2.5 inference pipeline: general/{seg, depth, blur, edge} (#13066)
* initial conversion script

* cosmos control net block

* CosmosAttention

* base model conversion

* wip

* pipeline updates

* convert controlnet

* pipeline: working without controls

* wip

* debugging

* Almost working

* temp

* control working

* cleanup + detail on neg_encoder_hidden_states

* convert edge

* pos emb for control latents

* convert all chkpts

* resolve TODOs

* remove prints

* Docs

* add siglip image reference encoder

* Add unit tests

* controlnet: add duplicate layers

* Additional tests

* skip less

* skip less

* remove image_ref

* minor

* docs

* remove skipped test in transfer

* Don't crash process

* formatting

* revert some changes

* remove skipped test

* make style

* Address comment + fix example

* CosmosAttnProcessor2_0 revert + CosmosAttnProcessor2_5 changes

* make style

* make fix-copies
2026-02-11 18:33:09 -10:00
David El Malih
06a0f98e6e docs: improve docstring scheduling_flow_match_euler_discrete.py (#13127)
Improve docstring scheduling flow match euler discrete
2026-02-11 16:39:55 -08:00
Jared Wen
d32483913a [Fix]Allow prompt and prior_token_ids to be provided simultaneously in GlmImagePipeline (#13092)
* allow loose input

Signed-off-by: JaredforReal <w13431838023@gmail.com>

* add tests

Signed-off-by: JaredforReal <w13431838023@gmail.com>

* format test_glm_image

Signed-off-by: JaredforReal <w13431838023@gmail.com>

---------

Signed-off-by: JaredforReal <w13431838023@gmail.com>
2026-02-11 08:29:36 -10:00
David El Malih
64e2adf8f5 docs: improve docstring scheduling_edm_dpmsolver_multistep.py (#13122)
Improve docstring scheduling edm dpmsolver multistep
2026-02-11 08:59:33 -08:00
Dhruv Nair
c3a4cd14b8 [CI] Refactor Wan Model Tests (#13082)
* update

* update

* update

* update

* update

* update

* update

* update
2026-02-11 14:42:58 +05:30
Sayak Paul
4d00980e25 [lora] fix non-diffusers lora key handling for flux2 (#13119)
fix non-diffusers lora key handling for flux2
2026-02-11 08:06:36 +05:30
Álvaro Somoza
5bf248ddd8 [SkyReelsV2] Fix ftfy import (#13113)
fix
2026-02-10 12:56:13 +05:30
Dhruv Nair
bedc67c75f [Docs] Add guide for AutoModel with custom code (#13099)
update
2026-02-10 12:19:44 +05:30
Sayak Paul
20efb79d49 [modular] add modular tests for Z-Image and Wan (#13078)
* add wan modular tests

* style.

* add z-image tests and other fixes.

* style.

* increase tolerance for zimage

* style

* address reviewer feedback.

* address reviewer feedback.

* remove unneeded func

* simplify even more.
2026-02-09 08:27:59 -10:00
Linoy Tsaban
8933686770 Z image lora training (#13056)
* initial commit

* initial commit

* initial commit

* initial commit

* initial commit

* initial commit

* initial commit

* fix vae

* fix prompts

* Apply style fixes

* fix license

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-09 15:45:59 +02:00
dg845
baaa8d040b LTX 2 Improve encode_video by Accepting More Input Types (#13057)
* Support different pipeline outputs for LTX 2 encode_video

* Update examples to use improved encode_video function

* Fix comment

* Address review comments

* make style and make quality

* Have non-iterator video inputs respect video_chunks_number

* make style and make quality

* Add warning when encode_video receives a non-denormalized np.ndarray

* make style and make quality

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-02-08 19:40:34 -08:00
YiYi Xu
44f4dc0054 [Modular] guard ModularPipeline.blocks attribute (#13014)
* up

* style
2026-02-08 16:12:47 -10:00
YiYi Xu
fd705bd8ff [Modular] refactor Wan: modular pipelines by task etc (#13063)
* initil

* fix init_pipeline etc

* style

* copies

* fix copies

* upup more

* fix test

* add output type (#13091)

---------

Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal>
Co-authored-by: Álvaro Somoza <asomoza@users.noreply.github.com>
2026-02-07 11:28:27 -10:00
hlky
09dca386d0 ZImageControlNet cfg (#13080)
Co-authored-by: Álvaro Somoza <asomoza@users.noreply.github.com>
Co-authored-by: YiYi Xu <yixu310@gmail.com>
2026-02-07 10:40:55 -10:00
YiYi Xu
10dc589a94 [modular]simplify components manager doc (#13088)
* simplify components manager doc

* Apply suggestion from @yiyixuxu

* Apply suggestion from @stevhliu

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Apply suggestion from @stevhliu

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

---------

Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
2026-02-06 09:55:34 -10:00
David El Malih
44b8201d98 docs: improve docstring scheduling_dpmsolver_multistep_inverse.py (#13085)
* Improve docstring scheduling dpmsolver sde

* Update scheduling_dpmsolver_sde.py

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* run make fix-copies

---------

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
2026-02-06 09:20:05 -08:00
dxqb
ca79f8ccc4 GGUF fix for unquantized types when using unquantize kernels (#12498)
Even if the `qweight_type` is one of the `UNQUANTIZED_TYPES`, qweight still has to be "dequantized" because it is stored as an 8-bit tensor. Without doing so, it is therefore a shape mismatch in the following matmul.

Side notes:
 - why isn't DIFFUSERS_GGUF_CUDA_KERNELS on by default? It's significantly faster and only used when installed
 - https://huggingface.co/Isotr0py/ggml/tree/main/build has no build for torch 2.8 (or the upcoming 2.9). Who can we contact to make such a build?

Co-authored-by: YiYi Xu <yixu310@gmail.com>
2026-02-06 08:56:19 +05:30
CalamitousFelicitousness
99e2cfff27 Feature/zimage inpaint pipeline (#13006)
* Add ZImageInpaintPipeline

Updated the pipeline structure to include ZImageInpaintPipeline
    alongside ZImagePipeline and ZImageImg2ImgPipeline.
Implemented the ZImageInpaintPipeline class for inpainting
    tasks, including necessary methods for encoding prompts,
    preparing masked latents, and denoising.
Enhanced the auto_pipeline to map the new ZImageInpaintPipeline
    for inpainting generation tasks.
Added unit tests for ZImageInpaintPipeline to ensure
    functionality and performance.
Updated dummy objects to include ZImageInpaintPipeline for
    testing purposes.

* Add documentation and improve test stability for ZImageInpaintPipeline

- Add torch.empty fix for x_pad_token and cap_pad_token in test
- Add # Copied from annotations for encode_prompt methods
- Add documentation with usage example and autodoc directive

* Address PR review feedback for ZImageInpaintPipeline

Add batch size validation and callback handling fixes per review,
using diffusers conventions rather than suggested code verbatim.

* Update src/diffusers/pipelines/z_image/pipeline_z_image_inpaint.py

Co-authored-by: Álvaro Somoza <asomoza@users.noreply.github.com>

* Update src/diffusers/pipelines/z_image/pipeline_z_image_inpaint.py

Co-authored-by: Álvaro Somoza <asomoza@users.noreply.github.com>

* Add input validation and fix XLA support for ZImageInpaintPipeline

- Add missing is_torch_xla_available import for TPU support
- Add xm.mark_step() in denoising loop for proper XLA execution
- Add check_inputs() method for comprehensive input validation
- Call check_inputs() at the start of __call__

Addresses PR review feedback from @asomoza.

* Cleanup

---------

Co-authored-by: Álvaro Somoza <asomoza@users.noreply.github.com>
2026-02-05 11:48:25 -03:00
Sayak Paul
a3dcd9882f [core] make qwen hidden states contiguous to make torchao happy. (#13081)
make qwen hidden states contiguous to make torchao happy.
2026-02-05 09:02:32 +05:30
Sayak Paul
9fe0a9cac4 [core] make flux hidden states contiguous (#13068)
* make flux hidden states contiguous

* make fix-copies
2026-02-05 08:39:44 +05:30
David El Malih
03af690b60 docs: improve docstring scheduling_dpmsolver_multistep_inverse.py (#13083)
Improve docstring scheduling dpmsolver multistep inverse
2026-02-04 09:21:57 -08:00
Sayak Paul
90818e82b3 [docs] Fix syntax error in quantization configuration (#13076)
Fix syntax error in quantization configuration
2026-02-04 08:31:03 -08:00
Alan Ponnachan
430c557b6a Add support for Magcache (#12744)
* add magcache

* formatting

* add magcache support with calibration mode

* add imports

* improvements

* Apply style fixes

* fix kandinsky errors

* add tests and documentation

* Apply style fixes

* improvements

* Apply style fixes

* make fix-copies.

* minor fixes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-02-04 13:45:12 +05:30
Sayak Paul
1b8fc6c589 [modular] change the template modular pipeline card (#13072)
* start better template for modular pipeline card.

* simplify structure.

* refine.

* style.

* up

* add tests
2026-02-04 10:09:10 +05:30
YiYi Xu
6d4fc6baa0 [Modular] mellon doc etc (#13051)
* add metadata field to input/output param

* refactor mellonparam: move the template outside, add metaclass, define some generic template for custom node

* add from_custom_block

* style

* up up fix

* add mellon guide

* add to toctree

* style

* add mellon_types

* style

* mellon_type -> inpnt_types + output_types

* update doc

* add quant info to components manager

* fix more

* up up

* fix components manager

* update custom block guide

* update

* style

* add a warn for mellon and add new guides to overview

* Apply suggestions from code review

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/modular_diffusers/mellon.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* more update on custom block guide

* Update docs/source/en/modular_diffusers/mellon.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* a few mamual

* apply suggestion: turn into bullets

* support define mellon meta with MellonParam directly, and update doc

* add the video

---------

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal>
2026-02-03 13:38:57 -10:00
YiYi Xu
ebd06f9b11 [Modular] loader related (#13025)
* tag loader_id from Automodel

* style

* load_components by default only load components that are not already loaded

* by default, skip loading the componeneets does not have the repo id
2026-02-03 05:34:33 -10:00
songkey
b712042da1 [Flux2] Fix LoRA loading for Flux2 Klein by adaptively enumerating transformer blocks (#13030)
* Resolve Flux2 Klein 4B/9B LoRA loading errors

* Apply style fixes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-02-02 20:36:19 +05:30
Dhruv Nair
0b76728e27 Refactor Model Tests (#12822)
* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-02-02 18:51:44 +05:30
DefTruth
973e334443 feat: support Ulysses Anything Attention (#12996)
* feat: support Ulysses Anything Attention

* feat: support Ulysses Anything Attention

* feat: support Ulysses Anything Attention

* feat: support Ulysses Anything Attention

* fix UAA broken while using joint attn

* update

* post check

* add docs

* add docs

* remove lru cache

* move codes

* update
2026-02-02 17:04:32 +05:30
YiYi Xu
769a1f3a12 [Modular]add a real quick start guide (#13029)
* add a real quick start guide

* Update docs/source/en/modular_diffusers/quickstart.md

* update a bit more

* fix

* Apply suggestions from code review

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/modular_diffusers/quickstart.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/en/modular_diffusers/quickstart.md

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>

* update more

* Apply suggestions from code review

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>

* address more feedbacks: move components amnager earlier, explain blocks vs sub-blocks etc

* more

* remove the link to mellon guide, not exist in this PR yet

---------

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-01-31 09:43:20 -10:00
Mikko Lauri
ec6b2bcccb Fix aiter availability check (#13059)
Update import_utils.py
2026-01-30 19:24:05 +05:30
Jared Wen
6a1904eb06 [bug fix] GLM-Image fit new get_image_features API (#13052)
change get_image_features API

Signed-off-by: JaredforReal <w13431838023@gmail.com>
Co-authored-by: YiYi Xu <yixu310@gmail.com>
2026-01-29 16:16:42 -10:00
Sayak Paul
f5b6b6625a [wan] fix wan 2.2 when either of the transformers isn't present. (#13055)
fix wan 2.2 when either of the transformers isn't present.
2026-01-29 08:45:24 -10:00
Olexandr88
1be2f7e8c5 docs: fix grammar in fp16_safetensors CLI warning (#13040)
* docs: fix grammar in fp16_safetensors CLI warning

* Apply style fixes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-29 21:33:09 +05:30
Sayak Paul
314cfddf3a [ci] uniform run times and wheels for pytorch cuda. (#13047)
* uniform run times and wheels for pytorch cuda.

* 12.9

* change to 24.04.

* change to 24.04.
2026-01-29 19:22:30 +05:30