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

2230 Commits

Author SHA1 Message Date
Lucca Zenóbio
4e03663091 fix mixed precision training on train_dreambooth_inpaint_lora (#3138)
cast to weight dtype
2023-05-05 07:22:14 -07:00
Patrick von Platen
895320910c [Bug fix] Fix batch size attention head size mismatch (#3214) 2023-05-05 07:22:14 -07:00
Will Berman
de05ea0f50 Revert "[Community Pipelines] Update lpw_stable_diffusion pipeline" (#3201)
Revert "[Community Pipelines] Update lpw_stable_diffusion pipeline (#3197)"

This reverts commit 9965cb50ea.
2023-05-05 07:22:14 -07:00
Patrick von Platen
3267649480 Make sure VAE attention works with Torch 2_0 (#3200)
* Make sure attention works with Torch 2_0

* make style

* Fix more
2023-05-05 07:22:14 -07:00
SkyTNT
a69502f844 [Community Pipelines] Update lpw_stable_diffusion pipeline (#3197)
* Update lpw_stable_diffusion.py

* fix cpu offload
2023-05-05 07:22:14 -07:00
Chengrui Wang
49c9b4ce5f Fix bug in train_dreambooth_lora (#3183)
* Update train_dreambooth_lora.py

fix bug

* Update train_dreambooth_lora.py
2023-05-05 07:22:14 -07:00
Sanchit Gandhi
43c90b0873 [AudioLDM] Fix dtype of returned waveform (#3189) 2023-05-05 07:22:14 -07:00
Youssef Adarrab
c729403042 Add Karras sigmas to HeunDiscreteScheduler (#3160)
* Add karras pattern to discrete heun scheduler

* Add integration test

* Fix failing CI on pytorch test on M1 (mps)

---------

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-05 07:22:14 -07:00
Patrick von Platen
cf3576364a Multi Vector Textual Inversion (#3144)
* Multi Vector

* Improve

* fix multi token

* improve test

* make style

* Update examples/test_examples.py

* Apply suggestions from code review

Co-authored-by: Suraj Patil <surajp815@gmail.com>

* update

* Finish

* Apply suggestions from code review

---------

Co-authored-by: Suraj Patil <surajp815@gmail.com>
2023-05-05 07:22:14 -07:00
Steven Liu
15a90e2741 [docs] Clarify training args (#3146)
* clarify training arg

* apply feedback
2023-05-05 07:22:14 -07:00
YiYi Xu
c98a05510a make from_flax work for controlnet (#3161)
fix from_flax

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-05 07:22:14 -07:00
asfiyab-nvidia
dac4d4a5c2 Fix TensorRT community pipeline device set function (#3157)
pass silence_dtype_warnings as kwarg

Signed-off-by: Asfiya Baig <asfiyab@nvidia.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-05 07:22:14 -07:00
Sayak Paul
006ae03a90 Update custom_diffusion.mdx to credit the author (#3163)
* Update custom_diffusion.mdx

* fix: unnecessary list comprehension.
2023-05-05 07:22:14 -07:00
Steven Liu
e21784e173 [docs] Deterministic algorithms (#3172)
deterministic algos
2023-05-05 07:22:14 -07:00
Patrick von Platen
4366b0c7e7 Add model offload to x4 upscaler (#3187)
* Add model offload to x4 upscaler

* fix
2023-05-05 07:22:14 -07:00
regisss
6ad4392443 Update Habana Gaudi documentation (#3169)
* Update Habana Gaudi doc

* Fix tables
2023-05-05 07:22:14 -07:00
Sayak Paul
206b9b69d1 [DreamBooth] add text encoder LoRA support in the DreamBooth training script (#3130)
* add: LoRA text encoder support for DreamBooth example.

* fix initialization.

* fix: modification call.

* add: entry in the readme.

* use dog dataset from hub.

* fix: params to clip.

* add entry to the LoRA doc.

* add: tests for lora.

* remove unnecessary list comprehension./
2023-05-05 07:22:14 -07:00
clarencechen
f99a9ffab9 Update Noise Autocorrelation Loss Function for Pix2PixZero Pipeline (#2942)
* Update Pix2PixZero Auto-correlation Loss

* Add fast inversion tests

* Clarify purpose and mark as deprecated

Fix inversion prompt broadcasting

* Register modules set to `None` in config for `test_save_load_optional_components`

* Update new tests to coordinate with #2953
2023-05-05 07:22:14 -07:00
XinyuYe-Intel
abd21daa45 Added distillation for quantization example on textual inversion. (#2760)
* Added distillation for quantization example on textual inversion.

Signed-off-by: Ye, Xinyu <xinyu.ye@intel.com>

* refined readme and code style.

Signed-off-by: Ye, Xinyu <xinyu.ye@intel.com>

* Update text2images.py

* refined code of model load and added compatibility check.

Signed-off-by: Ye, Xinyu <xinyu.ye@intel.com>

* fixed code style.

Signed-off-by: Ye, Xinyu <xinyu.ye@intel.com>

* fix C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension)

Signed-off-by: Ye, Xinyu <xinyu.ye@intel.com>

---------

Signed-off-by: Ye, Xinyu <xinyu.ye@intel.com>
2023-05-05 07:22:14 -07:00
Mishig
3306b04b43 Update custom_diffusion.mdx (#3165)
Add missing newlines for rendering the links correctly
2023-05-05 07:22:14 -07:00
Patrick von Platen
4a6aee9828 make style 2023-05-05 07:22:14 -07:00
nupurkmr9
3417b1f51c adding custom diffusion training to diffusers examples (#3031)
* diffusers==0.14.0 update

* custom diffusion update

* custom diffusion update

* custom diffusion update

* custom diffusion update

* custom diffusion update

* custom diffusion update

* custom diffusion

* custom diffusion

* custom diffusion

* custom diffusion

* custom diffusion

* apply formatting and get rid of bare except.

* refactor readme and other minor changes.

* misc refactor.

* fix: repo_id issue and loaders logging bug.

* fix: save_model_card.

* fix: save_model_card.

* fix: save_model_card.

* add: doc entry.

* refactor doc,.

* custom diffusion

* custom diffusion

* custom diffusion

* apply style.

* remove tralining whitespace.

* fix: toctree entry.

* remove unnecessary print.

* custom diffusion

* custom diffusion

* custom diffusion test

* custom diffusion xformer update

* custom diffusion xformer update

* custom diffusion xformer update

---------

Co-authored-by: Nupur Kumari <nupurkumari@Nupurs-MacBook-Pro.local>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Nupur Kumari <nupurkumari@nupurs-mbp.wifi.local.cmu.edu>
2023-05-05 07:22:14 -07:00
Will Berman
b320c6b53e controlnet training resize inputs to multiple of 8 (#3135)
controlnet training center crop input images to multiple of 8

The pipeline code resizes inputs to multiples of 8.
Not doing this resizing in the training script is causing
the encoded image to have different height/width dimensions
than the encoded conditioning image (which uses a separate
encoder that's part of the controlnet model).

We resize and center crop the inputs to make sure they're the
same size (as well as all other images in the batch). We also
check that the initial resolution is a multiple of 8.
2023-05-05 07:22:14 -07:00
superhero-7
4afb911dd2 Modified altdiffusion pipline to support altdiffusion-m18 (#2993)
* Modified altdiffusion pipline to support altdiffusion-m18

* Modified altdiffusion pipline to support altdiffusion-m18

* Modified altdiffusion pipline to support altdiffusion-m18

* Modified altdiffusion pipline to support altdiffusion-m18

* Modified altdiffusion pipline to support altdiffusion-m18

* Modified altdiffusion pipline to support altdiffusion-m18

* Modified altdiffusion pipline to support altdiffusion-m18

---------

Co-authored-by: root <fulong_ye@163.com>
2023-05-05 07:22:14 -07:00
hwuebben
e5335f3699 Update pipeline_stable_diffusion_inpaint_legacy.py (#2903)
* Update pipeline_stable_diffusion_inpaint_legacy.py

* fix preprocessing of Pil images with adequate batch size

* revert map

* add tests

* reformat

* Update test_stable_diffusion_inpaint_legacy.py

* Update test_stable_diffusion_inpaint_legacy.py

* Update test_stable_diffusion_inpaint_legacy.py

* Update test_stable_diffusion_inpaint_legacy.py

* next try to fix the style

* wth is this

* Update testing_utils.py

* Update testing_utils.py

* Update test_stable_diffusion_inpaint_legacy.py

* Update test_stable_diffusion_inpaint_legacy.py

* Update test_stable_diffusion_inpaint_legacy.py

* Update test_stable_diffusion_inpaint_legacy.py

* Update test_stable_diffusion_inpaint_legacy.py

* Update test_stable_diffusion_inpaint_legacy.py

---------

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-05 07:22:14 -07:00
Chanchana Sornsoontorn
6058378fe4 Correct Transformer2DModel.forward docstring (#3074)
⚙️chore(transformer_2d) update function signature for encoder_hidden_states
2023-05-05 07:22:14 -07:00
asfiyab-nvidia
fc3760d4a3 Add TensorRT SD/txt2img Community Pipeline to diffusers along with TensorRT utils (#2974)
* Add SD/txt2img Community Pipeline to diffusers along with TensorRT utils

Signed-off-by: Asfiya Baig <asfiyab@nvidia.com>

* update installation command

Signed-off-by: Asfiya Baig <asfiyab@nvidia.com>

* update tensorrt installation

Signed-off-by: Asfiya Baig <asfiyab@nvidia.com>

* changes
1. Update setting of cache directory
2. Address comments: merge utils and pipeline code.
3. Address comments: Add section in README

Signed-off-by: Asfiya Baig <asfiyab@nvidia.com>

* apply make style

Signed-off-by: Asfiya Baig <asfiyab@nvidia.com>

---------

Signed-off-by: Asfiya Baig <asfiyab@nvidia.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-05 07:22:14 -07:00
1lint
f3300a869a add from_ckpt method as Mixin (#2318)
* add mixin class for pipeline from original sd ckpt

* Improve

* make style

* merge main into

* Improve more

* fix more

* up

* Apply suggestions from code review

* finish docs

* rename

* make style

---------

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-05 07:22:13 -07:00
cmdr2
1fac211336 [ckpt loader] Allow loading the Inpaint and Img2Img pipelines, while loading a ckpt model (#2705)
* [ckpt loader] Allow loading the Inpaint and Img2Img pipelines, while loading a ckpt model

* Address review comment from PR

* PyLint formatting

* Some more pylint fixes, unrelated to our change

* Another pylint fix

* Styling fix
2023-05-05 07:22:13 -07:00
Will Berman
c8eaea53bf class labels timestep embeddings projection dtype cast (#3137)
This mimics the dtype cast for the standard time embeddings
2023-05-05 07:22:13 -07:00
Will Berman
ff5b99b81f Add unet act fn to other model components (#3136)
Adding act fn config to the unet timestep class embedding and conv
activation.

The custom activation defaults to silu which is the default
activation function for both the conv act and the timestep class
embeddings so default behavior is not changed.

The only unet which use the custom activation is the stable diffusion
latent upscaler https://huggingface.co/stabilityai/sd-x2-latent-upscaler/blob/main/unet/config.json
(I ran a script against the hub to confirm).
The latent upscaler does not use the conv activation nor the timestep
class embeddings so we don't change its behavior.
2023-05-05 07:22:13 -07:00
Patrick von Platen
00a5e55b50 Correct textual inversion readme (#3145)
* Update README.md

* Apply suggestions from code review
2023-05-05 07:22:13 -07:00
Patrick von Platen
7ae597f747 make style 2023-05-05 07:22:13 -07:00
Cristian Garcia
7a39b0f7e0 Optimize log_validation in train_controlnet_flax (#3110)
extract pipeline from log_validation
2023-05-05 07:22:13 -07:00
YiYi Xu
07731e9e0b speed up attend-and-excite fast tests (#3079) 2023-05-05 07:22:13 -07:00
Sayak Paul
16ddd8b818 feat: verfication of multi-gpu support for select examples. (#3126)
* feat: verfication of multi-gpu support for select examples.

* add: multi-gpu training sections to the relvant doc pages.
2023-05-05 07:22:13 -07:00
Patrick von Platen
6f12a36056 Fix config deprecation (#3129)
* Better deprecation message

* Better deprecation message

* Better doc string

* Fixes

* fix more

* fix more

* Improve __getattr__

* correct more

* fix more

* fix

* Improve more

* more improvements

* fix more

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>

* make style

* Fix all rest & add tests & remove old deprecation fns

---------

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
2023-05-05 07:22:13 -07:00
Patrick von Platen
cc1469037f Improve deprecation warnings (#3131) 2023-05-05 07:22:13 -07:00
Patrick von Platen
7fa3b6c1f1 [Bug fix] Make sure correct timesteps are chosen for img2img (#3128)
Make sure correct timesteps are chosen for img2img
2023-05-05 07:22:13 -07:00
Patrick von Platen
653b3c1a1a [Bug fix] Fix img2img processor with safety checker (#3127)
Fix img2img processor with safety checker
2023-05-05 07:22:13 -07:00
Patrick von Platen
c98e41dffe Add global pooling to controlnet (#3121) 2023-05-05 07:22:13 -07:00
Tommaso De Rossi
e9cb03edf0 Fix breaking change in pipeline_stable_diffusion_controlnet.py (#3118)
fix breaking change
2023-05-05 07:22:13 -07:00
Will Berman
a256f8446d ddpm custom timesteps (#3007)
add custom timesteps test

add custom timesteps descending order check

docs

timesteps -> custom_timesteps

can only pass one of num_inference_steps and timesteps
2023-05-05 07:22:13 -07:00
YiYi Xu
fa6a6b470d remvoe one line as requested by gc team (#3077)
remvoe one line
2023-05-05 07:22:13 -07:00
YiYi Xu
1184b36d2f fix default value for attend-and-excite (#3099)
* fix default
2023-05-05 07:22:13 -07:00
Takuma Mori
7f3cb6d29f Add to support Guess Mode for StableDiffusionControlnetPipleline (#2998)
* add guess mode (WIP)

* fix uncond/cond order

* support guidance_scale=1.0 and batch != 1

* remove magic coeff

* add docstring

* add intergration test

* add document to controlnet.mdx

* made the comments a bit more explanatory

* fix table
2023-05-05 07:22:13 -07:00
Steven Liu
d6ae0aeeb9 [docs] Update community pipeline docs (#2989)
* update community pipeline docs

* fix formatting

* explain sharing workflows
2023-05-05 07:22:13 -07:00
Joseph Coffland
0be9f8bc68 Allow SD attend and excite pipeline to work with any size output images (#2835)
Allow stable diffusion attend and excite pipeline to work with any size output image. Re: #2476, #2603
2023-05-05 07:22:13 -07:00
Patrick von Platen
74907ee49a Throw deprecation warning for return_cached_folder (#3092)
Throw deprecation warning
2023-05-05 07:22:13 -07:00
Patrick von Platen
9dd6058d62 [Tests] parallelize (#3078)
* [Tests] parallelize

* finish folder structuring

* Parallelize tests more

* Correct saving of pipelines

* make sure logging level is correct

* try again

* Apply suggestions from code review

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>

---------

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
2023-05-05 07:22:13 -07:00