Commit Graph

723 Commits

Author SHA1 Message Date
Anton Lozhkov 62b3efe351
Fix SD example typo 2022-08-22 09:25:55 +02:00
anton-l 21ceda3f6c Remove duplicate add_noise 2022-08-22 09:12:42 +02:00
Suraj Patil 5321f3e203
add add_noise method in LMSDiscreteScheduler, PNDMScheduler (#227)
add add_noise method in more schedulers
2022-08-22 08:38:07 +02:00
Nathan Lambert 3f1861ee46
hotfix for pdnm test (#220) 2022-08-22 07:23:59 +02:00
Pedro Cuenca 6a03060c45
Restore `is_modelcards_available` in `.utils` (#224)
Restore `is_modelcards_available` in `.utils`.

Otherwise attempting to import `hub_utils` (in training scripts, for
example), fails.

This was removed during the refactor in df90f0c.
2022-08-22 07:21:29 +02:00
Pedro Cuenca 2b7669183e
Update README for 0.2.3 release (#225)
* Update README for 0.2.3 release:

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2022-08-21 23:59:46 +02:00
Patrick von Platen e7b69cbe19 [Safety Checker] Lower adjustment value 2022-08-21 15:29:10 +00:00
Anton Lozhkov 3cde81408f
Add incompatibility note for SD (temporary) 2022-08-20 12:02:32 +02:00
Pedro Cuenca 71ba8aec55
Pipeline to device (#210)
* Implement `pipeline.to(device)`

* DiffusionPipeline.to() decides best device on None.

* Breaking change: torch_device removed from __call__

`pipeline.to()` now has PyTorch semantics.

* Use kwargs and deprecation notice

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

* Apply torch_device compatibility to all pipelines.

* style

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: anton-l <anton@huggingface.co>
2022-08-19 18:39:08 +02:00
Suraj Patil 89e9521048
fix safety check (#217) 2022-08-19 18:04:58 +05:30
Suraj Patil 65ea7d6b62
Add safety module (#213)
* add SafetyChecker

* better name, fix checker

* add checker in main init

* remove from main init

* update logic to detect pipeline module

* style

* handle all safety logic in safety checker

* draw text

* can't draw

* small fixes

* treat special care as nsfw

* remove commented lines

* update safety checker
2022-08-19 15:24:03 +05:30
Anton Lozhkov e30e1b89d0
Support one-string prompts and custom image size in LDM (#212)
* Support one-string prompts in LDM

* Add other features from SD too
2022-08-18 17:55:15 +02:00
Anton Lozhkov df90f0ce98
Add `is_torch_available`, `is_flax_available` (#204)
* Add is_<framework>_available, refactor import utils

* deps

* quality
2022-08-17 16:47:20 +02:00
Anton Lozhkov ed22b4fd07
Revive `make quality` (#203)
* Revive Make utils

* Add datasets for training too
2022-08-17 15:22:04 +02:00
Suraj Patil f9522d825c
[StableDiffusionPipeline] use default params in __call__ (#196)
use default params in __call__
2022-08-17 17:06:12 +05:30
Suraj Patil 80e0c8ba9e
fix stable-diffusion code snippet format. 2022-08-17 14:15:00 +05:30
Suraj Patil 3cd20d59d7
fix test_from_pretrained_hub_pass_model (#194)
init pipeline once
2022-08-17 13:58:18 +05:30
apolinario e36a36788e
Match params with official Stable Diffusion lib (#192)
https://github.com/CompVis/stable-diffusion
2022-08-16 22:52:22 +02:00
Patrick von Platen 4b02f53e62 Release: v0.2.2 2022-08-16 19:30:08 +02:00
Patrick von Platen 27d11a0094
[K-LMS Scheduler] fix import (#191) 2022-08-16 19:25:45 +02:00
Patrick von Platen 554e67cb06
Update README.md 2022-08-16 19:12:25 +02:00
Patrick von Platen 45cb500667
Update README.md 2022-08-16 19:10:35 +02:00
Patrick von Platen 8c78e73fef
Update README.md 2022-08-16 19:09:09 +02:00
anton-l c1b378db69 Release: v0.2.1 2022-08-16 18:22:45 +02:00
Patrick von Platen b50a9ae383 [Stable diffusion] Hot fix 2022-08-16 16:17:32 +00:00
anton-l ea2e177c1d Release: v0.2.0 2022-08-16 17:39:50 +02:00
Pedro Cuenca 513f1fbfb0
Allow passing non-default modules to pipeline (#188)
* Allow passing non-default modules to pipeline.

Override modules are recognized and replaced in the pipeline. However,
no check is performed about mismatched classes yet. This is because the
override module is already instantiated and we have no library or class
name to compare against.

* up

* add test

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2022-08-16 17:25:25 +02:00
Anton Lozhkov d7b692083c
Add K-LMS scheduler from k-diffusion (#185)
* test LMS with LDM

* test LMS with LDM

* Interchangeable sigma and timestep. Added dummy objects

* Debug

* cuda generator

* Fix derivatives

* Update tests

* Rename Lms->LMS
2022-08-16 16:48:35 +02:00
Patrick von Platen 9070c394aa
[Naming] correct config naming of DDIM pipeline (#187) 2022-08-16 15:50:36 +02:00
Patrick von Platen 194ed794d8
[PNDM] Stable diffusion (#186)
* [PNDM] Stable diffusino

* finish
2022-08-16 15:33:13 +02:00
Patrick von Platen 051b34635f
[Half precision] Make sure half-precision is correct (#182)
* [Half precision] Make sure half-precision is correct

* Update src/diffusers/models/unet_2d.py

* Update src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py

* correct some tests

* Apply suggestions from code review

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

* finalize

* finish

Co-authored-by: Suraj Patil <surajp815@gmail.com>
2022-08-16 10:42:24 +02:00
Suraj Patil 5f25818a0f
allow custom height, width in StableDiffusionPipeline (#179)
* allow custom height width

* raise if height width are not mul of 8
2022-08-15 10:28:03 +05:30
Suraj Patil c25d8c905c
add tests for stable diffusion pipeline (#178)
add tests for sd pipeline
2022-08-14 18:51:02 +05:30
Suraj Patil 5782e0393d
Stable diffusion pipeline (#168)
* add stable diffusion pipeline

* get rid of multiple if/else

* batch_size is unused

* add type hints

* Update src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py

* fix some bugs

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
2022-08-14 14:43:14 +02:00
Suraj Patil 92b6dbba1a
[LDM pipeline] fix eta condition. (#171)
fix typo in condirion
2022-08-13 12:32:01 +05:30
Suraj Patil c72e343085
[PNDM in LDM pipeline] use inspect in pipeline instead of unused kwargs (#167)
use inspect instead of unused kwargs
2022-08-12 20:29:54 +05:30
Suraj Patil 3228eb1609
allow pndm scheduler to be used with ldm pipeline (#165) 2022-08-11 14:58:14 +05:30
Suraj Patil c1488ff348
add scaled_linear schedule in PNDM and DDPM (#164) 2022-08-11 14:56:12 +05:30
Suraj Patil b344c953a8
add attention up/down blocks for VAE (#161) 2022-08-10 16:38:32 +05:30
Anton Lozhkov dd10da76a7
Add an alternative Karras et al. stochastic scheduler for VE models (#160)
* karras + VE, not flexible yet

* Fix inputs incompatibility with the original unet

* Roll back sigma scaling

* Apply suggestions from code review

* Old comment

* Fix doc
2022-08-09 15:58:30 +02:00
Suraj Patil 543ee1e092
[LDMTextToImagePipeline] make text model generic (#162)
make text model generic
2022-08-09 19:16:17 +05:30
Pedro Cuenca 75b6c16567
Minor typos (#159) 2022-08-06 21:59:41 +02:00
Pedro Cuenca c4ae7c2421
Fix arg key for `dataset_name` in `create_model_card` (#158)
Fix arg key for `dataset_name`

The example training script was changed in #152, but not
`create_model_card`.
2022-08-06 21:59:12 +02:00
Suraj Patil a2090375ca
[VAE] fix the downsample block in Encoder. (#156)
* pass downsample_padding in encoder

* update tests
2022-08-06 17:36:07 +05:30
Suraj Patil c4a3b09a36
[UNet2DConditionModel] add cross_attention_dim as an argument (#155)
add cross_attention_dim as an argument
2022-08-05 18:12:03 +05:30
Sugato Ray 616c3a42cb
Added `diffusers` to conda-forge and updated README for installation instruction (#129)
add instruction to install with conda

Co-authored-by: Anton Lozhkov <anton@huggingface.co>
2022-08-03 16:46:23 +02:00
Omar Sanseviero d23cf98769
Add issue templates for feature requests and bug reports (#153)
* Add issue template for feature requests and bug reports

* Update .github/ISSUE_TEMPLATE/config.yml

Co-authored-by: Anton Lozhkov <anton@huggingface.co>
2022-08-03 16:38:37 +02:00
Anton Lozhkov eeb9264acd
Support training with a local image folder (#152)
* Support training with an image folder

* style
2022-08-03 15:25:00 +02:00
Eyal Mazuz b6447fa87e
Allow DDPM scheduler to use model's predicated variance (#132)
* Extented the ability of ddpm scheduler
to utilize model that also predict the variance.

* Update src/diffusers/schedulers/scheduling_ddpm.py

Co-authored-by: Anton Lozhkov <aglozhkov@gmail.com>
2022-08-03 12:40:04 +02:00
anton-l b6cadcef98 Release: 0.1.3 2022-07-28 10:27:32 +02:00