Sayak Paul
25f3e91c81
[CI] merge peft pr workflow into the main pr workflow. ( #10042 )
...
* merge peft pr workflow into the main pr workflow.
* remove latest
---------
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com >
2024-12-12 13:13:09 +05:30
Sayak Paul
a6a18cff5e
[LoRA] add a test to ensure set_adapters() and attn kwargs outs match ( #10110 )
...
* add a test to ensure set_adapters() and attn kwargs outs match
* remove print
* fix
* Apply suggestions from code review
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com >
* assertFalse.
---------
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com >
2024-12-12 12:52:50 +05:30
Canva
7db9463e52
Add support for XFormers in SD3 ( #8583 )
...
* Add support for XFormers in SD3
* sd3 xformers test
* sd3 xformers quality
* sd3 xformers update
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: YiYi Xu <yixu310@gmail.com >
2024-12-12 12:05:39 +05:30
Ethan Smith
26e80e0143
fix min-snr implementation ( #8466 )
...
* fix min-snr implementation
https://github.com/kohya-ss/sd-scripts/blob/main/library/custom_train_functions.py#L66
* Update train_dreambooth.py
fix variable name mse_loss_weights
* fix divisor
* make style
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: YiYi Xu <yixu310@gmail.com >
2024-12-12 09:55:59 +05:30
hlky
914a585be8
Add ControlNetUnion ( #10131 )
...
* ControlNetUnion model
2024-12-11 07:07:50 -10:00
Dhruv Nair
ad40e26515
[Single File] Add single file support for AutoencoderDC ( #10183 )
...
* update
* update
* update
2024-12-11 16:57:36 +05:30
SahilCarterr
d041dd5040
Added Error when len(gligen_images ) is not equal to len(gligen_phrases) in StableDiffusionGLIGENTextImagePipeline ( #10176 )
...
* added check value error
* fix style
2024-12-11 08:59:41 +00:00
Jonathan Yin
0967593400
Fix Nonetype attribute error when loading multiple Flux loras ( #10182 )
...
Fix Nonetype attribute error
2024-12-11 13:33:33 +05:30
Linoy Tsaban
43534a8d1f
[community pipeline rf-inversion] - fix example in doc ( #10179 )
...
* fix example in doc
* remove redundancies
* change param
2024-12-11 00:30:05 +02:00
Darshil Jariwala
65b98b5da4
Add PAG Support for Stable Diffusion Inpaint Pipeline ( #9386 )
...
* using sd inpaint pipeline and sdxl pag inpaint pipeline to add changes
* using sd inpaint pipeline and sdxl pag inpaint pipeline to add changes
* finished the call function
* added auto pipeline
* merging diffusers
* ready to test
* ready to test
* added copied from and removed unnecessary tests
* make style changes
* doc changes
* updating example doc string
* style fix
* init
* adding imports
* quality
* Update src/diffusers/pipelines/pag/pipeline_pag_sd_inpaint.py
* make
* Update tests/pipelines/pag/test_pag_sd_inpaint.py
* slice and size
* slice
---------
Co-authored-by: Darshil Jariwala <darshiljariwala@Darshils-MacBook-Air.local >
Co-authored-by: Darshil Jariwala <jariwala.darshil2002@gmail.com >
Co-authored-by: YiYi Xu <yixu310@gmail.com >
Co-authored-by: hlky <hlky@hlky.ac >
2024-12-10 21:06:31 +00:00
Aryan
49a9143479
Flux Control LoRA ( #9999 )
...
* update
---------
Co-authored-by: yiyixuxu <yixu310@gmail.com >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2024-12-10 09:08:13 -10:00
hlky
4c4b323c1f
Use torch in get_3d_rotary_pos_embed/_allegro ( #10161 )
...
Use torch in get_3d_rotary_pos_embed/_allegro
2024-12-10 08:56:26 -10:00
Soof Golan
22d3a82651
Improve post-processing performance ( #10170 )
...
* Use multiplication instead of division
* Add fast path when denormalizing all or none of the images
2024-12-10 08:07:26 -10:00
Linoy Tsaban
c9e4fab42c
[community pipeline] Add RF-inversion Flux pipeline ( #9816 )
...
* initial commit
* update denoising loop
* fix scheduling
* style
* fix import
* fixes
* fixes
* style
* fixes
* change invert
* change denoising & check inputs
* shape & timesteps fixes
* timesteps fixes
* style
* remove redundancies
* small changes
* update documentation a bit
* update documentation a bit
* update documentation a bit
* style
* change strength param, remove redundancies
* style
* forward ode loop change
* add inversion progress bar
* fix image_seq_len
* revert to strength but == 1 by default.
* style
* add "copied from..." comments
* credit authors
* make style
* return inversion outputs without self-assigning
* adjust denoising loop to generate regular images if inverted latents are not provided
* adjust denoising loop to generate regular images if inverted latents are not provided
* fix import
* comment
* remove redundant line
* modify comment on ti
* Update examples/community/pipeline_flux_rf_inversion.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update examples/community/pipeline_flux_rf_inversion.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update examples/community/pipeline_flux_rf_inversion.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update examples/community/pipeline_flux_rf_inversion.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update examples/community/pipeline_flux_rf_inversion.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update examples/community/pipeline_flux_rf_inversion.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update examples/community/pipeline_flux_rf_inversion.py
Co-authored-by: hlky <hlky@hlky.ac >
* fix syntax error
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: hlky <hlky@hlky.ac >
2024-12-10 12:41:12 +02:00
Aryan
0e50401e34
[Single file] Support revision argument when loading single file config ( #10168 )
...
update
2024-12-10 14:12:13 +05:30
Yu Zheng
6131a93b96
support sd3.5 for controlnet example ( #9860 )
...
* support sd3.5 in controlnet
---------
Co-authored-by: YiYi Xu <yixu310@gmail.com >
2024-12-06 10:59:27 -10:00
Juan Acevedo
3cb7b8628c
Update ptxla training ( #9864 )
...
* update ptxla example
---------
Co-authored-by: Juan Acevedo <jfacevedo@google.com >
Co-authored-by: Pei Zhang <zpcore@gmail.com >
Co-authored-by: Pei Zhang <piz@google.com >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: Pei Zhang <pei@Peis-MacBook-Pro.local >
Co-authored-by: hlky <hlky@hlky.ac >
2024-12-06 10:50:13 -10:00
Sayak Paul
fa3a9100be
[LoRA] depcrecate save_attn_procs(). ( #10126 )
...
depcrecate save_attn_procs().
2024-12-06 10:38:57 -10:00
zhangp365
188bca3084
fixed a dtype bfloat16 bug in torch_utils.py ( #10125 )
...
* fixed a dtype bfloat16 bug in torch_utils.py
when generating 1024*1024 image with bfloat16 dtype, there is an exception:
File "/opt/conda/lib/python3.10/site-packages/diffusers/utils/torch_utils.py", line 107, in fourier_filter
x_freq = fftn(x, dim=(-2, -1))
RuntimeError: Unsupported dtype BFloat16
* remove whitespace in torch_utils.py
* Update src/diffusers/utils/torch_utils.py
* Update torch_utils.py
---------
Co-authored-by: hlky <hlky@hlky.ac >
2024-12-06 10:36:39 -10:00
Junsong Chen
cd892041e2
[DC-AE] Add the official Deep Compression Autoencoder code(32x,64x,128x compression ratio); ( #9708 )
...
* first add a script for DC-AE;
* DC-AE init
* replace triton with custom implementation
* 1. rename file and remove un-used codes;
* no longer rely on omegaconf and dataclass
* replace custom activation with diffuers activation
* remove dc_ae attention in attention_processor.py
* iinherit from ModelMixin
* inherit from ConfigMixin
* dc-ae reduce to one file
* update downsample and upsample
* clean code
* support DecoderOutput
* remove get_same_padding and val2tuple
* remove autocast and some assert
* update ResBlock
* remove contents within super().__init__
* Update src/diffusers/models/autoencoders/dc_ae.py
Co-authored-by: YiYi Xu <yixu310@gmail.com >
* remove opsequential
* update other blocks to support the removal of build_norm
* remove build encoder/decoder project in/out
* remove inheritance of RMSNorm2d from LayerNorm
* remove reset_parameters for RMSNorm2d
Co-authored-by: YiYi Xu <yixu310@gmail.com >
* remove device and dtype in RMSNorm2d __init__
Co-authored-by: YiYi Xu <yixu310@gmail.com >
* Update src/diffusers/models/autoencoders/dc_ae.py
Co-authored-by: YiYi Xu <yixu310@gmail.com >
* Update src/diffusers/models/autoencoders/dc_ae.py
Co-authored-by: YiYi Xu <yixu310@gmail.com >
* Update src/diffusers/models/autoencoders/dc_ae.py
Co-authored-by: YiYi Xu <yixu310@gmail.com >
* remove op_list & build_block
* remove build_stage_main
* change file name to autoencoder_dc
* move LiteMLA to attention.py
* align with other vae decode output;
* add DC-AE into init files;
* update
* make quality && make style;
* quick push before dgx disappears again
* update
* make style
* update
* update
* fix
* refactor
* refactor
* refactor
* update
* possibly change to nn.Linear
* refactor
* make fix-copies
* replace vae with ae
* replace get_block_from_block_type to get_block
* replace downsample_block_type from Conv to conv for consistency
* add scaling factors
* incorporate changes for all checkpoints
* make style
* move mla to attention processor file; split qkv conv to linears
* refactor
* add tests
* from original file loader
* add docs
* add standard autoencoder methods
* combine attention processor
* fix tests
* update
* minor fix
* minor fix
* minor fix & in/out shortcut rename
* minor fix
* make style
* fix paper link
* update docs
* update single file loading
* make style
* remove single file loading support; todo for DN6
* Apply suggestions from code review
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* add abstract
---------
Co-authored-by: Junyu Chen <chenjydl2003@gmail.com >
Co-authored-by: YiYi Xu <yixu310@gmail.com >
Co-authored-by: chenjy2003 <70215701+chenjy2003@users.noreply.github.com >
Co-authored-by: Aryan <aryan@huggingface.co >
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
2024-12-07 01:01:51 +05:30
suzukimain
6394d905da
[community] Load Models from Sources like Civitai into Existing Pipelines ( #9986 )
...
* Added example of model search.
* Combine processing into one file
* Add parameters for base model
* Bug Fixes
* bug fix
* Create README.md
* Update search_for_civitai_and_HF.py
* Create requirements.txt
* bug fix
* Update README.md
* bug fix
* Correction of typos
* Update examples/model_search/README.md
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* Update examples/model_search/README.md
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* Update examples/model_search/README.md
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* Update examples/model_search/README.md
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* Update examples/model_search/README.md
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* Update examples/model_search/README.md
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* apply the changes
* Replace search_for_civitai_and_HF.py with pipeline_easy.py
* Update examples/model_search/README.md
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* Update examples/model_search/README.md
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* Update examples/model_search/README.md
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* Update README.md
* Organize the table of parameters
* Update README.md
* Update README.md
* Update README.md
* make style
* Fixing the style of pipeline
* Fix pipeline style
* fix
---------
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
2024-12-06 07:48:45 -08:00
Aryan
18f9b99088
Remove duplicate checks for len(generator) != batch_size when generator is a list ( #10134 )
...
remove duplicate checks
2024-12-06 11:29:10 +00:00
Aritra Roy Gosthipaty
bf64b32652
[Guide] Quantize your Diffusion Models with bnb ( #10012 )
...
* chore: initial draft
* Apply suggestions from code review
Co-authored-by: Pedro Cuenca <pedro@huggingface.co >
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* chore: link in place
* chore: review suggestions
* Apply suggestions from code review
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* chore: review suggestions
* Update docs/source/en/quantization/bitsandbytes.md
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* review suggestions
* chore: review suggestions
* Apply suggestions from code review
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
* adding same changes to 4 bit section
* review suggestions
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: Pedro Cuenca <pedro@huggingface.co >
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com >
2024-12-05 13:54:03 -08:00
SahilCarterr
3335e2262d
[FIX] Bug in FluxPosEmbed ( #10115 )
...
* Fix get_1d_rotary_pos_embed in embedding.py
* Update embeddings.py
---------
Co-authored-by: hlky <hlky@hlky.ac >
2024-12-05 13:12:48 +00:00
Sayak Paul
65ab1052b8
[Tests] xfail incompatible SD configs. ( #10127 )
...
* xfail incompatible SD configs.
* fix
2024-12-05 15:11:52 +05:30
Sayak Paul
40fc389c44
[Tests] fix condition argument in xfail. ( #10099 )
...
* fix condition argument in xfail.
* revert init changes.
2024-12-05 10:13:45 +05:30
Aryan
98d0cd5778
Use torch.device instead of current device index for BnB quantizer ( #10069 )
...
* update
* apply review suggestion
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2024-12-05 08:05:24 +05:30
Steven Liu
0d11ab26c4
[docs] load_lora_adapter ( #10119 )
...
* load_lora_adapter
* save
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2024-12-05 08:00:03 +05:30
YiYi Xu
243d9a4986
pass attn mask arg for flux ( #10122 )
2024-12-04 14:22:36 -10:00
linjiapro
96220390a2
Fix a bug for SD35 control net training and improve control net block index ( #10065 )
...
* wip
---------
Co-authored-by: YiYi Xu <yixu310@gmail.com >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2024-12-04 14:20:05 -10:00
zhangp365
73dac0c49e
Fix a bug in the state dict judgment in ip_adapter.py. ( #10095 )
...
* fix a judging state dict bug in ip_adapter.py
* make
---------
Co-authored-by: hlky <hlky@hlky.ac >
2024-12-04 14:03:43 -10:00
Linoy Tsaban
04bba38725
[Flux Redux] add prompt & multiple image input ( #10056 )
...
* add multiple prompts to flux redux
---------
Co-authored-by: hlky <hlky@hlky.ac >
2024-12-04 08:48:32 -10:00
hlky
a2d424eb2e
Add sigmas to pipelines using FlowMatch ( #10116 )
2024-12-04 08:42:47 -10:00
Parag Ekbote
25ddc7945b
Fix Broken Links in ReadMe ( #10117 )
...
Update broken links in ReadME.
2024-12-04 09:04:31 -08:00
Sayak Paul
e8da75dff5
[bitsandbytes] allow directly CUDA placements of pipelines loaded with bnb components ( #9840 )
...
* allow device placement when using bnb quantization.
* warning.
* tests
* fixes
* docs.
* require accelerate version.
* remove print.
* revert to()
* tests
* fixes
* fix: missing AutoencoderKL lora adapter (#9807 )
* fix: missing AutoencoderKL lora adapter
* fix
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* fixes
* fix condition test
* updates
* updates
* remove is_offloaded.
* fixes
* better
* empty
---------
Co-authored-by: Emmanuel Benazera <emmanuel.benazera@jolibrain.com >
2024-12-04 22:27:43 +05:30
hlky
8a450c3da0
Fix pipeline_stable_audio formating ( #10114 )
2024-12-04 17:47:42 +05:30
fancy45daddy
9ff72433fa
add torch_xla support in pipeline_stable_audio.py ( #10109 )
...
Update pipeline_stable_audio.py
2024-12-04 11:24:22 +00:00
Sayak Paul
c1926cef6b
[tests] refactor vae tests ( #9808 )
...
* add: autoencoderkl tests
* autoencodertiny.
* fix
* asymmetric autoencoder.
* more
* integration tests for stable audio decoder.
* consistency decoder vae tests
* remove grad check from consistency decoder.
* cog
* bye test_models_vae.py
* fix
* fix
* remove allegro
* fixes
* fixes
* fixes
---------
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com >
2024-12-04 15:58:36 +05:30
Ivan Skorokhodov
8421c1461b
Use parameters + buffers when deciding upscale_dtype ( #9882 )
...
Sometimes, the decoder might lack parameters and only buffers (e.g., this happens when we manually need to convert all the parameters to buffers — e.g. to avoid packing fp16 and fp32 parameters with FSDP)
2024-12-03 21:20:11 -10:00
hlky
cfdeebd4a8
Test skip_guidance_layers in SD3 pipeline ( #10102 )
...
* Test `skip_guidance_layers` in pipelines
* Move to test_pipeline_stable_diffusion_3
2024-12-03 14:28:31 -10:00
hlky
6a51427b6a
Fix multi-prompt inference ( #10103 )
...
* Fix multi-prompt inference
Fix generation of multiple images with multiple prompts, e.g len(prompts)>1, num_images_per_prompt>1
* make
* fix copies
---------
Co-authored-by: Nikita Balabin <nikita@mxl.ru >
2024-12-03 13:58:31 -10:00
Anand Kumar
5effcd3e64
[Bug fix] "previous_timestep()" in DDPM scheduling compatible with "trailing" and "linspace" options ( #9384 )
...
* Update scheduling_ddpm.py
* fix copies
---------
Co-authored-by: YiYi Xu <yixu310@gmail.com >
Co-authored-by: hlky <hlky@hlky.ac >
2024-12-03 13:57:52 -10:00
lsb
619b9658e2
Avoid compiling a progress bar. ( #10098 )
...
* Avoid creating a progress bar when it is disabled.
This is useful when exporting a pipeline, and allows a compiler to avoid trying to compile away tqdm.
* Prevent the PyTorch compiler from compiling progress bars.
* Update pipeline_utils.py
2024-12-03 11:54:32 -10:00
aihao
b58f67f2d5
update ( #7067 )
...
* add data_dir parameter to load_dataset
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: YiYi Xu <yixu310@gmail.com >
Co-authored-by: hlky <hlky@hlky.ac >
2024-12-03 11:26:47 -10:00
StAlKeR7779
8ac6de963c
DPM++ third order fixes ( #9104 )
...
* Fix wrong output on 3n-1 steps count
* Add sde handling to 3 order
* make
* copies
---------
Co-authored-by: hlky <hlky@hlky.ac >
2024-12-03 11:21:37 -10:00
Parag Ekbote
2be66e6aa0
Fix Broken Link in Optimization Docs ( #10105 )
...
Update broken link.
2024-12-03 10:23:35 -08:00
Parag Ekbote
cf258948b2
Notebooks for Community Scripts-4 ( #10094 )
...
* Add Diffuser Notebooks for Community Scripts.
* Add missing link.
* Styling Improvement.
2024-12-03 10:23:00 -08:00
Benjamin Paine
63b631f383
Add StableDiffusion3PAGImg2Img Pipeline + Fix SD3 Unconditional PAG ( #9932 )
...
* fix progress bar updates in SD 1.5 PAG Img2Img pipeline
---------
Co-authored-by: Vinh H. Pham <phamvinh257@gmail.com >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2024-12-02 21:39:47 -10:00
Pedro Cuenca
acf79b3487
Don't stale close-to-merge ( #10096 )
...
Re: https://github.com/huggingface/diffusers/discussions/10046#discussioncomment-11443466
2024-12-03 13:00:01 +05:30
DTG
fc72e0f261
Fix some documentation in ./src/diffusers/models/embeddings.py for demo ( #9579 )
...
* Fix some documentation in ./src/diffusers/models/embeddings.py as demonstration.
---------
Co-authored-by: DaAccursed05 <68813178+DaAccursed05@users.noreply.github.com >
Co-authored-by: Aryan <contact.aryanvs@gmail.com >
Co-authored-by: Aryan <aryan@huggingface.co >
Co-authored-by: YiYi Xu <yixu310@gmail.com >
2024-12-02 17:42:52 -10:00