1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-29 07:22:12 +03:00
Commit Graph

6200 Commits

Author SHA1 Message Date
sayakpaul
e5ebacb820 fix 2026-01-28 12:31:24 +05:30
sayakpaul
8c402d3a32 remove. 2026-01-28 12:16:39 +05:30
sayakpaul
458ac949a0 remove more. 2026-01-28 12:14:21 +05:30
sayakpaul
290f749bd5 up 2026-01-28 12:10:51 +05:30
sayakpaul
d6fcd78d0e apply to the rest. 2026-01-28 11:53:16 +05:30
Sayak Paul
9afafe5e26 Merge branch 'main' into apply-lora-scale-decorator 2026-01-28 09:30:36 +05:30
YiYi Xu
53d8a1e310 [modular]support klein (#13002)
* support klein

* style

* copies

* Apply suggestions from code review

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

* Update src/diffusers/modular_pipelines/flux2/encoders.py

* a few fix: unpack latents before decoder etc

* style

* remove guidannce to its own block

* style

* flux2-dev work in modular setting

* up

* up up

* add tests

---------

Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: Álvaro Somoza <asomoza@users.noreply.github.com>
2026-01-27 15:43:14 -10:00
Kashif Rasul
d54669a73e [Qwen] avoid creating attention masks when there is no padding (#12987)
* avoid creating attention masks when there is no padding

* make fix-copies

* torch compile tests

* set all ones mask to none

* fix positional encoding from becoming > 4096

* fix from review

* slice freqs_cis to match the input sequence length

* keep only attenton masking change

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-01-27 12:42:48 -10:00
Jared Wen
22ac6fae24 [GLM-Image] Add batch support for GlmImagePipeline (#13007)
* init

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

* change from right padding to left padding

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

* try i2i batch

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

* fix: revert i2i prior_token_image_ids to original 1D tensor format

* refactor KVCache for per prompt batching

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

* fix KVCache

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

* fix shape error

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

* refactor pipeline

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

* fix for left padding

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

* insert seed to AR model

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

* delete generator, use torch manual_seed

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

* add batch processing unit tests for GlmImagePipeline

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

* simplify normalize images method

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

* fix grids_per_sample

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

* fix t2i

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

* delete comments, simplify condition statement

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

* chage generate_prior_tokens outputs

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

* simplify if logic

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

* support user provided prior_token_ids directly

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

* remove blank lines

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

* align with transformers

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

* Apply style fixes

---------

Signed-off-by: JaredforReal <w13431838023@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-27 12:22:02 -10:00
Aditya Borate
71a865b742 Fix: Cosmos2.5 Video2World frame extraction and add default negative prompt (#13018)
* fix: Extract last frames for conditioning in Cosmos Video2World

* Added default negative prompt

* Apply style fixes

* Added default negative prompt in cosmos2 text2image pipeline

---------

Co-authored-by: YiYi Xu <yixu310@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-27 12:20:44 -10:00
Sayak Paul
3cdce4d2e8 Merge branch 'main' into apply-lora-scale-decorator 2026-01-27 20:21:54 +08:00
Sam Edwards
53279ef017 [From Single File] support from_single_file method for WanAnimateTransformer3DModel (#12691)
* Add `WanAnimateTransformer3DModel` to `SINGLE_FILE_LOADABLE_CLASSES`

* Fixed dtype mismatch when loading a single file

* Fixed a bug that results in white noise for generation

* Update dtype check for time embedder - caused white noise output

* Improve code readability

* Optimize dtype handling

Removed unnecessary dtype conversions for timestep and weight.

* Apply style fixes

* Refactor time embedding dtype handling

Adjust time embedding type conversion for compatibility.

* Apply style fixes

* Modify comment for WanTimeTextImageEmbedding class

---------

Co-authored-by: Sam Edwards <sam.edwards1976@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-27 11:57:21 +05:30
Salman Chishti
d9959bd53b Upgrade GitHub Actions to latest versions (#12866)
* Upgrade GitHub Actions to latest versions

Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>

* fix: Correct GitHub Actions upgrade (fix branch refs and version formats)

* fix: Correct GitHub Actions upgrade (fix branch refs and version formats)

* fix: Correct GitHub Actions upgrade (fix branch refs and version formats)

---------

Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
2026-01-27 11:52:50 +05:30
YiYi Xu
b1c77f67ac [modular] add auto_docstring & more doc related refactors (#12958)
* 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)

* Run ruff format after auto docstring generation

* up

* upup

* upup

* style

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-01-26 17:12:13 -10:00
David El Malih
956bdcc3ea Flag Flax schedulers as deprecated (#13031)
flag flax schedulers as deprecated
2026-01-26 09:41:48 -08:00
Hameer Abbasi
2af7baa040 Remove *pooled_* mentions from Chroma inpaint (#13026)
Remove `*pooled_*` mentions from Chroma as it has just one TE.
2026-01-26 10:18:29 -03:00
David El Malih
a7cb14efbe Improve docstrings and type hints in scheduling_ddpm_parallel.py (#13027)
* docs: improve docstring scheduling_ddpm_parallel.py

* Update scheduling_ddpm_parallel.py

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

---------

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
2026-01-25 10:43:43 -08:00
David El Malih
e8e88ff2ce Improve docstrings and type hints in scheduling_ddpm_flax.py (#13024)
docs: improve docstring scheduling_ddpm_flax.py
2026-01-23 11:51:47 -08:00
David El Malih
6e24cd842c Improve docstrings and type hints in scheduling_ddim_parallel.py (#13023)
* docs: improve docstring scheduling_ddim_parallel.py

* docs: improve docstring scheduling_ddim_parallel.py

* Update src/diffusers/schedulers/scheduling_ddim_parallel.py

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

* Update src/diffusers/schedulers/scheduling_ddim_parallel.py

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

* Update src/diffusers/schedulers/scheduling_ddim_parallel.py

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

* Update src/diffusers/schedulers/scheduling_ddim_parallel.py

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

* fix style

---------

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
2026-01-23 10:00:32 -08:00
Garry Ling
981eb802c6 feat: add qkv projection fuse for longcat transformers (#13021)
feat: add qkv fuse for longcat transformers

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-01-23 23:02:03 +05:30
jiqing-feng
1eb40c6dbd Resnet only use contiguous in training mode. (#12977)
* fix contiguous

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>

* update tol

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>

* bigger tol

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>

* fix tests

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>

* update tol

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>

---------

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-01-23 18:40:10 +05:30
Sayak Paul
bff672f47f fix Dockerfiles for cuda and xformers. (#13022) 2026-01-23 16:45:14 +05:30
David El Malih
d4f97d1921 Improve docstrings and type hints in scheduling_ddim_inverse.py (#13020)
docs: improve docstring scheduling_ddim_inverse.py
2026-01-22 15:42:45 -08:00
David El Malih
1d32b19ad4 Improve docstrings and type hints in scheduling_ddim_flax.py (#13010)
* docs: improve docstring scheduling_ddim_flax.py

* docs: improve docstring scheduling_ddim_flax.py

* docs: improve docstring scheduling_ddim_flax.py
2026-01-22 09:11:14 -08:00
Garry Ling
699297f647 feat: accelerate longcat-image with regional compile (#13019) 2026-01-22 20:21:45 +05:30
Aryan V S
7a02fadad3 [scheduler] Support custom sigmas in UniPCMultistepScheduler (#12109)
* update

* fix tests

* Apply suggestions from code review

* Revert default flow sigmas change so that tests relying on UniPC multistep still pass

* Remove custom timesteps for UniPC multistep set_timesteps

---------

Co-authored-by: YiYi Xu <yixu310@gmail.com>
Co-authored-by: Daniel Gu <dgu8957@gmail.com>
Co-authored-by: dg845 <58458699+dg845@users.noreply.github.com>
2026-01-21 17:18:59 -08:00
David El Malih
ec37629371 Improve docstrings and type hints in scheduling_ddim_cogvideox.py (#12992)
docs: improve docstring scheduling_ddim_cogvideox.py
2026-01-20 12:33:50 -08:00
Guillaume Besson
4b843c8430 Fix variable name in docstring for PeftAdapterMixin.set_adapters (#13003)
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-01-20 15:43:59 +05:30
Sayak Paul
835a087a47 Merge branch 'main' into apply-lora-scale-decorator 2026-01-20 10:44:21 +05:30
Gal Davidi
d7a1c31f4f Fibo edit pipeline (#12930)
* Feature: Add BriaFiboEditPipeline to diffusers

* Introduced BriaFiboEditPipeline class with necessary backend requirements.
* Updated import structures in relevant modules to include BriaFiboEditPipeline.
* Ensured compatibility with existing pipelines and type checking.

* Feature: Introduce Bria Fibo Edit Pipeline

* Added BriaFiboEditPipeline class for structured JSON-native image editing.
* Created documentation for the new pipeline in bria_fibo_edit.md.
* Updated import structures to include the new pipeline and its components.
* Added unit tests for the BriaFiboEditPipeline to ensure functionality and correctness.

* Enhancement: Update Bria Fibo Edit Pipeline and Documentation

* Refined the Bria Fibo Edit model description for clarity and detail.
* Added usage instructions for model authentication and login.
* Implemented mask handling functions in the BriaFiboEditPipeline for improved image editing capabilities.
* Updated unit tests to cover new mask functionalities and ensure input validation.
* Adjusted example code in documentation to reflect changes in the pipeline's usage.

* Update Bria Fibo Edit documentation with corrected Hugging Face page link

* add dreambooth training script

* style and quality

* Delete temp.py

* Enhancement: Improve JSON caption validation in DreamBoothDataset

* Updated the clean_json_caption function to handle both string and dictionary inputs for captions.
* Added error handling to raise a ValueError for invalid caption types, ensuring better input validation.

* Add datasets dependency to requirements_fibo_edit.txt

* Add bria_fibo_edit to docs table of contents

* Fix dummy objects ordering

* Fix BriaFiboEditPipeline to use passed generator parameter

The pipeline was ignoring the generator parameter and only using
the seed parameter. This caused non-deterministic outputs in tests
that pass a seeded generator.

* Remove fibo_edit training script and related files

---------

Co-authored-by: kfirbria <kfir@bria.ai>
2026-01-19 22:09:53 +05:30
Sayak Paul
29b15f41c7 [chore] make style to push new changes. (#12998)
make style to push new changes.
2026-01-19 16:02:13 +05:30
sayakpaul
75edff93a0 Revert "make style && make quality"
This reverts commit 76f51a5e92.
2026-01-19 15:35:20 +05:30
sayakpaul
76f51a5e92 make style && make quality 2026-01-19 15:34:29 +05:30
sayakpaul
afa4a23c6c feat: implement apply_lora_scale to remove boilerplate. 2026-01-19 10:04:24 +05:30
David El Malih
3996788b60 [Docs] Replace root CONTRIBUTING.md with symlink to source docs (#12986)
Chore: Replace CONTRIBUTING.md with a symlink to documentation
2026-01-16 12:36:50 -08:00
David El Malih
9fedfe58b7 Improve docstrings and type hints in scheduling_cosine_dpmsolver_multistep.py (#12936)
* docs: improve docstring scheduling_cosine_dpmsolver_multistep.py

* Update src/diffusers/schedulers/scheduling_cosine_dpmsolver_multistep.py

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

* Update src/diffusers/schedulers/scheduling_cosine_dpmsolver_multistep.py

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

* fix

---------

Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
2026-01-16 12:23:49 -08:00
Sayak Paul
ebf891a254 [core] gracefully error out when attn-backend x cp combo isn't supported. (#12832)
* gracefully error out when attn-backend x cp combo isn't supported.

* Revert "gracefully error out when attn-backend x cp combo isn't supported."

This reverts commit c8abb5d7c0.

* gracefully error out when attn-backend x cp combo isn't supported.

* up

* address PR feedback.

* up

* Update src/diffusers/models/modeling_utils.py

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

* dot.

---------

Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com>
2026-01-16 21:29:42 +05:30
dg845
8af8e86bc7 LTX 2 Single File Support (#12983)
* LTX 2 transformer single file support

* LTX 2 video VAE single file support

* LTX 2 audio VAE single file support

* Make it easier to distinguish LTX 1 and 2 models
2026-01-15 22:46:42 -08:00
Sayak Paul
74654df203 add klein docs. (#12984) 2026-01-16 10:12:42 +05:30
YiYi Xu
f112eab97e [modular] fix a bug in mellon param & improve docstrings (#12980)
* update mellonparams docstring to incude the acutal param definition render in mellon

* style

---------

Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal>
2026-01-15 10:42:42 -10:00
YiYi Xu
61f175660a Flux2 klein (#12982)
* flux2-klein

* Apply suggestions from code review

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

* Klein tests (#2)

* tests

* up

* tests

* up

* support step-distilled

* Apply suggestions from code review

Co-authored-by: dg845 <58458699+dg845@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: dg845 <58458699+dg845@users.noreply.github.com>

* doc string etc

* style

* more

* copies

* klein lora training scripts (#3)

* initial commit

* initial commit

* remove remote text encoder

* initial commit

* initial commit

* initial commit

* revert

* img2img fix

* text encoder + tokenizer

* text encoder + tokenizer

* update readme

* guidance

* guidance

* guidance

* test

* test

* revert changes not needed for the non klein model

* Update examples/dreambooth/train_dreambooth_lora_flux2_klein.py

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

* fix guidance

* fix validation

* fix validation

* fix validation

* fix path

* space

---------

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

* style

* Update src/diffusers/pipelines/flux2/pipeline_flux2_klein.py

* Apply style fixes

* auto pipeline

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: dg845 <58458699+dg845@users.noreply.github.com>
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-15 09:10:54 -10:00
DefTruth
7f43cb1d79 fix Qwen-Image series context parallel (#12970)
* fix qwen-image cp

* relax attn_mask limit for cp

* CP plan compatible with zero_cond_t

* move modulate_index plan to top level
2026-01-15 15:40:24 +05:30
Hameer Abbasi
5efb81fa71 Add ChromaInpaintPipeline (#12848)
* Add `ChromaInpaintPipeline`

* Set `attention_mask` to `dtype=torch.bool` for `ChromaInpaintPipeline`.

* Revert `.gitignore`.
2026-01-15 12:58:50 +05:30
Yahweasel
b351be2379 LongCat Image pipeline: Allow offloading/quantization of text_encoder component (#12963)
* Don't attempt to move the text_encoder. Just move the generated_ids.

* The inputs to the text_encoder should be on its device
2026-01-14 21:10:57 -10:00
YiYi Xu
d8f4dd295f [Modular] mellon utils (#12978)
* up

* style

---------

Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal>
2026-01-14 19:03:41 -10:00
hlky
1ecfbfe12b disable_mmap in pipeline from_pretrained (#12854)
* update

* `disable_mmap` in `from_pretrained`

---------

Co-authored-by: DN6 <dhruv.nair@gmail.com>
2026-01-14 21:29:36 +05:30
Marc Sun
d7fa445453 Remove 8bit device restriction (#12972)
* allow to

* update version

* fix version again

* again

* Update src/diffusers/pipelines/pipeline_utils.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* style

* xfail

* add pr

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2026-01-14 20:33:30 +05:30
Sayak Paul
7feb4fc791 [chore] make transformers version check stricter for glm image. (#12974)
* make transformers version check stricter for glm image.

* public checkpoint.
2026-01-14 10:29:48 +05:30
Sayak Paul
3c70440d26 Update distributed_inference.md to reposition sections (#12971) 2026-01-13 11:07:39 -08:00
Sayak Paul
7299121413 Z rz rz rz rz rz rz r cogview (#12973)
* init

* add

* add 1

* Update __init__.py

* rename

* 2

* update

* init with encoder

* merge2pipeline

* Update pipeline_glm_image.py

* remove sop

* remove useless func

* Update pipeline_glm_image.py

* up

(cherry picked from commit cfe19a31b9)

* review for work only

* change place

* Update pipeline_glm_image.py

* update

* Update transformer_glm_image.py

* 1

* no  negative_prompt for GLM-Image

* remove CogView4LoraLoaderMixin

* refactor attention processor.

* update

* fix

* use staticmethod

* update

* up

* up

* update

* Update glm_image.md

* 1

* Update pipeline_glm_image.py

* Update transformer_glm_image.py

* using new transformers impl

* support

* resolution change

* fix-copies

* Update src/diffusers/pipelines/glm_image/pipeline_glm_image.py

Co-authored-by: YiYi Xu <yixu310@gmail.com>

* Update pipeline_glm_image.py

* use cogview4

* Update pipeline_glm_image.py

* Update pipeline_glm_image.py

* revert

* update

* batch support

* update

* version guard glm image pipeline

* validate prompt_embeds and prior_token_ids

* try docs.

* 4

* up

* up

* skip properly

* fix tests

* up

* up

---------

Co-authored-by: zRzRzRzRzRzRzR <2448370773@qq.com>
Co-authored-by: yiyixuxu <yixu310@gmail.com>
2026-01-13 06:39:22 -10:00