- 10 Apr, 2025 3 commits
-
-
Yao Matrix authored
Signed-off-by:Matrix Yao <matrix.yao@intel.com>
-
Yao Matrix authored
* fix test_vanilla_funetuning failure on XPU and A100 Signed-off-by:
Matrix Yao <matrix.yao@intel.com> * change back to 5e-2 Signed-off-by:
Matrix Yao <matrix.yao@intel.com> --------- Signed-off-by:
Matrix Yao <matrix.yao@intel.com>
-
Sayak Paul authored
* support musubi wan loras. * Update src/diffusers/loaders/lora_conversion_utils.py Co-authored-by:
hlky <hlky@hlky.ac> * support i2v loras from musubi too. --------- Co-authored-by:
hlky <hlky@hlky.ac>
-
- 09 Apr, 2025 13 commits
-
-
YiYi Xu authored
-
Sayak Paul authored
* fix consisid imports * fix opencv import * fix
-
Sayak Paul authored
* fix timeout constant * style * fix
-
Ilya Drobyshevskiy authored
Before this if txt_ids was 3d tensor, line with txt_ids[:1] concat txt_ids by batch dim. Now we first check that txt_ids is 2d tensor (or take first batch element) and then concat by token dim
-
Dhruv Nair authored
* update * update * update * update
-
hlky authored
Co-authored-by:Sayak Paul <spsayakpaul@gmail.com>
-
Yao Matrix authored
* loose test_float16_inference's tolerance from 5e-2 to 6e-2, so XPU can pass UT Signed-off-by:
Matrix Yao <matrix.yao@intel.com> * fix test_pipeline_flux_redux fail on XPU Signed-off-by:
Matrix Yao <matrix.yao@intel.com> --------- Signed-off-by:
Matrix Yao <matrix.yao@intel.com>
-
hlky authored
* AutoModel * ... * lol * ... * add test * update * make fix-copies --------- Co-authored-by:Dhruv Nair <dhruv.nair@gmail.com>
-
hlky authored
-
Sayak Paul authored
* fix: SD3 ControlNet validation so that it runs on a A100. * use backend-agnostic cache and pass devide.
-
Sayak Paul authored
* support more comyui loras. * fix * fixes * revert changes in LoRA base. * no position_embedding *
🚨 introduce a breaking change to let peft handle module ambiguity * styling * remove position embeddings. * improvements. * style * make info instead of NotImplementedError * Update src/diffusers/loaders/peft.py Co-authored-by:hlky <hlky@hlky.ac> * add example. * robust checks * updates --------- Co-authored-by:
hlky <hlky@hlky.ac>
-
Sayak Paul authored
minor updates to dtype map docs.
-
Sayak Paul authored
-
- 08 Apr, 2025 10 commits
-
-
Sayak Paul authored
* improve replacement warnings for bnb * updates to docs.
-
Sayak Paul authored
* implement record_stream for better performance. * fix * style. * merge #11097 * Update src/diffusers/hooks/group_offloading.py Co-authored-by:
Aryan <aryan@huggingface.co> * fixes * docstring. * remaining todos in low_cpu_mem_usage * tests * updates to docs. --------- Co-authored-by:
Aryan <aryan@huggingface.co>
-
hlky authored
* Flux quantized with lora * fix * changes * Apply suggestions from code review Co-authored-by:
Sayak Paul <spsayakpaul@gmail.com> * Apply style fixes * enable model cpu offload() * Update src/diffusers/loaders/lora_pipeline.py Co-authored-by:
hlky <hlky@hlky.ac> * update * Apply suggestions from code review * update * add peft as an additional dependency for gguf --------- Co-authored-by:
Sayak Paul <spsayakpaul@gmail.com> Co-authored-by:
github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by:
Dhruv Nair <dhruv.nair@gmail.com>
-
Linoy Tsaban authored
* remove custom scheduler * update requirements.txt * log_validation with mixed precision * add intermediate embeddings saving when checkpointing is enabled * remove comment * fix validation * add unwrap_model for accelerator, torch.no_grad context for validation, fix accelerator.accumulate call in advanced script * revert unwrap_model change temp * add .module to address distributed training bug + replace accelerator.unwrap_model with unwrap model * changes to align advanced script with canonical script * make changes for distributed training + unify unwrap_model calls in advanced script * add module.dtype fix to dreambooth script * unify unwrap_model calls in dreambooth script * fix condition in validation run * mixed precision * Update examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py Co-authored-by:
Sayak Paul <spsayakpaul@gmail.com> * smol style change * change autocast * Apply style fixes --------- Co-authored-by:
Sayak Paul <spsayakpaul@gmail.com> Co-authored-by:
github-actions[bot] <github-actions[bot]@users.noreply.github.com>
-
Yao Matrix authored
* add arch specfic expectations support, to support different arch's numerical characteristics Signed-off-by:
YAO Matrix <matrix.yao@intel.com> * fix typo Signed-off-by:
YAO Matrix <matrix.yao@intel.com> * Apply suggestions from code review * Apply style fixes * Update src/diffusers/utils/testing_utils.py --------- Signed-off-by:
YAO Matrix <matrix.yao@intel.com> Co-authored-by:
hlky <hlky@hlky.ac> Co-authored-by:
github-actions[bot] <github-actions[bot]@users.noreply.github.com>
-
Benjamin Bossan authored
* [WIP][LoRA] Implement hot-swapping of LoRA This PR adds the possibility to hot-swap LoRA adapters. It is WIP. Description As of now, users can already load multiple LoRA adapters. They can offload existing adapters or they can unload them (i.e. delete them). However, they cannot "hotswap" adapters yet, i.e. substitute the weights from one LoRA adapter with the weights of another, without the need to create a separate LoRA adapter. Generally, hot-swapping may not appear not super useful but when the model is compiled, it is necessary to prevent recompilation. See #9279 for more context. Caveats To hot-swap a LoRA adapter for another, these two adapters should target exactly the same layers and the "hyper-parameters" of the two adapters should be identical. For instance, the LoRA alpha has to be the same: Given that we keep the alpha from the first adapter, the LoRA scaling would be incorrect for the second adapter otherwise. Theoretically, we could override the scaling dict with the alpha values derived from the second adapter's config, but changing the dict will trigger a guard for recompilation, defeating the main purpose of the feature. I also found that compilation flags can have an impact on whether this works or not. E.g. when passing "reduce-overhead", there will be errors of the type: > input name: arg861_1. data pointer changed from 139647332027392 to 139647331054592 I don't know enough about compilation to determine whether this is problematic or not. Current state This is obviously WIP right now to collect feedback and discuss which direction to take this. If this PR turns out to be useful, the hot-swapping functions will be added to PEFT itself and can be imported here (or there is a separate copy in diffusers to avoid the need for a min PEFT version to use this feature). Moreover, more tests need to be added to better cover this feature, although we don't necessarily need tests for the hot-swapping functionality itself, since those tests will be added to PEFT. Furthermore, as of now, this is only implemented for the unet. Other pipeline components have yet to implement this feature. Finally, it should be properly documented. I would like to collect feedback on the current state of the PR before putting more time into finalizing it. * Reviewer feedback * Reviewer feedback, adjust test * Fix, doc * Make fix * Fix for possible g++ error * Add test for recompilation w/o hotswapping * Make hotswap work Requires https://github.com/huggingface/peft/pull/2366 More changes to make hotswapping work. Together with the mentioned PEFT PR, the tests pass for me locally. List of changes: - docstring for hotswap - remove code copied from PEFT, import from PEFT now - adjustments to PeftAdapterMixin.load_lora_adapter (unfortunately, some state dict renaming was necessary, LMK if there is a better solution) - adjustments to UNet2DConditionLoadersMixin._process_lora: LMK if this is even necessary or not, I'm unsure what the overall relationship is between this and PeftAdapterMixin.load_lora_adapter - also in UNet2DConditionLoadersMixin._process_lora, I saw that there is no LoRA unloading when loading the adapter fails, so I added it there (in line with what happens in PeftAdapterMixin.load_lora_adapter) - rewritten tests to avoid shelling out, make the test more precise by making sure that the outputs align, parametrize it - also checked the pipeline code mentioned in this comment: https://github.com/huggingface/diffusers/pull/9453#issuecomment-2418508871; when running this inside the with torch._dynamo.config.patch(error_on_recompile=True) context, there is no error, so I think hotswapping is now working with pipelines. * Address reviewer feedback: - Revert deprecated method - Fix PEFT doc link to main - Don't use private function - Clarify magic numbers - Add pipeline test Moreover: - Extend docstrings - Extend existing test for outputs != 0 - Extend existing test for wrong adapter name * Change order of test decorators parameterized.expand seems to ignore skip decorators if added in last place (i.e. innermost decorator). * Split model and pipeline tests Also increase test coverage by also targeting conv2d layers (support of which was added recently on the PEFT PR). * Reviewer feedback: Move decorator to test classes ... instead of having them on each test method. * Apply suggestions from code review Co-authored-by:
hlky <hlky@hlky.ac> * Reviewer feedback: version check, TODO comment * Add enable_lora_hotswap method * Reviewer feedback: check _lora_loadable_modules * Revert changes in unet.py * Add possibility to ignore enabled at wrong time * Fix docstrings * Log possible PEFT error, test * Raise helpful error if hotswap not supported I.e. for the text encoder * Formatting * More linter * More ruff * Doc-builder complaint * Update docstring: - mention no text encoder support yet - make it clear that LoRA is meant - mention that same adapter name should be passed * Fix error in docstring * Update more methods with hotswap argument - SDXL - SD3 - Flux No changes were made to load_lora_into_transformer. * Add hotswap argument to load_lora_into_transformer For SD3 and Flux. Use shorter docstring for brevity. * Extend docstrings * Add version guards to tests * Formatting * Fix LoRA loading call to add prefix=None See: https://github.com/huggingface/diffusers/pull/10187#issuecomment-2717571064 * Run make fix-copies * Add hot swap documentation to the docs * Apply suggestions from code review Co-authored-by:
Steven Liu <59462357+stevhliu@users.noreply.github.com> --------- Co-authored-by:
Sayak Paul <spsayakpaul@gmail.com> Co-authored-by:
hlky <hlky@hlky.ac> Co-authored-by:
YiYi Xu <yixu310@gmail.com> Co-authored-by:
Steven Liu <59462357+stevhliu@users.noreply.github.com>
-
Álvaro Somoza authored
* initial * Update examples/dreambooth/train_dreambooth_lora_sdxl.py Co-authored-by:
hlky <hlky@hlky.ac> * update --------- Co-authored-by:
Sayak Paul <spsayakpaul@gmail.com> Co-authored-by:
hlky <hlky@hlky.ac>
-
Bhavay Malhotra authored
[train_controlnet.py] Fix the LR schedulers when num_train_epochs is passed in a distributed training env (#8461) * Create diffusers.yml * fix num_train_epochs * Delete diffusers.yml * Fixed Changes --------- Co-authored-by:
Sayak Paul <spsayakpaul@gmail.com> Co-authored-by:
YiYi Xu <yixu310@gmail.com>
-
Inigo Goiri authored
* Add support to pass image embeddings to the pipeline. --------- Co-authored-by:
hlky <hlky@hlky.ac> Co-authored-by:
github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by:
YiYi Xu <yixu310@gmail.com>
-
Steven Liu authored
mps
-
- 07 Apr, 2025 2 commits
-
-
alex choi authored
-
Yao Matrix authored
enable case on XPU: 1. tests/quantization/bnb/test_mixed_int8.py::BnB8bitTrainingTests::test_training Signed-off-by:YAO Matrix <matrix.yao@intel.com>
-
- 05 Apr, 2025 2 commits
-
-
Mikko Tukiainen authored
* Add missing 'gradient_checkpointing = False' attr * Add (limited) tests for Mochi autoencoder * Apply style fixes * pass 'conv_cache' as arg instead of kwarg --------- Co-authored-by:github-actions[bot] <github-actions[bot]@users.noreply.github.com>
-
Edna authored
* Add stg wan to community pipelines * remove debug prints * remove unused comment * Update doc * Add credit + fix typo * Apply style fixes --------- Co-authored-by:github-actions[bot] <github-actions[bot]@users.noreply.github.com>
-
- 04 Apr, 2025 4 commits
-
-
Tolga Cangöz authored
* Refactor `LTXConditionPipeline` to add text-only conditioning * style * up * Refactor `LTXConditionPipeline` to streamline condition handling and improve clarity * Improve condition checks * Simplify latents handling based on conditioning type * Refactor rope_interpolation_scale preparation for clarity and efficiency * Update LTXConditionPipeline docstring to clarify supported input types * Add LTX Video 0.9.5 model to documentation * Clarify documentation to indicate support for text-only conditioning without passing `conditions` * refactor: comment out unused parameters in LTXConditionPipeline * fix: restore previously commented parameters in LTXConditionPipeline * fix: remove unused parameters from LTXConditionPipeline * refactor: remove unnecessary lines in LTXConditionPipeline
-
Suprhimp authored
* [feat]add strength in flux_fill pipeline * Update src/diffusers/pipelines/flux/pipeline_flux_fill.py * Update src/diffusers/pipelines/flux/pipeline_flux_fill.py * Update src/diffusers/pipelines/flux/pipeline_flux_fill.py * [refactor] refactor after review * [fix] change comment * Apply style fixes * empty * fix * update prepare_latents from flux.img2img pipeline * style * Update src/diffusers/pipelines/flux/pipeline_flux_fill.py ---------
-
Dhruv Nair authored
update
-
Kenneth Gerald Hamilton authored
* Fixed requests.get function call by adding timeout parameter. * declare DIFFUSERS_REQUEST_TIMEOUT in constants and import when needed * remove unneeded os import * Apply style fixes --------- Co-authored-by:
Sai-Suraj-27 <sai.suraj.27.729@gmail.com> Co-authored-by:
github-actions[bot] <github-actions[bot]@users.noreply.github.com>
-
- 03 Apr, 2025 3 commits
-
-
célina authored
update style bot workflow
-
Basile Lewandowski authored
Change LoRA Loader to StableDiffusion Replace the SDXL LoRA Loader Mixin inheritance with the StableDiffusion one
-
Abhipsha Das authored
* model card gen code * push modelcard creation * remove optional from params * add import * add use_dora check * correct lora var use in tags * make style && make quality --------- Co-authored-by:
Aryan <aryan@huggingface.co> Co-authored-by:
Sayak Paul <spsayakpaul@gmail.com>
-
- 02 Apr, 2025 3 commits
-
-
Eliseu Silva authored
* feat: [Community Pipeline] - FaithDiff Stable Diffusion XL Pipeline for Image SR. * added pipeline
-
Dhruv Nair authored
* update * update * update
-
lakshay sharma authored
added onnxruntime-vitisai for custom build onnxruntime pkg
-