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

2274 Commits

Author SHA1 Message Date
Patrick von Platen
c8cc4f01ce [Torch 2.0 compile] Fix more torch compile breaks (#3313)
* Fix more torch compile breaks

* add tests

* Fix all

* fix controlnet

* fix more

* Add Horace He as co-author.
>
>
Co-authored-by: Horace He <horacehe2007@yahoo.com>

* Add Horace He as co-author.

Co-authored-by: Horace He <horacehe2007@yahoo.com>

---------

Co-authored-by: Horace He <horacehe2007@yahoo.com>
2023-05-05 07:23:51 -07:00
YiYi Xu
863bb75ea9 Postprocessing refactor img2img (#3268)
* refactor img2img VaeImageProcessor.postprocess

* remove copy from for init, run_safety_checker, decode_latents

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>

---------

Co-authored-by: yiyixuxu <yixu@yis-macbook-pro.lan>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2023-05-05 07:23:51 -07:00
Patrick von Platen
6a84a7439d Torch compile graph fix (#3286)
* fix more

* Fix more

* fix more

* Apply suggestions from code review

* fix

* make style

* make fix-copies

* fix

* make sure torch compile

* Clean

* fix test
2023-05-05 07:23:51 -07:00
Ilia Larchenko
c38d004cc2 Typo in tutorial (#3295) 2023-05-05 07:23:51 -07:00
Ilia Larchenko
799015c19c Changed sample[0] to images[0] (#3304)
A pipeline object stores the results in `images` not in `sample`.
Current code blocks don't work.
2023-05-05 07:23:51 -07:00
Will Berman
08fbaaf579 temp disable spectogram diffusion tests (#3278)
The note-seq package throws an error on import because the default installed version of Ipython
is not compatible with python 3.8 which we run in the CI.
https://github.com/huggingface/diffusers/actions/runs/4830121056/jobs/8605954838#step:7:9
2023-05-05 07:23:51 -07:00
YiYi Xu
1b95720f97 [doc] add link to training script (#3271)
add link to training script

Co-authored-by: yiyixuxu <yixu@yis-macbook-pro.lan>
2023-05-05 07:23:51 -07:00
Patrick von Platen
220657b7bd Allow disabling torch 2_0 attention (#3273)
* Allow disabling torch 2_0 attention

* make style

* Update src/diffusers/models/attention.py
2023-05-05 07:23:51 -07:00
Jason Kuan
fd47d7c0ef add constant learning rate with custom rule (#3133)
* add constant lr with rules

* add constant with rules in TYPE_TO_SCHEDULER_FUNCTION

* add constant lr rate with rule

* hotfix code quality

* fix doc style

* change name constant_with_rules to piecewise constant
2023-05-05 07:23:51 -07:00
clarencechen
029a28f06c Diffedit Zero-Shot Inpainting Pipeline (#2837)
* Update Pix2PixZero Auto-correlation Loss

* Add Stable Diffusion DiffEdit pipeline

* Add draft documentation and import code

* Bugfixes and refactoring

* Add option to not decode latents in the inversion process

* Harmonize preprocessing

* Revert "Update Pix2PixZero Auto-correlation Loss"

This reverts commit b218062fed.

* Update annotations

* rename `compute_mask` to `generate_mask`

* Update documentation

* Update docs

* Update Docs

* Fix copy

* Change shape of output latents to batch first

* Update docs

* Add first draft for tests

* Bugfix and update tests

* Add `cross_attention_kwargs` support for all pipeline methods

* Fix Copies

* Add support for PIL image latents

Add support for mask broadcasting

Update docs and tests

Align `mask` argument to `mask_image`

Remove height and width arguments

* Enable MPS Tests

* Move example docstrings

* Fix test

* Fix test

* fix pipeline inheritance

* Harmonize `prepare_image_latents` with StableDiffusionPix2PixZeroPipeline

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

* Move fixed logic to specific test class

* Clean changes to other pipelines

* Update new tests to coordinate with #2953

* Update slow tests for better results

* Safety to avoid potential problems with torch.inference_mode

* Add reference in SD Pipeline Overview

* Fix tests again

* Enforce determinism in noise for generate_mask

* Fix copies

* Widen test tolerance for fp16 based on `test_stable_diffusion_upscale_pipeline_fp16`

* Add LoraLoaderMixin and update `prepare_image_latents`

* clean up repeat and reg

* bugfix

* Remove invalid args from docs

Suppress spurious warning by repeating image before latent to mask gen
2023-05-05 07:23:51 -07:00
Patrick von Platen
10d856a94c Let's make sure that dreambooth always uploads to the Hub (#3272)
* Update Dreambooth README

* Adapt all docs as well

* automatically write model card

* fix

* make style
2023-05-05 07:23:51 -07:00
timegate
ffe6e92577 Add multiple conditions to StableDiffusionControlNetInpaintPipeline (#3125)
* try multi controlnet inpaint

* multi controlnet inpaint

* multi controlnet inpaint
2023-05-05 07:23:51 -07:00
M. Tolga Cangöz
5151f210d8 Update logging.mdx (#2863)
Fix typos
2023-05-05 07:23:51 -07:00
NimenDavid
c1dce2077f [Docs]zh translated docs update (#3245)
* zh translated docs update

* update _toctree
2023-05-05 07:23:51 -07:00
Joqsan
716c255ab5 [Community Pipelines] EDICT pipeline implementation (#3153)
* EDICT pipeline initial commit

- Starting point taking from https://github.com/Joqsan/edict-diffusion

* refactor __init__() method

* minor refactoring

* refactor scheduler code

- remove scheduler and move its methods to the EDICTPipeline class

* make CFG optional
- refactor encode_prompt().
- include optional generator for sampling with vae.
- minor variable renaming

* add EDICT pipeline description to README.md

* replace preprocess() with VaeImageProcessor

* run make style and make quality commands

---------

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-05 07:23:51 -07:00
Sayak Paul
72a84677cb [LoRA] quality of life improvements in the loading semantics and docs (#3180)
* 👽 qol improvements for LoRA.

* better function name?

* fix: LoRA weight loading with the new format.

* address Patrick's comments.

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* change wording around encouraging the use of load_lora_weights().

* fix: function name.

---------

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-05 07:23:51 -07:00
Will Berman
a80f6966cf [docs] add notes for stateful model changes (#3252)
* [docs] add notes for stateful model changes

* Update docs/source/en/optimization/fp16.mdx

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

* link to accelerate docs for discarding hooks

---------

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
2023-05-05 07:23:51 -07:00
YiYi Xu
2c87f6571c update notebook (#3259)
Co-authored-by: yiyixuxu <yixu@yis-macbook-pro.lan>
2023-05-05 07:23:51 -07:00
Patrick von Platen
12868b125a Fix community pipelines (#3266) 2023-05-05 07:23:51 -07:00
Patrick von Platen
79706a7db8 Revert "Revert "[Community Pipelines] Update lpw_stable_diffusion pipeline"" (#3265)
Revert "Revert "[Community Pipelines] Update lpw_stable_diffusion pipeline" (#3201)"

This reverts commit 91a2a80eb2.
2023-05-05 07:23:51 -07:00
Robert Dargavel Smith
9585b2308d AudioDiffusionPipeline - fix encode method after config changes (#3114)
* config fixes

* deprecate get_input_dims
2023-05-05 07:23:51 -07:00
Jair Trejo
5f3b10afb5 Fix typo in textual inversion JAX training script (#3123)
The pipeline is built as `pipe` but then used as `pipeline`.
2023-05-05 07:23:50 -07:00
Xie Zejian
cd13b10431 fix typo in score sde pipeline (#3132) 2023-05-05 07:23:50 -07:00
apolinário
1147c76eca Update IF name to XL (#3262)
Co-authored-by: multimodalart <joaopaulo.passos+multimodal@gmail.com>
2023-05-05 07:23:50 -07:00
Ernie Chu
76e5941cb2 [docs] Update interface in repaint.mdx (#3119)
Update repaint.mdx

accomodate to #1701
2023-05-05 07:23:50 -07:00
Isaac
cf2bf70a4d adding required parameters while calling the get_up_block and get_down_block (#3210)
* removed unnecessary parameters from get_up_block and get_down_block functions

* adding resnet_skip_time_act, resnet_out_scale_factor and cross_attention_norm to get_up_block and get_down_block functions

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
2023-05-05 07:23:50 -07:00
Pedro Cuenca
97cf3866db Remove required from tracker_project_name (#3260)
Remove required from tracker_project_name.

As observed by https://github.com/off99555 in https://github.com/huggingface/diffusers/issues/2695#issuecomment-1470755050, it already has a default value.
2023-05-05 07:23:50 -07:00
Nipun Jindal
8def721ec8 [Stochastic Sampler][Slow Test]: Cuda test fixes (#3257)
[Slow Test]: Cuda test fixes

Co-authored-by: njindal <njindal@adobe.com>
2023-05-05 07:23:50 -07:00
Nipun Jindal
7880ed77fb [2064]: Add stochastic sampler (sample_dpmpp_sde) (#3020)
* [2064]: Add stochastic sampler

* [2064]: Add stochastic sampler

* [2064]: Add stochastic sampler

* [2064]: Add stochastic sampler

* [2064]: Add stochastic sampler

* [2064]: Add stochastic sampler

* [2064]: Add stochastic sampler

* Review comments

* [Review comment]: Add is_torchsde_available()

* [Review comment]: Test and docs

* [Review comment]

* [Review comment]

* [Review comment]

* [Review comment]

* [Review comment]

---------

Co-authored-by: njindal <njindal@adobe.com>
2023-05-05 07:23:50 -07:00
Pedro Cuenca
a640f1ba96 Write model card in controlnet training script (#3229)
Write model card in controlnet training script.
2023-05-05 07:23:50 -07:00
Pedro Cuenca
59986b6c56 [docs] only mention one stage (#3246)
* [docs] only mention one stage

* add blurb on auto accepting

---------

Co-authored-by: William Berman <WLBberman@gmail.com>
2023-05-05 07:23:50 -07:00
Patrick von Platen
163c33b5ff Post release for 0.16.0 (#3244)
* Post release

* fix more
2023-05-05 07:23:50 -07:00
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