Henrik Forstén
79eb3d07d0
Controlnet training ( #2545 )
...
* Controlnet training code initial commit
Works with circle dataset: https://github.com/lllyasviel/ControlNet/blob/main/docs/train.md
* Script for adding a controlnet to existing model
* Fix control image transform
Control image should be in 0..1 range.
* Add license header and remove more unused configs
* controlnet training readme
* Allow nonlocal model in add_controlnet.py
* Formatting
* Remove unused code
* Code quality
* Initialize controlnet in training script
* Formatting
* Address review comments
* doc style
* explicit constructor args and submodule names
* hub dataset
NOTE - not tested
* empty prompts
* add conditioning image
* rename
* remove instance data dir
* image_transforms -> -1,1 . conditioning_image_transformers -> 0, 1
* nits
* remove local rank config
I think this isn't necessary in any of our training scripts
* validation images
* proportion_empty_prompts typo
* weight copying to controlnet bug
* call log validation fix
* fix
* gitignore wandb
* fix progress bar and resume from checkpoint iteration
* initial step fix
* log multiple images
* fix
* fixes
* tracker project name configurable
* misc
* add controlnet requirements.txt
* update docs
* image labels
* small fixes
* log validation using existing models for pipeline
* fix for deepspeed saving
* memory usage docs
* Update examples/controlnet/train_controlnet.py
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/controlnet/train_controlnet.py
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/controlnet/README.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/controlnet/README.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/controlnet/README.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/controlnet/README.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/controlnet/README.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/controlnet/README.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/controlnet/README.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/controlnet/README.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* remove extra is main process check
* link to dataset in intro paragraph
* remove unnecessary paragraph
* note on deepspeed
* Update examples/controlnet/README.md
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
* assert -> value error
* weights and biases note
* move images out of git
* remove .gitignore
---------
Co-authored-by: William Berman <WLBberman@gmail.com >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-03-14 20:16:30 -07:00
aengusng8
268ebcb015
Add ddim noise comparative analysis pipeline ( #2665 )
...
* add DDIM Noise Comparative Analysis pipeline
* update README
* add comments
* run BLACK format
2023-03-14 18:09:55 +01:00
Will Berman
ebd44957fc
image generation main process checks ( #2631 )
2023-03-14 01:28:03 -07:00
Ruizhe Wang
ce08cb72fb
[Dreambooth] Editable number of class images ( #2251 )
...
* [Dreambooth] Editable number of class images
* 'class_num=None' bug fix
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-03-10 14:15:16 +01:00
Patrick von Platen
cbbad0af69
correct example
2023-03-08 20:14:19 +01:00
Haofan Wang
00132de359
Support LoRA for text encoder ( #2588 )
...
* add lora
* Update examples/research_projects/lora/README.md
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-03-08 20:14:01 +01:00
Michael Gartsbein
46bef6e31d
community stablediffusion controlnet img2img pipeline ( #2584 )
...
Co-authored-by: mishka <gartsocial@gmail.com >
2023-03-07 13:31:56 -08:00
zxypro
f0b661b8fb
[Docs]Fix invalid link to Pokemons dataset ( #2583 )
2023-03-07 14:26:09 +01:00
Isamu Isozaki
8552fd7efa
Added multitoken training for textual inversion. Issue 369 ( #661 )
...
* Added multitoken training for textual inversion
* Updated assertion
* Removed duplicate save code
* Fixed undefined bug
* Fixed save
* Added multitoken clip model +util helper
* Removed code splitting
* Removed class
* Fixed errors
* Fixed errors
* Added loading functionality
* Loading via dict instead
* Fixed bug of invalid index being loaded
* Fixed adding placeholder token only adding 1 token
* Fixed bug when initializing tokens
* Fixed bug when initializing tokens
* Removed flawed logic
* Fixed vector shuffle
* Fixed tokenizer's inconsistent __call__ method
* Fixed tokenizer's inconsistent __call__ method
* Handling list input
* Added exception for adding invalid tokens to token map
* Removed unnecessary files and started working on progressive tokens
* Set at minimum load one token
* Changed to global step
* Added method to load automatic1111 tokens
* Fixed bug in load
* Quality+style fixes
* Update quality/style fixes
* Cast embeddings to fp16 when loading
* Fixed quality
* Started moving things over
* Clearing diffs
* Clearing diffs
* Moved everything
* Requested changes
2023-03-07 12:09:36 +01:00
Pedro Cuenca
d3ce6f4b1e
Support revision in Flax text-to-image training ( #2567 )
...
Support revision in Flax text-to-image training.
2023-03-07 08:16:31 +01:00
Will Berman
ca7ca11bcd
community controlnet inpainting pipelines ( #2561 )
...
* community controlnet inpainting pipelines
* add community member attribution re: @pcuenca
2023-03-06 12:55:31 -08:00
YiYi Xu
c7da8fd233
add intermediate logging for dreambooth training script ( #2557 )
...
* add intermediate logging
---------
Co-authored-by: yiyixuxu <yixu310@gmail,com>
2023-03-06 08:13:12 -10:00
Patrick von Platen
b8bfef2ab9
make style
2023-03-06 19:11:45 +01:00
haixinxu
f3f626d556
Allow textual_inversion_flax script to use save_steps and revision flag ( #2075 )
...
* Update textual_inversion_flax.py
* Update textual_inversion_flax.py
* Typo
sorry.
* Format source
2023-03-06 19:11:27 +01:00
Patrick von Platen
56958e1177
[Training] Fix tensorboard typo ( #2566 )
2023-03-06 15:13:38 +01:00
Naga Sai Abhinay
2e3541d7f4
[Community Pipeline] Unclip Image Interpolation ( #2400 )
...
* unclip img interpolation poc
* Added code sample and refactoring.
2023-03-05 16:55:30 -08:00
Alex McKinney
5e5ce13e2f
adds xformers support to train_unconditional.py ( #2520 )
2023-03-03 18:35:59 +01:00
Patrick von Platen
3d2648d743
[Post release] Push post release ( #2546 )
2023-03-03 18:11:01 +01:00
Patrick von Platen
f20c8f5a1a
Release: v0.14.0
2023-03-03 16:45:08 +01:00
Isamu Isozaki
d9b9533c7e
Textual inv make save log both steps ( #2178 )
...
* Initial commit
* removed images
* Made logging the same as save
* Removed logging function
* Quality fixes
* Quality fixes
* Tested
* Added support back for validation_epochs
* Fixing styles
* Did changes
* Change to log_validation
* Add extra space after wandb import
* Add extra space after wandb
Co-authored-by: Will Berman <wlbberman@gmail.com >
* Fixed spacing
---------
Co-authored-by: Will Berman <wlbberman@gmail.com >
2023-03-02 19:04:18 +01:00
Patrick von Platen
eadf0e2555
[Copyright] 2023 ( #2524 )
2023-03-01 10:31:00 +01:00
Pedro Cuenca
5de4347663
Fix test train_unconditional ( #2481 )
...
* Fix tensorboard tracking with `accelerate` @ `main`
* Fix `train_unconditional.py` with accelerate from main.
2023-02-24 14:31:16 -08:00
Haofan Wang
589faa8c88
Update train_text_to_image_lora.py ( #2464 )
...
* Update train_text_to_image_lora.py
* Update train_text_to_image_lora.py
2023-02-23 11:08:21 +05:30
Patrick von Platen
3231712b7d
Post release 0.14
2023-02-17 23:57:46 +02:00
Patrick von Platen
b2c1e0d6d4
Release: v0.13.0
2023-02-17 23:38:05 +02:00
Will Berman
bfdffbea32
add xformers 0.0.16 warning message ( #2345 )
...
* add xformers 0.0.16 warning message
* fix version check to check whole version string
2023-02-17 13:25:46 -08:00
Will Berman
5979089713
Revert "Release: v0.13.0" ( #2405 )
...
This reverts commit 024c4376fb .
2023-02-17 10:48:16 -08:00
Patrick von Platen
024c4376fb
Release: v0.13.0
2023-02-17 18:46:00 +02:00
Patrick von Platen
ca980fd0d1
[Examples] Make sure EMA works with any device ( #2382 )
...
* Fix EMA
* up
* update
2023-02-16 21:27:47 +01:00
Will Berman
b214bb25f8
train_text_to_image EMAModel saving ( #2341 )
2023-02-16 14:40:28 +01:00
Damian Stewart
e3ddbe25ed
Fix 3-way merging with the checkpoint_merger community pipeline ( #2355 )
...
correctly locate 3rd file; also correct misleading docs
2023-02-16 10:52:41 +01:00
Will Berman
46def7265f
checkpointing_steps_total_limit->checkpoints_total_limit ( #2374 )
2023-02-16 00:28:58 -08:00
Will Berman
296b01e1a1
add total number checkpoints to training scripts ( #2367 )
...
* add total number checkpoints to training scripts
* Update examples/dreambooth/train_dreambooth.py
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2023-02-15 23:58:06 -08:00
Patrick von Platen
91925fbb76
Fix callback type hints - no optional function argument ( #2357 )
...
replace type hints
2023-02-14 14:35:05 -08:00
Ben Evans
0db19da01f
Log Unconditional Image Generation Samples to W&B ( #2287 )
...
* Log Unconditional Image Generation Samples to WandB
* Check for wandb installation and parity between onnxruntime script
* Log epoch to wandb
* Check for tensorboard logger early on
* style fixes
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-02-14 23:11:12 +01:00
Will Berman
9e8ee2ace1
dreambooth checkpointing tests and docs ( #2339 )
2023-02-13 14:16:32 -08:00
Naga Sai Abhinay
a688c7bdfb
[Community Pipeline] UnCLIP Text Interpolation Pipeline ( #2257 )
...
* UnCLIP Text Interpolation Pipeline
* Formatter fixes
* Changes based on feedback
* Formatting fix
* Formatting fix
* isort formatting fix(?)
* Remove duplicate code
* Formatting fix
* Refactor __call__ and change example in readme.
* Update examples/community/unclip_text_interpolation.py
Refactor to linter formatting
Co-authored-by: Will Berman <wlbberman@gmail.com >
---------
Co-authored-by: Will Berman <wlbberman@gmail.com >
2023-02-12 22:16:18 -08:00
Patrick von Platen
e83b43612b
make style
2023-02-10 13:07:46 +02:00
erkams
1be7df0205
[LoRA] Freezing the model weights ( #2245 )
...
* [LoRA] Freezing the model weights
Freeze the model weights since we don't need to calculate grads for them.
* Apply suggestions from code review
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
* Apply suggestions from code review
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
Co-authored-by: Suraj Patil <surajp815@gmail.com >
2023-02-09 11:45:11 +01:00
Patrick von Platen
62a15cec6e
make style
2023-02-09 12:27:44 +02:00
Ben Evans
f3c848383a
Run same number of DDPM steps in inference as training ( #2263 )
...
Resolves ValueError: `num_inference_steps`: 1000 cannot be larger than `self.config.train_timesteps`: 50 as the unet model trained with this scheduler can only handle maximal 50 timesteps.
2023-02-09 10:36:38 +01:00
Patrick von Platen
1ed6b77781
[Examples] Test all examples on CPU ( #2289 )
...
* [Examples] Test all examples on CPU
* add
* correct
* Apply suggestions from code review
2023-02-08 15:59:13 +01:00
Chenguo Lin
9d0d070996
EMA: fix state_dict() and load_state_dict() & add cur_decay_value ( #2146 )
...
* EMA: fix `state_dict()` & add `cur_decay_value`
* EMA: fix a bug in `load_state_dict()`
'float' object (`state_dict["power"]`) has no attribute 'get'.
* del train_unconditional_ort.py
2023-02-08 10:44:50 +01:00
Isamu Isozaki
c1971a53bc
Textual inv save log memory ( #2184 )
...
* Quality check and adding tokenizer
* Adapted stable diffusion to mixed precision+finished up style fixes
* Fixed based on patrick's review
* Fixed oom from number of validation images
* Removed unnecessary np.array conversion
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-02-08 10:37:10 +01:00
Patrick von Platen
a7ca03aa85
Replace flake8 with ruff and update black ( #2279 )
...
* before running make style
* remove left overs from flake8
* finish
* make fix-copies
* final fix
* more fixes
2023-02-07 23:46:23 +01:00
Patrick von Platen
f5ccffecf7
Use accelerate save & loading hooks to have better checkpoint structure ( #2048 )
...
* better accelerated saving
* up
* finish
* finish
* uP
* up
* up
* fix
* Apply suggestions from code review
* correct ema
* Remove @
* up
* Apply suggestions from code review
Co-authored-by: Pedro Cuenca <pedro@huggingface.co >
* Update docs/source/en/training/dreambooth.mdx
Co-authored-by: Pedro Cuenca <pedro@huggingface.co >
---------
Co-authored-by: Pedro Cuenca <pedro@huggingface.co >
2023-02-07 20:03:59 +01:00
wfng92
111228cb39
Fix torchvision.transforms and transforms function naming clash ( #2274 )
...
* Fix torchvision.transforms and transforms function naming clash
* Update unconditional script for onnx
* Apply suggestions from code review
Co-authored-by: Pedro Cuenca <pedro@huggingface.co >
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
Co-authored-by: Pedro Cuenca <pedro@huggingface.co >
2023-02-07 17:36:32 +01:00
wfng92
b1dad2e9d3
Make center crop and random flip as args for unconditional image generation ( #2259 )
...
* Add center crop and horizontal flip to args
* Update command to use center crop and random flip
* Add center crop and horizontal flip to args
* Update command to use center crop and random flip
2023-02-07 11:58:31 +01:00
Patrick von Platen
cd52475560
[Examples] Remove datasets important that is not needed ( #2267 )
...
* [Examples] Remove datasets important that is not needed
* remove from lora tambien
2023-02-07 11:55:34 +01:00
Patrick von Platen
3b66cc0fc1
make style
2023-02-07 08:11:22 +00:00