Sayak Paul
6943a96d92
[LoRA PEFT] fix LoRA loading so that correct alphas are parsed ( #6225 )
...
* initialize alpha too.
* add: test
* remove config parsing
* store rank
* debug
* remove faulty test
2024-12-23 13:02:04 +05:30
apolinário
d53f44cd12
Fix Prodigy optimizer in SDXL Dreambooth script ( #6290 )
...
* Fix ProdigyOPT in SDXL Dreambooth script
* style
* style
2024-12-23 13:02:04 +05:30
Sayak Paul
288ceebea5
[T2I LoRA training] fix: unscale fp16 gradient problem ( #6119 )
...
* fix: unscale fp16 gradient problem
* fix for dreambooth lora sdxl
* make the type-casting conditional.
* Apply suggestions from code review
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-12-19 09:54:17 +05:30
Sayak Paul
b98b314b7a
[Training] remove depcreated method from lora scripts. ( #6207 )
...
remove depcreated method from lora scripts.
2023-12-18 15:52:43 +05:30
Younes Belkada
c2717317f0
[PEFT] Adapt example scripts to use PEFT ( #5388 )
...
* adapt example scripts to use PEFT
* Update examples/text_to_image/train_text_to_image_lora.py
* fix
* add for SDXL
* oops
* make sure to install peft
* fix
* fix
* fix dreambooth and lora
* more fixes
* add peft to requirements.txt
* fix
* final fix
* add peft version in requirements
* remove comment
* change variable names
* add few lines in readme
* add to reqs
* style
* fix issues
* fix lora dreambooth xl tests
* init_lora_weights to gaussian and add out proj where missing
* ammend requirements.
* ammend requirements.txt
* add correct peft versions
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2023-12-07 09:39:29 +05:30
Patrick von Platen
dadd55fb36
Post Release: v0.24.0 ( #5985 )
...
* Post Release: v0.24.0
* post pone deprecation
* post pone deprecation
* Add model_index.json
2023-12-01 18:43:44 +01:00
Linh Nguyen
636feba552
Rename output_dir argument ( #5916 )
...
Fix typo in output_dir argument: "text-inversion-model" → "dreambooth-model"
2023-11-29 15:47:16 +01:00
Sayak Paul
fdd003d8e2
[Tests] Refactor test_examples.py for better readability ( #5946 )
...
* control and custom diffusion
* dreambooth
* instructpix2pix and dreambooth ckpting
* t2i adapters.
* text to image ft
* textual inversion
* unconditional
* workflows
* import fix
* fix import
2023-11-29 18:43:59 +05:30
Patrick von Platen
6d2e19f746
[Examples] Allow downloading variant model files ( #5531 )
...
* add variant
* add variant
* Apply suggestions from code review
* reformat
* fix: textual_inversion.py
* fix: variant in model_info
---------
Co-authored-by: sayakpaul <spsayakpaul@gmail.com >
2023-11-27 10:43:20 +05:30
Linoy Tsaban
3003ff4947
[bug fix] fix small bug in readme template of sdxl lora training script ( #5914 )
...
readme improvement and metadata fix
2023-11-23 19:08:49 +01:00
Linoy Tsaban
5ffa603244
[bug fix] fix small bug in readme template of sdxl lora training script ( #5906 )
...
* readme bug fix
* style fix
---------
Co-authored-by: Linoy Tsaban <linoy@huggingface.co >
2023-11-23 12:11:50 +01:00
Patrick von Platen
13d73d9303
[Lora] Seperate logic ( #5809 )
...
* [Lora] Seperate logic
* [Lora] Seperate logic
* [Lora] Seperate logic
* add comments to explain the code better
* add comments to explain the code better
2023-11-21 18:58:37 +01:00
Linoy Tsaban
6fac1369d0
Add features to the Dreambooth LoRA SDXL training script ( #5508 )
...
* Additions:
- support for different lr for text encoder
- support for Prodigy optimizer
- support for min snr gamma
- support for custom captions and dataset loading from the hub
* adjusted --caption_column behaviour (to -not- use the second column of the dataset by default if --caption_column is not provided)
* fixed --output_dir / --model_dir_name confusion
* added --repeats, --adam_weight_decay_text_encoder
+ some fixes
* Update examples/dreambooth/train_dreambooth_lora_sdxl.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
* Update examples/dreambooth/train_dreambooth_lora_sdxl.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
* Update examples/dreambooth/train_dreambooth_lora_sdxl.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
* - import compute_snr from diffusers/training_utils.py
- cluster adamw together
- when using 'prodigy', if --train_text_encoder == True and --text_encoder_lr != --learning rate, changes the lr of the text encoders optimization params to be --learning_rate (otherwise errors)
* shape fixes when custom captions are used
* formatting and a little cleanup
* code styling
* --repeats default value fixed, changed to 1
* bug fix - removed redundant lines of embedding concatenation when using prior_preservation (that duplicated class_prompt embeddings)
* changed dataset loading logic according to the following usecases (to avoid unnecessary dependency on datasets)-
1. user provides --dataset_name
2. user provides local dir --instance_data_dir that contains a metadata .jsonl file
3. user provides local dir --instance_data_dir that contains only images
in cases [1,2] we import datasets and use load_dataset method, in case [3] we process the data same as in the original script setting
* styling fix
* arg name fix
* adjusted the --repeats logic
* -removed redundant arg and 'if' when loading local folder with prompts
-updated readme template
-some default val fixes
-custom caption tests
* image path fix for readme
* code style
* bug fix
* --caption_column arg
* readme fix
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
Co-authored-by: Linoy Tsaban <linoy@huggingface.co >
2023-11-21 17:38:43 +01:00
Lucain
c896b841e4
Set usedforsecurity=False in hashlib methods (FIPS compliance) ( #5790 )
...
* Set usedforsecurity=False in hashlib methods (FIPS compliance)
* update version dependency
* bump hfh version
* bump hfh version
2023-11-17 14:56:58 +01:00
Sayak Paul
ded93f798c
[Refactor] refactor loaders.py to make it cleaner and leaner. ( #5771 )
...
* refactor loaders.py to make it cleaner and leaner.
* refactor loaders init
* inits.
* textual inversion to the init.
* inits.
* remove certain modules from the main init.
* AttnProcsLayers
* fix imports
* avoid circular import.
* fix circular import pt 2.
* address PR comments
* imports
* fix: imports.
* remove from main init for avoiding circular deps.
* remove spurious deps.
* fix-copies.
* fix imports.
* more debug
* more debug
* Apply suggestions from code review
* Apply suggestions from code review
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-11-14 12:54:28 +01:00
Sayak Paul
1477865e48
post release v0.23.0 ( #5730 )
...
* post release
* fix: variant test
* up
* fix: test
2023-11-10 16:35:44 +05:30
Sayak Paul
64603389da
post release (v0.22.0) ( #5658 )
...
post release
2023-11-06 16:23:38 +01:00
jiaqiw09
e140c0562e
fix error reported 'find_unused_parameters' running in mutiple GPUs ( #5355 )
...
* fix error reported 'find_unused_parameters' running in mutiple GPUs or NPUs
* fix code check of importing module by its alphabetic order
---------
Co-authored-by: jiaqiw <wangjiaqi50@huawei.com >
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com >
2023-10-27 22:49:14 +05:30
nickkolok
0d4b459be6
Update train_dreambooth.py - fix typos ( #5539 )
2023-10-26 13:35:05 -07:00
Patrick von Platen
1ade42f729
make style
2023-10-23 19:43:54 +02:00
Shyam Marjit
677df5ac12
fixed SDXL text encoder training bug #5016 ( #5078 )
...
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2023-10-23 19:43:43 +02:00
Sayak Paul
cc12f3ec92
[Examples] Update with HFApi ( #5393 )
...
* update training examples to use HFAPI.
* update training example.
* reflect the changes in the korean version too.
* Empty-Commit
2023-10-16 19:34:46 +05:30
Heinz-Alexander Fuetterer
0ea78f9707
chore: fix typos ( #5386 )
...
* chore: fix typos
* Update src/diffusers/pipelines/shap_e/renderer.py
Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com >
---------
Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com >
2023-10-16 15:23:37 +02:00
Sayak Paul
0fa32bd674
[Examples] use loralinear instead of depecrecated lora attn procs. ( #5331 )
...
* use loralinear instead of depecrecated lora attn procs.
* fix parameters()
* fix saving
* add back support for add kv proj.
* fix: param accumul,ation.
* propagate the changes.
2023-10-11 13:02:42 +02:00
Zeng Xian
0513a8cfd8
fix typo in train dreambooth lora description ( #5332 )
2023-10-08 14:54:33 +02:00
Sayak Paul
d56825e4b4
fix: how print training resume logs. ( #5117 )
...
* fix: how print training resume logs.
* propagate changes to text-to-image scripts.
* propagate changes to instructpix2pix.
* propagate changes to dreambooth
* propagate changes to custom diffusion and instructpix2pix
* propagate changes to kandinsky
* propagate changes to textual inv.
* debug
* fix: checkpointing.
* debug
* debug
* debug
* back to the square
* debug
* debug
* change condition order.
* debug
* debug
* debug
* debug
* revert to original
* clean
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
2023-10-02 18:29:52 +02:00
Sayak Paul
cdcc01be0e
[Examples] add compute_snr() to training utils. ( #5188 )
...
add compute_snr() to training utils.
2023-09-27 21:42:20 +05:30
Bagheera
d558811b26
Min-SNR gamma support for Dreambooth training ( #5107 )
...
* min-SNR gamma for Dreambooth training
* Align the mse_loss_weights style with SDXL training example
---------
Co-authored-by: bghira <bghira@users.github.com >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2023-09-21 22:53:06 +01:00
Patrick von Platen
342c5c02c0
[Release 0.21] Bump version ( #5018 )
...
* [Release 0.21] Bump version
* fix & remove
* fix more
* fix all, upload
2023-09-14 18:28:57 +02:00
Will Berman
d73e6ad050
guard save model hooks to only execute on main process ( #4929 )
2023-09-08 10:30:06 -07:00
Will Berman
7e5587a5ac
instance_prompt->class_prompt ( #4784 )
2023-08-25 20:06:55 +02:00
Sayak Paul
4447547eda
[Examples] fix sdxl dreambooth lora checkpointing. ( #4749 )
...
* fix sdxl dreambooth lora checkpointing.
* style
2023-08-25 09:50:02 +05:30
Yinzhen Wang
d185b5ed5f
change validation scheduler for train_dreambooth.py when training IF ( #4333 )
...
* dreambooth training
* train_dreambooth validation scheduler
* set a particular scheduler via a string
* modify readme after setting a particular scheduler via a string
* modify readme after setting a particular scheduler
* use importlib to set a particular scheduler
* import with correct sort
2023-08-23 22:18:17 +02:00
Sayak Paul
d0c30cfd37
make post-release ( #4650 )
2023-08-17 14:16:25 +05:30
Patrick von Platen
029fb41695
[Safetensors] Make safetensors the default way of saving weights ( #4235 )
...
* make safetensors default
* set default save method as safetensors
* update tests
* update to support saving safetensors
* update test to account for safetensors default
* update example tests to use safetensors
* update example to support safetensors
* update unet tests for safetensors
* fix failing loader tests
* fix qc issues
* fix pipeline tests
* fix example test
---------
Co-authored-by: Dhruv Nair <dhruv.nair@gmail.com >
2023-08-17 10:54:28 +05:30
Sayak Paul
e731ae0ec8
Update README_sdxl.md to include the free-tier Colab Notebook ( #4540 )
...
Update README_sdxl.md
2023-08-09 14:32:14 +05:30
Patrick von Platen
4367b8a300
move pipeline only when running validation ( #4515 )
2023-08-07 17:20:18 +02:00
Patrick von Platen
e1b5b8ba13
Make sure fp16-fix is used as default ( #4510 )
...
* Make sue fp16-fix is used as default
* fix vae
* finish
* fix
2023-08-07 15:16:37 +02:00
Patrick von Platen
dff5ff35a9
[SDXL LoRA] fix batch size lora ( #4509 )
...
fix batch size lora
2023-08-07 13:27:13 +02:00
Vladislav Artemyev
2e69cf16fe
Log global_step instead of epoch to tensorboard ( #4493 )
...
Co-authored-by: mrlzla <noname@noname.com >
2023-08-07 07:49:39 +05:30
Patrick von Platen
ea1fcc28a4
[SDXL] Allow SDXL LoRA to be run with less than 16GB of VRAM ( #4470 )
...
* correct
* correct blocks
* finish
* finish
* finish
* Apply suggestions from code review
* fix
* up
* up
* up
* Update examples/dreambooth/README_sdxl.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Apply suggestions from code review
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2023-08-04 20:06:38 +02:00
Patrick von Platen
66de221409
Update README_sdxl.md ( #4472 )
2023-08-04 16:23:35 +02:00
Levi McCallum
4188f3063a
Add rank argument to train_dreambooth_lora_sdxl.py ( #4343 )
...
* Add rank argument to train_dreambooth_lora_sdxl.py
* Update train_dreambooth_lora_sdxl.py
2023-08-03 23:27:30 +05:30
Will Berman
160474ac61
train dreambooth fix pre encode class prompt ( #4395 )
2023-08-01 12:00:05 -07:00
Sayak Paul
4a4cdd6b07
[Feat] Support SDXL Kohya-style LoRA ( #4287 )
...
* sdxl lora changes.
* better name replacement.
* better replacement.
* debugging
* debugging
* debugging
* debugging
* debugging
* remove print.
* print state dict keys.
* print
* distingisuih better
* debuggable.
* fxi: tyests
* fix: arg from training script.
* access from class.
* run style
* debug
* save intermediate
* some simplifications for SDXL LoRA
* styling
* unet config is not needed in diffusers format.
* fix: dynamic SGM block mapping for SDXL kohya loras (#4322 )
* Use lora compatible layers for linear proj_in/proj_out (#4323 )
* improve condition for using the sgm_diffusers mapping
* informative comment.
* load compatible keys and embedding layer maaping.
* Get SDXL 1.0 example lora to load
* simplify
* specif ranks and hidden sizes.
* better handling of k rank and hidden
* debug
* debug
* debug
* debug
* debug
* fix: alpha keys
* add check for handling LoRAAttnAddedKVProcessor
* sanity comment
* modifications for text encoder SDXL
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* denugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* up
* up
* up
* up
* up
* up
* unneeded comments.
* unneeded comments.
* kwargs for the other attention processors.
* kwargs for the other attention processors.
* debugging
* debugging
* debugging
* debugging
* improve
* debugging
* debugging
* more print
* Fix alphas
* debugging
* debugging
* debugging
* debugging
* debugging
* debugging
* clean up
* clean up.
* debugging
* fix: text
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com >
Co-authored-by: Batuhan Taskaya <batuhan@python.org >
2023-07-28 19:49:49 +02:00
Patrick von Platen
b7b6d6138d
[SDXL] Make watermarker optional under certain circumstances to improve usability of SDXL 1.0 ( #4346 )
...
* improve sdxl
* more fixes
* improve sdxl
* improve sdxl
* improve sdxl
* finish
2023-07-28 19:29:22 +02:00
Sayak Paul
961173064d
Honor the SDXL 1.0 licensing from the training scripts. ( #4319 )
...
* honor the original license.
* train_instruct_pix2pix_xl -> train_instruct_pix2pix_sdxl
2023-07-28 01:28:36 +05:30
Xinyang Li
01b6ec21fa
fix validation option for dreambooth training example ( #4317 )
2023-07-27 09:58:52 -07:00
Patrick von Platen
20e92586c1
0.20.0dev0 ( #4299 )
...
* 0.20.0dev0
* make style
2023-07-26 23:06:18 +02:00
Patrick von Platen
6a6dfe1cbd
Rename ( #4294 )
...
* up
* Apply suggestions from code review
* Apply suggestions from code review
* up
2023-07-26 20:41:21 +02:00