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

2242 Commits

Author SHA1 Message Date
Patrick von Platen
4cc60b53d8 Release: v0.16.0 2023-05-05 07:23:50 -07:00
Sanchit Gandhi
f83fbbdc56 [AudioLDM] Update docs to use updated ckpt (#3240)
* [AudioLDM] Update docs to use updated ckpt

* make style
2023-05-05 07:23:50 -07:00
Sayak Paul
81d7eba83f Adds a document on token merging (#3208)
* add document on token merging.

* fix headline.

* fix: headline.

* add some samples for comparison.
2023-05-05 07:23:50 -07:00
Patrick von Platen
4c73947fd3 fix fast test (#3241) 2023-05-05 07:23:50 -07:00
Patrick von Platen
3acc87952b Allow fp16 attn for x4 upscaler (#3239)
* Add all files

* update

* Make sure vae is memory efficient for PT 1

* make style
2023-05-05 07:23:50 -07:00
Patrick von Platen
7ad77dde16 Allow return pt x4 (#3236)
* Add all files

* update
2023-05-05 07:23:50 -07:00
Patrick von Platen
416f31adf8 add model (#3230)
* add

* clean

* up

* clean up more

* fix more tests

* Improve docs further

* improve

* more fixes docs

* Improve docs more

* Update src/diffusers/models/unet_2d_condition.py

* fix

* up

* update doc links

* make fix-copies

* add safety checker and watermarker to stage 3 doc page code snippets

* speed optimizations docs

* memory optimization docs

* make style

* add watermarking snippets to doc string examples

* make style

* use pt_to_pil helper functions in doc strings

* skip mps tests

* Improve safety

* make style

* new logic

* fix

* fix bad onnx design

* make new stable diffusion upscale pipeline model arguments optional

* define has_nsfw_concept when non-pil output type

* lowercase linked to notebook name

---------

Co-authored-by: William Berman <WLBberman@gmail.com>
2023-05-05 07:23:50 -07:00
Patrick von Platen
711119ae7a Fix docs text inversion (#3166)
* Fix docs text inversion

* Apply suggestions from code review
2023-05-05 07:22:14 -07:00
Yuchen Fan
81950af961 Sync cache version check from transformers (#3179)
sync cache version check from transformers
2023-05-05 07:22:14 -07:00
pdoane
9e2f445125 Fix issue in maybe_convert_prompt (#3188)
When the token used for textual inversion does not have any special symbols (e.g. it is not surrounded by <>), the tokenizer does not properly split the replacement tokens.  Adding a space for the padding tokens fixes this.
2023-05-05 07:22:14 -07:00
Patrick von Platen
0431637f11 Add ControlNet v1.1 docs (#3226)
Add v1.1 docs
2023-05-05 07:22:14 -07:00
Isaac
167cb7ae17 adding enable_vae_tiling and disable_vae_tiling functions (#3225)
adding enable_vae_tiling and disable_val_tiling functions
2023-05-05 07:22:14 -07:00
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