Commit Graph

1223 Commits

Author SHA1 Message Date
Duong A. Nguyen 1e07b6b334
[Flax SD finetune] Fix dtype (#1038)
fix jnp dtype
2022-10-28 11:21:34 +02:00
Anton Lozhkov fb38bb1621
Support grayscale images in `numpy_to_pil` (#1025) 2022-10-27 22:44:35 +02:00
Pi Esposito de00c63217
Document sequential CPU offload method on Stable Diffusion pipeline (#1024)
* document cpu offloading method

* address review comments

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

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2022-10-27 16:52:21 +02:00
Anton Lozhkov a6314a8d4e
Add `--dataloader_num_workers` to the DDPM training example (#1027) 2022-10-27 15:55:36 +02:00
Denis 939ec17e91
Probably nicer to specify dependency on tensorboard in the training example (#998)
tensorboard import in readme, otherwise accelerator.trackers[0] out of range

Co-authored-by: lukovnikov <lukovnikov@users.noreply.github.com>
2022-10-27 15:55:18 +02:00
Suraj Patil eceeebdf91
Update train_dreambooth.py 2022-10-27 15:51:11 +02:00
Suraj Patil 52f2128dc6
update readme for flax examples (#1026) 2022-10-27 15:25:25 +02:00
Anton Lozhkov fbcc383340
Deprecate `init_git_repo`, refactor `train_unconditional.py` (#1022)
Deprecate `init_git_repo` and `push_to_hub`, refactor `train_unconditional.py`
2022-10-27 15:16:59 +02:00
Duong A. Nguyen 90f91adb0e
[Flax] Add DreamBooth (#1001)
* [Flax] Add DreamBooth

* fix sample rng

* style

* not reuse rng

* add dtype for mixed precision training

* Add Flax example
2022-10-27 14:25:04 +02:00
Duong A. Nguyen 4623f095f3
[DreamBooth] Set train mode for text encoder (#1012)
Set train mode for text encoder
2022-10-27 14:19:13 +02:00
Duong A. Nguyen abe058221c
[Flax] Add finetune Stable Diffusion (#999)
* [Flax] Add finetune Stable Diffusion

* temporary fix

* drop_last and seed

* add dtype for mixed precision training

* style

* Add Flax example
2022-10-27 14:08:21 +02:00
Patrick von Platen 3be9fa97d6
[Accelerate model loading] Fix meta device and super low memory usage (#1016)
* [Accelerate model loading] Fix meta device and super low memory usage

* better naming
2022-10-27 12:11:42 +02:00
Suraj Patil e92a603cab fix dreambooth script. (#1017)
make input_args optional
2022-10-27 11:44:06 +02:00
Pedro Cuenca 1d04e1b4de
Continuation of #942: additional float64 failure (#996)
* Add failing test for #940.

* Do not use torch.float64 in mps.

* style

* Temporarily skip add_noise for IPNDMScheduler.

Until #990 is addressed.

* Fix additional float64 error in mps.

* Improve add_noise test

* Slight edit – I think it's clearer this way.
2022-10-27 10:21:40 +02:00
Duong A. Nguyen a23ad87d7a
[Flax] Add Textual Inversion (#880)
* add textual inversion flax

* make style

* make style

* replicate vae and unet params

* make style

* minor

* save after end of training

* style

* Temporary fix

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

* Add Flax instruction

Co-authored-by: Suraj Patil <surajp815@gmail.com>
2022-10-26 22:28:55 +02:00
Brian Whicheloe d3d22ce5a8
Small modification to enable usage by external scripts (#956)
* Make training code usable by external scripts

Add parameter inputs to training and argument parsing function to allow this script to be used by an external call.

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2022-10-26 18:46:56 +02:00
Simon Kirsten 8332c1a6d9
Enable multi-process DataLoader for dreambooth (#950) 2022-10-26 17:24:48 +02:00
Hu Ye bd06dd023f
[inpaint pipeline] fix bug for multiple prompts inputs (#959) 2022-10-26 16:41:57 +02:00
Pi Esposito b2e2d1411c
minimal stable diffusion GPU memory usage with accelerate hooks (#850)
* add method to enable cuda with minimal gpu usage to stable diffusion

* add test to minimal cuda memory usage

* ensure all models but unet are onn torch.float32

* move to cpu_offload along with minor internal changes to make it work

* make it test against accelerate master branch

* coming back, its official: I don't know how to make it test againt the master branch from accelerate

* make it install accelerate from master on tests

* go back to accelerate>=0.11

* undo prettier formatting on yml files

* undo prettier formatting on yml files againn
2022-10-26 15:52:57 +02:00
Julien Simon 2f0fcf4fa8
Add missing import (#979) 2022-10-26 15:45:39 +02:00
Yuta Hayashibe cc436087d3
Fix typos (#978) 2022-10-26 15:32:47 +02:00
Hu Ye d7d6841406
fix a bug in the new version (#957)
remove tensor_format in the new version
2022-10-26 14:26:17 +02:00
Patrick von Platen d9cfe325a5
CompVis -> diffusers script - allow converting from merged checkpoint to either EMA or non-EMA (#991)
* improve script

* up
2022-10-26 12:32:07 +02:00
Pedro Cuenca 0343d8f531
Do not use torch.float64 on the mps device (#942)
* Add failing test for #940.

* Do not use torch.float64 in mps.

* style

* Temporarily skip add_noise for IPNDMScheduler.

Until #990 is addressed.
2022-10-26 11:56:43 +02:00
Yuta Hayashibe 4b9f58952a
Add --pretrained_model_name_revision option to train_dreambooth.py (#933)
* Add --pretrained_model_name_revision option to train_dreambooth.py

* Renamed --pretrained_model_name_revision to --revision
2022-10-25 21:38:23 +02:00
Ella Charlaix e2243de5f2
Fix typo in documentation title (#975) 2022-10-25 20:20:16 +02:00
Patrick von Platen 59f0ce82eb
[Dance Diffusion] Better naming (#981)
uP
2022-10-25 19:52:41 +02:00
Patrick von Platen 365ff8f76d
[Dance Diffusion] FP16 (#980)
* add in fp16

* up
2022-10-25 19:33:43 +02:00
Patrick von Platen 88fa6b7d68
[Dance Diffusion] Add dance diffusion (#803)
* start

* add more logic

* Update src/diffusers/models/unet_2d_condition_flax.py

* match weights

* up

* make model work

* making class more general, fixing missed file rename

* small fix

* make new conversion work

* up

* finalize conversion

* up

* first batch of variable renamings

* remove c and c_prev var names

* add mid and out block structure

* add pipeline

* up

* finish conversion

* finish

* upload

* more fixes

* Apply suggestions from code review

* add attr

* up

* uP

* up

* finish tests

* finish

* uP

* finish

* fix test

* up

* naming consistency in tests

* Apply suggestions from code review

Co-authored-by: Suraj Patil <surajp815@gmail.com>
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Co-authored-by: Nathan Lambert <nathan@huggingface.co>
Co-authored-by: Anton Lozhkov <anton@huggingface.co>

* remove hardcoded 16

* Remove bogus

* fix some stuff

* finish

* improve logging

* docs

* upload

Co-authored-by: Nathan Lambert <nol@berkeley.edu>
Co-authored-by: Suraj Patil <surajp815@gmail.com>
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Co-authored-by: Nathan Lambert <nathan@huggingface.co>
Co-authored-by: Anton Lozhkov <anton@huggingface.co>
2022-10-25 18:39:25 +02:00
SkyTNT 0b42b074b4
[Onnx] support half-precision and fix bugs for onnx pipelines (#932)
* [Onnx] support half-precision and fix bugs for onnx pipelines

* Update convert_stable_diffusion_checkpoint_to_onnx.py

* style

* fix has_nsfw_concept

* Update convert_stable_diffusion_checkpoint_to_onnx.py

* fix style
2022-10-25 16:48:53 +02:00
Pedro Cuenca 3d02c92187
mps changes for PyTorch 1.13 (#926)
* Docs: refer to pre-RC version of PyTorch 1.13.0.

* Remove temporary workaround for unavailable op.

* Update comment to make it less ambiguous.

* Remove use of contiguous in mps.

It appears to not longer be necessary.

* Special case: use einsum for much better performance in mps

* Update mps docs.

* Minor doc update.

* Accept suggestion

Co-authored-by: Anton Lozhkov <anton@huggingface.co>

Co-authored-by: Anton Lozhkov <anton@huggingface.co>
2022-10-25 16:41:51 +02:00
Anton Lozhkov 28b134e627
[Tests] Fix `mps` reproducibility issue when running with pytest-xdist (#976)
* [WIP] Debugging mps DDIM tests

* revert num_steps

* check warmup with a generator

* more warmup!

* remove xdist

* just use a single process
2022-10-25 15:28:08 +02:00
Kashif Rasul 240abddfbc
[Flax] added broadcast_to_shape_from_left helper and Scheduler tests (#864)
* added broadcast_to_shape_from_left helper

* initial tests

* fixed pndm tests

* shape required for pndm

* added require_flax

* fix style

* fix more imports

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2022-10-25 13:43:24 +02:00
MarkRich 38ae5a25da
Add Composable diffusion to community pipeline examples (#951)
* Initial composable diffusion pipeline

* add composable stable diffusion to readme table

* Update examples/community/README.md

* Apply suggestions from code review

* Update examples/community/README.md

* Update examples/community/README.md

* Update examples/community/README.md

* up

* Update examples/community/README.md

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2022-10-25 13:30:27 +02:00
Tanishq Abraham 6e099e2c8c
add num_inference_steps arg to DDPM (#935) 2022-10-25 13:08:56 +02:00
Pedro Cuenca 82044153df
Fix typo: `torch_type` -> `torch_dtype` (#972)
Fix typo: torch_type -> torch_dtype
2022-10-25 13:05:44 +02:00
Nathan Lambert 2fb8fafa4b
add community pipeline docs; add minimal text to some empty doc pages (#930)
* add community pipeline docs

* fix style in code snippets (lol)

* clean up loading docs

* add license to doc files

* fix some weird links
2022-10-24 14:20:08 -07:00
apolinario 8aac1f99d7
v1-5 docs updates (#921)
* Update README.md

Additionally add FLAX so the model card can be slimmer and point to this page

* Find and replace all

* v-1-5 -> v1-5

* revert test changes

* Update README.md

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

* Update docs/source/quicktour.mdx

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

* Update README.md

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

* Update docs/source/quicktour.mdx

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

* Update README.md

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

* Revert certain references to v1-5

* Docs changes

* Apply suggestions from code review

Co-authored-by: apolinario <joaopaulo.passos+multimodal@gmail.com>
Co-authored-by: anton-l <anton@huggingface.co>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Co-authored-by: Suraj Patil <surajp815@gmail.com>
2022-10-24 22:50:23 +02:00
Anton Lozhkov 2c82e0c4eb
Reorganize pipeline tests (#963)
* Reorganize pipeline tests

* fix vq
2022-10-24 16:34:01 +02:00
Chenguo Lin 2d35f6733a
fix a small typo in pipeline_ddpm.py (#948)
one small typo in pipeline_ddpm.py

just a small typo in one comment
2022-10-24 11:18:32 +02:00
Kashif Rasul 9bca40296e
[MPS] fix mps failing tests (#934)
fix mps failing tests
2022-10-22 09:33:40 +02:00
Shyam Sudhakaran 2fdd094c10
Wildcard stable diffusion pipeline (#900)
* Initial Wildcard Stable Diffusion Pipeline

* Added some additional example usage

* style

* Added links in README and additional documentation

* Initial Wildcard Stable Diffusion Pipeline

* Added some additional example usage

* style

* Added links in README and additional documentation

* cleanup readme again

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2022-10-21 17:43:19 +02:00
mkshing 31af4d17e8
Support LMSDiscreteScheduler in LDMPipeline (#891)
* Support LMSDiscreteScheduler in LDMPipeline

This is a small change to support all schedulers such as LMSDiscreteScheduler in LDMPipeline.

What's changed
-------
* Add the `scale_model_input` function before `step` to ensure correct denoising (L77)

* Add "scale the initial noise by the standard deviation required by the scheduler"

* run `make style`

Co-authored-by: Anton Lozhkov <anton@huggingface.co>
2022-10-21 15:38:09 +02:00
Suraj Patil dec18c8632
[Flax] dont warn for bf16 weights (#923)
dont warn for bf16 weights
2022-10-21 13:13:36 +02:00
Patrick von Platen 25dfd0f8dc
[Tests] Move stable diffusion into their own files (#936)
* [Tests] Move stable diffusion into their own files

* up
2022-10-21 12:49:52 +02:00
Anton Lozhkov 32bf4fdc43
Introduce the copy mechanism (#924)
* Introduce the copy mechanism

* init tests

* fix dummy tests

* with

* update copies tests
2022-10-20 20:26:03 +02:00
Anton Lozhkov cc36f2e7ff
Bump the version to 0.7.0.dev0 (#912)
* Bump the version to 0.7.0.dev0

* deprecate offsets

* deprecate LMS timesteps

* LMS 0.7.0->0.8.0
2022-10-20 20:25:20 +02:00
SkyTNT ba74a8be7a
[Community Pipelines] Fix pad_tokens_and_weights in lpw_stable_diffusion (#925)
[Community Pipelines] fix pad_tokens_and_weights in lpw_stable_diffusion
2022-10-20 19:26:04 +02:00
Krishna Penukonda 6f6eef747c
Fix Compatibility with Nvidia NGC Containers (#919)
Check if MPS backend is registered before calling is_available()
2022-10-20 19:23:42 +02:00
Suraj Patil 8be48507a0
fix test_components (#928) 2022-10-20 16:25:12 +02:00