Sayak Paul
62cce3045d
[chore] change to 2025 licensing for remaining ( #11741 )
...
change to 2025 licensing for remaining
2025-06-18 20:56:00 +05:30
Fanli Lin
7855ac597e
[tests] make tests device-agnostic (part 4) ( #10508 )
...
* initial comit
* fix empty cache
* fix one more
* fix style
* update device functions
* update
* update
* Update src/diffusers/utils/testing_utils.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update src/diffusers/utils/testing_utils.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update src/diffusers/utils/testing_utils.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update tests/pipelines/controlnet/test_controlnet.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update src/diffusers/utils/testing_utils.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update src/diffusers/utils/testing_utils.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update tests/pipelines/controlnet/test_controlnet.py
Co-authored-by: hlky <hlky@hlky.ac >
* with gc.collect
* update
* make style
* check_torch_dependencies
* add mps empty cache
* add changes
* bug fix
* enable on xpu
* update more cases
* revert
* revert back
* Update test_stable_diffusion_xl.py
* Update tests/pipelines/stable_diffusion/test_stable_diffusion.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update tests/pipelines/stable_diffusion/test_stable_diffusion.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update tests/pipelines/stable_diffusion/test_stable_diffusion_img2img.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update tests/pipelines/stable_diffusion/test_stable_diffusion_img2img.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update tests/pipelines/stable_diffusion/test_stable_diffusion_img2img.py
Co-authored-by: hlky <hlky@hlky.ac >
* Apply suggestions from code review
Co-authored-by: hlky <hlky@hlky.ac >
* add test marker
---------
Co-authored-by: hlky <hlky@hlky.ac >
2025-03-04 08:26:06 +00:00
Fanli Lin
64b3e0f539
make pipelines tests device-agnostic (part1) ( #9399 )
...
* enable on xpu
* add 1 more
* add one more
* enable more
* add 1 more
* add more
* enable 1
* enable more cases
* enable
* enable
* update comment
* one more
* enable 1
* add more cases
* enable xpu
* add one more caswe
* add more cases
* add 1
* add more
* add more cases
* add case
* enable
* add more
* add more
* add more
* enbale more
* add more
* update code
* update test marker
* add skip back
* update comment
* remove single files
* remove
* style
* add
* revert
* reformat
* update decorator
* update
* update
* update
* Update tests/pipelines/deepfloyd_if/test_if.py
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com >
* Update src/diffusers/utils/testing_utils.py
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com >
* Update tests/pipelines/animatediff/test_animatediff_controlnet.py
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com >
* Update tests/pipelines/animatediff/test_animatediff.py
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com >
* Update tests/pipelines/animatediff/test_animatediff_controlnet.py
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com >
* update float16
* no unitest.skipt
* update
* apply style check
* reapply format
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com >
2024-11-22 15:32:54 +05:30
Tolga Cangöz
ec1aded12e
Optimize test files by fixing CPU-offloading usage ( #8409 )
...
* Refactor code to remove unnecessary calls to `to(torch_device)`
* Refactor code to remove unnecessary calls to `to("cuda")`
* Update pipeline_stable_diffusion_diffedit.py
2024-06-06 09:51:26 -10:00
Dhruv Nair
cb0f3b49cb
[Refactor] Better align from_single_file logic with from_pretrained ( #7496 )
...
* refactor unet single file loading a bit.
* retrieve the unet from create_diffusers_unet_model_from_ldm
* update
* update
* updae
* 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
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* tests
* update
* update
* update
* Update docs/source/en/api/single_file.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update docs/source/en/api/single_file.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* Update docs/source/en/api/loaders/single_file.md
Co-authored-by: YiYi Xu <yixu310@gmail.com >
* Update src/diffusers/loaders/single_file.py
Co-authored-by: YiYi Xu <yixu310@gmail.com >
* Update docs/source/en/api/loaders/single_file.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update docs/source/en/api/loaders/single_file.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update docs/source/en/api/loaders/single_file.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update docs/source/en/api/loaders/single_file.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* 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
* update
* update
* update
* update
* update
---------
Co-authored-by: sayakpaul <spsayakpaul@gmail.com >
Co-authored-by: YiYi Xu <yixu310@gmail.com >
2024-05-09 19:00:19 +05:30
Dhruv Nair
4d39b7483d
Memory clean up on all Slow Tests ( #7514 )
...
* update
* update
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2024-03-29 14:23:28 +05:30
Dhruv Nair
ac49f97a75
Add tests to check configs when using single file loading ( #7099 )
...
* update
* update
* update
* update
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2024-02-27 15:47:23 +05:30
Sayak Paul
30e5e81d58
change to 2024 in the license ( #6902 )
...
change to 2024
2024-02-08 08:19:31 -10:00
Dhruv Nair
872ae1dd12
Add from single file to StableDiffusionUpscalePipeline and StableDiffusionLatentUpscalePipeline ( #5194 )
...
* add from single file
* clean up
* make style
* add single file loading for upscaling
2023-10-06 13:18:13 +02:00
Dhruv Nair
b6e0b016ce
Lazy Import for Diffusers ( #4829 )
...
* initial commit
* move modules to import struct
* add dummy objects and _LazyModule
* add lazy import to schedulers
* clean up unused imports
* lazy import on models module
* lazy import for schedulers module
* add lazy import to pipelines module
* lazy import altdiffusion
* lazy import audio diffusion
* lazy import audioldm
* lazy import consistency model
* lazy import controlnet
* lazy import dance diffusion ddim ddpm
* lazy import deepfloyd
* lazy import kandinksy
* lazy imports
* lazy import semantic diffusion
* lazy imports
* lazy import stable diffusion
* move sd output to its own module
* clean up
* lazy import t2iadapter
* lazy import unclip
* lazy import versatile and vq diffsuion
* lazy import vq diffusion
* helper to fetch objects from modules
* lazy import sdxl
* lazy import txt2vid
* lazy import stochastic karras
* fix model imports
* fix bug
* lazy import
* clean up
* clean up
* fixes for tests
* fixes for tests
* clean up
* remove import of torch_utils from utils module
* clean up
* clean up
* fix mistake import statement
* dedicated modules for exporting and loading
* remove testing utils from utils module
* fixes from merge conflicts
* Update src/diffusers/pipelines/kandinsky2_2/__init__.py
* fix docs
* fix alt diffusion copied from
* fix check dummies
* fix more docs
* remove accelerate import from utils module
* add type checking
* make style
* fix check dummies
* remove torch import from xformers check
* clean up error message
* fixes after upstream merges
* dummy objects fix
* fix tests
* remove unused module import
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-09-11 09:56:22 +02:00
Sayak Paul
3768d4d77c
[Core] refactor encode_prompt ( #4617 )
...
* refactoring of encode_prompt()
* better handling of device.
* fix: device determination
* fix: device determination 2
* handle num_images_per_prompt
* revert changes in loaders.py and give birth to encode_prompt().
* minor refactoring for encode_prompt()/
* make backward compatible.
* Apply suggestions from code review
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
* fix: concatenation of the neg and pos embeddings.
* incorporate encode_prompt() in test_stable_diffusion.py
* turn it into big PR.
* make it bigger
* gligen fixes.
* more fixes to fligen
* _encode_prompt -> encode_prompt in tests
* first batch
* second batch
* fix blasphemous mistake
* fix
* fix: hopefully for the final time.
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-08-30 08:57:26 +05:30
YiYi Xu
b3b2d30cd8
fix a bug in from_pretrained when load optional components ( #4745 )
...
* fix
---------
Co-authored-by: yiyixuxu <yixu310@gmail,com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-08-25 06:25:48 -10:00
YiYi Xu
5fd3dca5f3
fix a bug in StableDiffusionUpscalePipeline when prompt is None ( #4278 )
...
* fix batch_size
* add test
---------
Co-authored-by: yiyixuxu <yixu310@gmail,com>
2023-07-27 15:07:50 +02:00
Patrick von Platen
51843fd7d0
Refactor full determinism ( #3485 )
...
* up
* fix more
* Apply suggestions from code review
* fix more
* fix more
* Check it
* Remove 16:8
* fix more
* fix more
* fix more
* up
* up
* Test only stable diffusion
* Test only two files
* up
* Try out spinning up processes that can be killed
* up
* Apply suggestions from code review
* up
* up
2023-05-22 11:15:11 +01:00
Chanchana Sornsoontorn
52c4d32d41
Fix typo and format BasicTransformerBlock attributes ( #2953 )
...
* ⚙️ chore(train_controlnet) fix typo in logger message
* ⚙️ chore(models) refactor modules order; make them the same as calling order
When printing the BasicTransformerBlock to stdout, I think it's crucial that the attributes order are shown in proper order. And also previously the "3. Feed Forward" comment was not making sense. It should have been close to self.ff but it's instead next to self.norm3
* correct many tests
* remove bogus file
* make style
* correct more tests
* finish tests
* fix one more
* make style
* make unclip deterministic
* ⚙️ chore(models/attention) reorganize comments in BasicTransformerBlock class
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-04-12 00:31:05 +02:00
Patrick von Platen
9ecd924859
[Tests] Correct PT2 ( #2724 )
...
* [Tests] Correct PT2
* correct more
* move versatile to nightly
* up
* up
* again
* Apply suggestions from code review
2023-03-18 18:38:04 +01:00
Patrick von Platen
eadf0e2555
[Copyright] 2023 ( #2524 )
2023-03-01 10:31:00 +01:00
Patrick von Platen
a7ca03aa85
Replace flake8 with ruff and update black ( #2279 )
...
* before running make style
* remove left overs from flake8
* finish
* make fix-copies
* final fix
* more fixes
2023-02-07 23:46:23 +01:00
Patrick von Platen
6ba2231d72
Reproducibility 3/3 ( #1924 )
...
* make tests deterministic
* run slow tests
* prepare for testing
* finish
* refactor
* add print statements
* finish more
* correct some test failures
* more fixes
* set up to correct tests
* more corrections
* up
* fix more
* more prints
* add
* up
* up
* up
* uP
* uP
* more fixes
* uP
* up
* up
* up
* up
* fix more
* up
* up
* clean tests
* up
* up
* up
* more fixes
* Apply suggestions from code review
Co-authored-by: Suraj Patil <surajp815@gmail.com >
* make
* correct
* finish
* finish
Co-authored-by: Suraj Patil <surajp815@gmail.com >
2023-01-25 13:44:22 +01:00
Patrick von Platen
ce1c27adc8
[Revision] Don't recommend using revision ( #1764 )
2022-12-19 16:25:41 +01:00
Anton Lozhkov
02d83c9ff1
Standardize fast pipeline tests with PipelineTestMixin ( #1526 )
...
* [WIP] Standardize fast pipeline tests with PipelineTestMixin
* refactor the sd tests a bit
* add more common tests
* add xformers
* add progressbar test
* cleanup
* upd fp16
* CycleDiffusionPipelineFastTests
* DanceDiffusionPipelineFastTests
* AltDiffusionPipelineFastTests
* StableDiffusion2PipelineFastTests
* StableDiffusion2InpaintPipelineFastTests
* StableDiffusionImageVariationPipelineFastTests
* StableDiffusionImg2ImgPipelineFastTests
* StableDiffusionInpaintPipelineFastTests
* remove unused mixins
* quality
* add missing inits
* try to fix mps tests
* fix mps tests
* add mps warmups
* skip for some pipelines
* style
* Update tests/test_pipelines_common.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2022-12-06 18:35:30 +01:00
Patrick von Platen
7932971542
[Upscaling] Fix batch size ( #1525 )
2022-12-05 13:28:55 +01:00
Suraj Patil
9ec5084a9c
StableDiffusionUpscalePipeline ( #1396 )
...
* StableDiffusionUpscalePipeline
* fix a few things
* make it better
* fix image batching
* run vae in fp32
* fix docstr
* resize to mul of 64
* doc
* remove safety_checker
* add max_noise_level
* fix Copied
* begin tests
* slow tests
* default max_noise_level
* remove kwargs
* doc
* fix
* fix fast tests
* fix fast tests
* no sf
* don't offload vae
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2022-11-25 16:13:16 +01:00