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

2497 Commits

Author SHA1 Message Date
Daniel Gu
5728328545 Fix code style with make style. 2023-05-09 09:02:05 -07:00
Daniel Gu
16fd515d3c Fix bugs and make improvements to the UniDiffuser pipeline:
- Improve batch size inference and fix bugs when num_images_per_prompt or num_prompts_per_image > 1
	- Add tests for num_images_per_prompt, num_prompts_per_image > 1
	- Improve check_inputs, especially regarding checking supplied latents
	- Add reset_mode method so that mode inference can be re-enabled after mode is set manually
	- Fix some warnings related to accessing class members directly instead of through their config
	- Small amount of refactoring in pipeline_unidiffuser.py
2023-05-09 08:54:43 -07:00
Daniel Gu
0cddc3cadb Add UniDiffuser dummy objects via make fix-copies. 2023-05-08 18:38:46 -07:00
Daniel Gu
34a40ad913 Make changes so that the repository consistency tests pass. 2023-05-08 18:30:39 -07:00
Daniel Gu
8dd7b0be2c Add fast test for checking UniDiffuser-v1 sampling. 2023-05-08 17:50:46 -07:00
Daniel Gu
54c495f175 Support using a data type embedding for UniDiffuser-v1. 2023-05-06 00:06:14 -07:00
Daniel Gu
fc540b5511 Fix code quality with make style. 2023-05-05 12:28:12 -07:00
Daniel Gu
e62b32aadc Add self.image_encoder, self.text_decoder to list of models to offload to CPU in the enable_sequential_cpu_offload(...)/enable_model_cpu_offload(...) methods to make test_cpu_offload_forward_pass pass. 2023-05-05 12:12:42 -07:00
Daniel Gu
1cb726a005 Merge branch 'main' into unidiffuser-pipeline 2023-05-05 09:23:41 -07:00
Isotr0py
0ffac97933 Add use_Karras_sigmas to LMSDiscreteScheduler (#3351)
* add karras sigma to lms discrete scheduler

* add test for lms_scheduler karras

* reformat test lms
2023-05-06 12:19:27 +01:00
Lysandre Debut
b0966f5801 Inpainting: typo in docs (#3331)
Typo in docs

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-06 12:13:33 +01:00
Lucca Zenóbio
0407c3e7d0 Fix pipeline class on README (#3345)
Update README.md
2023-05-06 12:06:52 +01:00
At-sushi
7ce3fa010a Fix TypeError when using prompt_embeds and negative_prompt (#2982)
* test: Added test case

* fix: fixed type checking issue on _encode_prompt

* fix: fixed copies consistency

* fix: one copy was not sufficient
2023-05-06 12:04:07 +01:00
Sanchit Gandhi
abd86d1c17 [AudioLDM] Generalise conversion script (#3328)
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-06 12:00:42 +01:00
Adrià Arrufat
e9aa0925a8 Rename --only_save_embeds to --save_as_full_pipeline (#3206)
* Set --only_save_embeds to False by default

Due to how the option is named, it makes more sense to behave like this.

* Refactor only_save_embeds to save_as_full_pipeline
2023-05-06 12:00:30 +01:00
Will Rice
36f43ea75a Add upsample_size to AttnUpBlock2D, AttnDownBlock2D (#3275)
The argument `upsample_size` needs to be added to these modules to allow compatibility with other blocks that require this argument.
2023-05-05 19:50:41 +01:00
Daniel Gu
9d39bef45f Revert "Fix code style with make style."
This reverts commit 10a174a12c.
2023-05-05 09:08:07 -07:00
Cheng Lu
27522b585b Add the SDE variant of DPM-Solver and DPM-Solver++ (#3344)
* add SDE variant of DPM-Solver and DPM-Solver++

* add test

* fix typo

* fix typo
2023-05-05 16:03:47 +01:00
Daniel Gu
fc8526354f Fix code with make style. 2023-05-05 07:55:15 -07:00
Daniel Gu
7097dd74f5 Update fast tests to use test checkpoints stored on the hub and to better match the reference UniDiffuser implementation. 2023-05-05 07:49:46 -07:00
Daniel Gu
434b255060 Add UniDiffuser classes to __init__ files, modify transformer block to support pre- and post-LN, add fast default tests, fix some bugs. 2023-05-05 07:49:46 -07:00
Will Rice
1d213def63 Add upsample_size to AttnUpBlock2D, AttnDownBlock2D (#3275)
The argument `upsample_size` needs to be added to these modules to allow compatibility with other blocks that require this argument.
2023-05-05 07:23:51 -07:00
Cheng Lu
652dbaad8d Add the SDE variant of DPM-Solver and DPM-Solver++ (#3344)
* add SDE variant of DPM-Solver and DPM-Solver++

* add test

* fix typo

* fix typo
2023-05-05 07:23:51 -07:00
Patrick von Platen
140ab748e8 Fix config dpm (#3343) 2023-05-05 07:23:51 -07:00
Patrick von Platen
458847e25b [Quality] Make style (#3341) 2023-05-05 07:23:51 -07:00
Sayak Paul
b4aa419f9b update controlling generation doc with latest goodies. (#3321) 2023-05-05 07:23:51 -07:00
Cesar Aybar
3e8d3d86ac Update write_own_pipeline.mdx (#3323) 2023-05-05 07:23:51 -07:00
Isamu Isozaki
79295870f7 Added input pretubation (#3292)
* Added input pretubation

* Fixed spelling
2023-05-05 07:23:51 -07:00
Steven Liu
0e8f4f0f49 [docs] Improve LoRA docs (#3311)
* update docs

* add to toctree

* apply feedback
2023-05-05 07:23:51 -07:00
Cheng Lu
7815c41f86 Fix multistep dpmsolver for cosine schedule (suitable for deepfloyd-if) (#3314)
* fix multistep dpmsolver for cosine schedule (deepfloy-if)

* fix a typo

* Update src/diffusers/schedulers/scheduling_dpmsolver_multistep.py

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

* Update src/diffusers/schedulers/scheduling_dpmsolver_multistep.py

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

* Update src/diffusers/schedulers/scheduling_dpmsolver_multistep.py

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

* Update src/diffusers/schedulers/scheduling_dpmsolver_multistep.py

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

* Update src/diffusers/schedulers/scheduling_dpmsolver_multistep.py

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

* update all dpmsolver (singlestep, multistep, dpm, dpm++) for cosine noise schedule

* add test, fix style

---------

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2023-05-05 07:23:51 -07:00
Markus Pobitzer
5ea342495a Add Stable Diffusion RePaint to community pipelines (#3320)
* Add Stable Diffsuion RePaint to community pipelines

- Adds Stable Diffsuion RePaint to community pipelines
- Add Readme enty for pipeline

* Fix: Remove wrong import

- Remove wrong import
- Minor change in comments

* Fix: Code formatting of stable_diffusion_repaint

* Fix: ruff errors in stable_diffusion_repaint
2023-05-05 07:23:51 -07:00
Patrick von Platen
5a75a8a153 Correct doc build for patch releases (#3316)
Update build_documentation.yml
2023-05-05 07:23:51 -07:00
Mylo
0d2206459e Fix missing variable assign in DeepFloyd-IF-II (#3315)
Fix missing variable assign

lol
2023-05-05 07:23:51 -07:00
Umar
d38b4d9555 Update stable_diffusion.mdx (#3310)
fixed import statement
2023-05-05 07:23:51 -07:00
Sayak Paul
6e8d065c39 fix: scale_lr and sync example readme and docs. (#3299)
* fix: scale_lr and sync example readme and docs.

* fix doc link.
2023-05-05 07:23:51 -07:00
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