Sayak Paul
01240fecb0
[training ] add Kontext i2i training ( #11858 )
...
* feat: enable i2i fine-tuning in Kontext script.
* readme
* more checks.
* Apply suggestions from code review
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com >
* fixes
* fix
* add proj_mlp to the mix
* Update README_flux.md
add note on installing from commit `05e7a854d0a5661f5b433f6dd5954c224b104f0b`
* fix
* fix
---------
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com >
2025-07-08 21:04:16 +05:30
Sayak Paul
00f95b9755
Kontext training ( #11813 )
...
* support flux kontext
* make fix-copies
* add example
* add tests
* update docs
* update
* add note on integrity checker
* initial commit
* initial commit
* add readme section and fixes in the training script.
* add test
* rectify ckpt_id
* fix ckpt
* fixes
* change id
* update
* Update examples/dreambooth/train_dreambooth_lora_flux_kontext.py
Co-authored-by: Aryan <aryan@huggingface.co >
* Update examples/dreambooth/README_flux.md
---------
Co-authored-by: Aryan <aryan@huggingface.co >
Co-authored-by: linoytsaban <linoy@huggingface.co >
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com >
2025-06-26 19:31:42 +03:00
Sayak Paul
10c36e0b78
[chore] post release v0.34.0 ( #11800 )
...
* post release v0.34.0
* code quality
---------
Co-authored-by: YiYi Xu <yixu310@gmail.com >
2025-06-26 06:56:46 +05:30
imbr92
6760300202
Add --lora_alpha and metadata handling to train_dreambooth_lora_sana.py ( #11744 )
...
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com >
2025-06-23 15:46:44 +03:00
Sayak Paul
62cce3045d
[chore] change to 2025 licensing for remaining ( #11741 )
...
change to 2025 licensing for remaining
2025-06-18 20:56:00 +05:30
Leo Jiang
d72184eba3
[training] add ds support to lora hidream ( #11737 )
...
* [training] add ds support to lora hidream
* Apply style fixes
---------
Co-authored-by: J石页 <jiangshuo9@h-partners.com >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-06-18 09:26:02 +05:30
Linoy Tsaban
1bc6f3dc0f
[LoRA training] update metadata use for lora alpha + README ( #11723 )
...
* lora alpha
* Apply style fixes
* Update examples/advanced_diffusion_training/README_flux.md
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* fix readme format
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2025-06-17 12:19:27 +03:00
Sayak Paul
f0dba33d82
[training] show how metadata stuff should be incorporated in training scripts. ( #11707 )
...
* show how metadata stuff should be incorporated in training scripts.
* typing
* fix
---------
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com >
2025-06-16 16:42:34 +05:30
Linoy Tsaban
cc59505e26
[training docs] smol update to README files ( #11616 )
...
add comment to install prodigy
2025-05-27 06:26:54 -07:00
Quentin Gallouédec
c8bb1ff53e
Use HF Papers ( #11567 )
...
* Use HF Papers
* Apply style fixes
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-05-19 06:22:33 -10:00
Kenneth Gerald Hamilton
07dd6f8c0e
[train_dreambooth.py] Fix the LR Schedulers when num_train_epochs is passed in a distributed training env ( #11239 )
...
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2025-05-13 07:34:01 +05:30
Linoy Tsaban
66e50d4e24
[LoRA] make lora alpha and dropout configurable ( #11467 )
...
* add lora_alpha and lora_dropout
* Apply style fixes
* add lora_alpha and lora_dropout
* Apply style fixes
* revert lora_alpha until #11324 is merged
* Apply style fixes
* empty commit
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-05-08 11:54:50 +03:00
Sayak Paul
071807c853
[training] feat: enable quantization for hidream lora training. ( #11494 )
...
* feat: enable quantization for hidream lora training.
* better handle compute dtype.
* finalize.
* fix dtype.
---------
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com >
2025-05-05 20:44:35 +05:30
Evan Han
ee1516e5c7
[train_dreambooth_lora_lumina2] Add LANCZOS as the default interpolation mode for image resizing ( #11491 )
...
[ADD] interpolation
2025-05-05 10:41:33 -04:00
MinJu-Ha
ec9323996b
[train_dreambooth_lora_sdxl] Add --image_interpolation_mode option for image resizing (default to lanczos) ( #11490 )
...
feat(train_dreambooth_lora_sdxl): support --image_interpolation_mode with default to lanczos
2025-05-05 10:19:30 -04:00
co63oc
86294d3c7f
Fix typos in docs and comments ( #11416 )
...
* Fix typos in docs and comments
* Apply style fixes
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-30 20:30:53 -10:00
Linoy Tsaban
0ac1d5b482
[Hi-Dream LoRA] fix bug in validation ( #11439 )
...
remove unnecessary pipeline moving to cpu in validation
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2025-04-28 06:22:32 -10:00
Mert Erbak
bd96a084d3
[train_dreambooth_lora.py] Set LANCZOS as default interpolation mode for resizing ( #11421 )
...
* Set LANCZOS as default interpolation mode for resizing
* [train_dreambooth_lora.py] Set LANCZOS as default interpolation mode for resizing
2025-04-26 01:58:41 -04:00
co63oc
f00a995753
Fix typos in strings and comments ( #11407 )
2025-04-24 08:53:47 -10:00
Linoy Tsaban
edd7880418
[HiDream LoRA] optimizations + small updates ( #11381 )
...
* 1. add pre-computation of prompt embeddings when custom prompts are used as well
2. save model card even if model is not pushed to hub
3. remove scheduler initialization from code example - not necessary anymore (it's now if the base model's config)
4. add skip_final_inference - to allow to run with validation, but skip the final loading of the pipeline with the lora weights to reduce memory reqs
* pre encode validation prompt as well
* Update examples/dreambooth/train_dreambooth_lora_hidream.py
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/dreambooth/train_dreambooth_lora_hidream.py
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/dreambooth/train_dreambooth_lora_hidream.py
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* pre encode validation prompt as well
* Apply style fixes
* empty commit
* change default trained modules
* empty commit
* address comments + change encoding of validation prompt (before it was only pre-encoded if custom prompts are provided, but should be pre-encoded either way)
* Apply style fixes
* empty commit
* fix validation_embeddings definition
* fix final inference condition
* fix pipeline deletion in last inference
* Apply style fixes
* empty commit
* layers
* remove readme remarks on only pre-computing when instance prompt is provided and change example to 3d icons
* smol fix
* empty commit
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-24 07:48:19 +03:00
Ishan Dutta
4b60f4b602
[train_dreambooth_flux] Add LANCZOS as the default interpolation mode for image resizing ( #11395 )
2025-04-23 10:47:05 -04:00
Ameer Azam
026507c06c
Update README_hidream.md ( #11386 )
...
Small change
requirements_sana.txt to
requirements_hidream.txt
2025-04-22 20:08:26 -04:00
Linoy Tsaban
e30d3bf544
[LoRA] add LoRA support to HiDream and fine-tuning script ( #11281 )
...
* initial commit
* initial commit
* initial commit
* initial commit
* initial commit
* initial commit
* Update examples/dreambooth/train_dreambooth_lora_hidream.py
Co-authored-by: Bagheera <59658056+bghira@users.noreply.github.com >
* move prompt embeds, pooled embeds outside
* Update examples/dreambooth/train_dreambooth_lora_hidream.py
Co-authored-by: hlky <hlky@hlky.ac >
* Update examples/dreambooth/train_dreambooth_lora_hidream.py
Co-authored-by: hlky <hlky@hlky.ac >
* fix import
* fix import and tokenizer 4, text encoder 4 loading
* te
* prompt embeds
* fix naming
* shapes
* initial commit to add HiDreamImageLoraLoaderMixin
* fix init
* add tests
* loader
* fix model input
* add code example to readme
* fix default max length of text encoders
* prints
* nullify training cond in unpatchify for temp fix to incompatible shaping of transformer output during training
* smol fix
* unpatchify
* unpatchify
* fix validation
* flip pred and loss
* fix shift!!!
* revert unpatchify changes (for now)
* smol fix
* Apply style fixes
* workaround moe training
* workaround moe training
* remove prints
* to reduce some memory, keep vae in `weight_dtype` same as we have for flux (as it's the same vae)
bbd0c161b5/examples/dreambooth/train_dreambooth_lora_flux.py (L1207)
* refactor to align with HiDream refactor
* refactor to align with HiDream refactor
* refactor to align with HiDream refactor
* add support for cpu offloading of text encoders
* Apply style fixes
* adjust lr and rank for train example
* fix copies
* Apply style fixes
* update README
* update README
* update README
* fix license
* keep prompt2,3,4 as None in validation
* remove reverse ode comment
* Update examples/dreambooth/train_dreambooth_lora_hidream.py
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* Update examples/dreambooth/train_dreambooth_lora_hidream.py
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* vae offload change
* fix text encoder offloading
* Apply style fixes
* cleaner to_kwargs
* fix module name in copied from
* add requirements
* fix offloading
* fix offloading
* fix offloading
* update transformers version in reqs
* try AutoTokenizer
* try AutoTokenizer
* Apply style fixes
* empty commit
* Delete tests/lora/test_lora_layers_hidream.py
* change tokenizer_4 to load with AutoTokenizer as well
* make text_encoder_four and tokenizer_four configurable
* save model card
* save model card
* revert T5
* fix test
* remove non diffusers lumina2 conversion
---------
Co-authored-by: Bagheera <59658056+bghira@users.noreply.github.com >
Co-authored-by: hlky <hlky@hlky.ac >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-22 11:44:02 +03:00
Kenneth Gerald Hamilton
0dec414d5b
[train_dreambooth_lora_sdxl.py] Fix the LR Schedulers when num_train_epochs is passed in a distributed training env ( #11240 )
...
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com >
2025-04-21 12:51:03 +05:30
Linoy Tsaban
44eeba07b2
[Flux LoRAs] fix lr scheduler bug in distributed scenarios ( #11242 )
...
* add fix
* add fix
* Apply style fixes
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-21 10:08:45 +03:00
Sayak Paul
4b868f14c1
post release 0.33.0 ( #11255 )
...
* post release
* update
* fix deprecations
* remaining
* update
---------
Co-authored-by: YiYi Xu <yixu310@gmail.com >
2025-04-15 06:50:08 -10:00
Dhruv Nair
edc154da09
Update Ruff to latest Version ( #10919 )
...
* update
* update
* update
* update
2025-04-09 16:51:34 +05:30
Linoy Tsaban
71f34fc5a4
[Flux LoRA] fix issues in flux lora scripts ( #11111 )
...
* remove custom scheduler
* update requirements.txt
* log_validation with mixed precision
* add intermediate embeddings saving when checkpointing is enabled
* remove comment
* fix validation
* add unwrap_model for accelerator, torch.no_grad context for validation, fix accelerator.accumulate call in advanced script
* revert unwrap_model change temp
* add .module to address distributed training bug + replace accelerator.unwrap_model with unwrap model
* changes to align advanced script with canonical script
* make changes for distributed training + unify unwrap_model calls in advanced script
* add module.dtype fix to dreambooth script
* unify unwrap_model calls in dreambooth script
* fix condition in validation run
* mixed precision
* Update examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
* smol style change
* change autocast
* Apply style fixes
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-08 17:40:30 +03:00
Álvaro Somoza
723dbdd363
[Training] Better image interpolation in training scripts ( #11206 )
...
* initial
* Update examples/dreambooth/train_dreambooth_lora_sdxl.py
Co-authored-by: hlky <hlky@hlky.ac >
* update
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: hlky <hlky@hlky.ac >
2025-04-08 12:26:07 +05:30
Jun Yeop Na
37b8edfb86
[train_dreambooth_lora.py] Fix the LR Schedulers when num_train_epochs is passed in a distributed training env ( #10973 )
...
* updated train_dreambooth_lora to fix the LR schedulers for `num_train_epochs` in distributed training env
* fixed formatting
* remove trailing newlines
* fixed style error
2025-03-06 10:06:24 +05:30
Alexey Zolotenkov
b8215b1c06
Fix incorrect seed initialization when args.seed is 0 ( #10964 )
...
* Fix seed initialization to handle args.seed = 0 correctly
* Apply style fixes
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-04 10:09:52 -10:00
SahilCarterr
170833c22a
[Fix] fp16 unscaling in train_dreambooth_lora_sdxl ( #10889 )
...
Fix fp16 bug
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2025-02-24 06:49:23 -10:00
Sayak Paul
f10d3c6d04
[LoRA] add LoRA support to Lumina2 and fine-tuning script ( #10818 )
...
* feat: lora support for Lumina2.
* fix-copies.
* updates
* updates
* docs.
* fix
* add: training script.
* tests
* updates
* updates
* major updates.
* updates
* fixes
* docs.
* updates
* updates
2025-02-20 09:41:51 +05:30
Leo Jiang
cd0a4a82cf
[bugfix] NPU Adaption for Sana ( #10724 )
...
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* NPU Adaption for Sanna
* [bugfix]NPU Adaption for Sanna
---------
Co-authored-by: J石页 <jiangshuo9@h-partners.com >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2025-02-06 19:29:58 +05:30
hlky
41571773d9
[training] Convert to ImageFolder script ( #10664 )
...
* [training] Convert to ImageFolder script
* make
2025-01-27 09:43:51 -10:00
Leo Jiang
07860f9916
NPU Adaption for Sanna ( #10409 )
...
* NPU Adaption for Sanna
---------
Co-authored-by: J石页 <jiangshuo9@h-partners.com >
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2025-01-24 09:08:52 -10:00
Muyang Li
158a5a87fb
Remove the FP32 Wrapper when evaluating ( #10617 )
...
Remove the FP32 Wrapper
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com >
2025-01-21 16:16:54 +05:30
jiqing-feng
012d08b1bc
Enable dreambooth lora finetune example on other devices ( #10602 )
...
* enable dreambooth_lora on other devices
Signed-off-by: jiqing-feng <jiqing.feng@intel.com >
* enable xpu
Signed-off-by: jiqing-feng <jiqing.feng@intel.com >
* check cuda device before empty cache
Signed-off-by: jiqing-feng <jiqing.feng@intel.com >
* fix comment
Signed-off-by: jiqing-feng <jiqing.feng@intel.com >
* import free_memory
Signed-off-by: jiqing-feng <jiqing.feng@intel.com >
---------
Signed-off-by: jiqing-feng <jiqing.feng@intel.com >
2025-01-21 14:09:45 +05:30
Sayak Paul
4ace7d0483
[chore] change licensing to 2025 from 2024. ( #10615 )
...
change licensing to 2025 from 2024.
2025-01-20 16:57:27 -10:00
Leo Jiang
b0c8973834
[Sana 4K] Add vae tiling option to avoid OOM ( #10583 )
...
Co-authored-by: J石页 <jiangshuo9@h-partners.com >
2025-01-16 02:06:07 +05:30
Sayak Paul
5f72473543
[training] add ds support to lora sd3. ( #10378 )
...
* add ds support to lora sd3.
Co-authored-by: leisuzz <jiangshuonb@gmail.com >
* style.
---------
Co-authored-by: leisuzz <jiangshuonb@gmail.com >
Co-authored-by: Linoy Tsaban <57615435+linoytsaban@users.noreply.github.com >
2024-12-30 19:31:05 +05:30
Sayak Paul
92933ec36a
[chore] post release 0.32.0 ( #10361 )
...
* post release 0.32.0
* stylew
2024-12-23 10:03:34 -10:00
Sayak Paul
76e2727b5c
[SANA LoRA] sana lora training tests and misc. ( #10296 )
...
* sana lora training tests and misc.
* remove push to hub
* Update examples/dreambooth/train_dreambooth_lora_sana.py
Co-authored-by: Aryan <aryan@huggingface.co >
---------
Co-authored-by: Aryan <aryan@huggingface.co >
2024-12-23 12:35:13 +05:30
Sayak Paul
9c0e20de61
[chore] Update README_sana.md to update the default model ( #10285 )
...
Update README_sana.md to update the default model
2024-12-19 10:24:57 +05:30
Sayak Paul
63cdf9c0ba
[chore] fix: reamde -> readme ( #10276 )
...
fix: reamde -> readme
2024-12-18 10:56:08 +05:30
Sayak Paul
9408aa2dfc
[LoRA] feat: lora support for SANA. ( #10234 )
...
* feat: lora support for SANA.
* make fix-copies
* rename test class.
* attention_kwargs -> cross_attention_kwargs.
* Revert "attention_kwargs -> cross_attention_kwargs."
This reverts commit 23433bf9bc .
* exhaust 119 max line limit
* sana lora fine-tuning script.
* readme
* add a note about the supported models.
* Apply suggestions from code review
Co-authored-by: Aryan <aryan@huggingface.co >
* style
* docs for attention_kwargs.
* remove lora_scale from pag pipeline.
* copy fix
---------
Co-authored-by: Aryan <aryan@huggingface.co >
2024-12-18 08:22:31 +05:30
Ethan Smith
26e80e0143
fix min-snr implementation ( #8466 )
...
* fix min-snr implementation
https://github.com/kohya-ss/sd-scripts/blob/main/library/custom_train_functions.py#L66
* Update train_dreambooth.py
fix variable name mse_loss_weights
* fix divisor
* make style
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
Co-authored-by: YiYi Xu <yixu310@gmail.com >
2024-12-12 09:55:59 +05:30
SkyCol
074e12358b
Add prompt about wandb in examples/dreambooth/readme. ( #10014 )
...
Add files via upload
2024-11-25 18:42:06 +05:30
Linoy Tsaban
c4b5d2ff6b
[SD3 dreambooth lora] smol fix to checkpoint saving ( #9993 )
...
* smol change to fix checkpoint saving & resuming (as done in train_dreambooth_sd3.py)
* style
* modify comment to explain reasoning behind hidden size check
2024-11-24 18:51:06 +02:00
Linoy Tsaban
acf479bded
[advanced flux training] bug fix + reduce memory cost as in #9829 ( #9838 )
...
* memory improvement as done here: https://github.com/huggingface/diffusers/pull/9829
* fix bug
* fix bug
* style
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com >
2024-11-19 08:43:36 +05:30