Commit 2bfa55f
* v1
* add tests and fix previous failing tests
* fix CI
* add tests + v1 `PeftLayerScaler`
* style
* add scale retrieving mechanism system
* fix CI
* up
* up
* simple approach --> not same results for some reason
* fix issues
* fix copies
* remove unneeded method
* active adapters!
* fix merge conflicts
* up
* up
* kohya - test-1
* Apply suggestions from code review
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* fix scale
* fix copies
* add comment
* multi adapters
* fix tests
* oops
* v1 faster loading - in progress
* Revert "v1 faster loading - in progress"
This reverts commit ac925f8.
* kohya same generation
* fix some slow tests
* peft integration features for unet lora
1. Support for Multiple ranks/alphas
2. Support for Multiple active adapters
3. Support for enabling/disabling LoRAs
* fix `get_peft_kwargs`
* Update loaders.py
* add some tests
* add unfuse tests
* fix tests
* up
* add set adapter from sourab and tests
* fix multi adapter tests
* style & quality
* style
* remove comment
* fix `adapter_name` issues
* fix unet adapter name for sdxl
* fix enabling/disabling adapters
* fix fuse / unfuse unet
* nit
* fix
* up
* fix cpu offloading
* fix another slow test
* fix another offload test
* add more tests
* all slow tests pass
* style
* fix alpha pattern for unet and text encoder
* Update src/diffusers/loaders.py
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
* Update src/diffusers/models/attention.py
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
* up
* up
* clarify comment
* comments
* change comment order
* change comment order
* stylr & quality
* Update tests/lora/test_lora_layers_peft.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* fix bugs and add tests
* Update src/diffusers/models/modeling_utils.py
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
* Update src/diffusers/models/modeling_utils.py
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
* refactor
* suggestion
* add break statemebt
* add compile tests
* move slow tests to peft tests as I modified them
* quality
* refactor a bit
* style
* change import
* style
* fix CI
* refactor slow tests one last time
* style
* oops
* oops
* oops
* final tweak tests
* Apply suggestions from code review
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* Update src/diffusers/loaders.py
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* comments
* Apply suggestions from code review
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* remove comments
* more comments
* try
* revert
* add `safe_merge` tests
* add comment
* style, comments and run tests in fp16
* add warnings
* fix doc test
* replace with `adapter_weights`
* add `get_active_adapters()`
* expose `get_list_adapters` method
* better error message
* Apply suggestions from code review
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
* style
* trigger slow lora tests
* fix tests
* maybe fix last test
* revert
* Update src/diffusers/loaders.py
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
* Update src/diffusers/loaders.py
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
* Update src/diffusers/loaders.py
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
* Update src/diffusers/loaders.py
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* move `MIN_PEFT_VERSION`
* Apply suggestions from code review
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* let's not use class variable
* fix few nits
* change a bit offloading logic
* check earlier
* rm unneeded block
* break long line
* return empty list
* change logic a bit and address comments
* add typehint
* remove parenthesis
* fix
* revert to fp16 in tests
* add to gpu
* revert to old test
* style
* Update src/diffusers/loaders.py
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
* change indent
* Apply suggestions from code review
* Apply suggestions from code review
---------
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Sourab Mangrulkar <13534540+pacman100@users.noreply.github.com>
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
1 parent 9bc55e8 commit 2bfa55f
File tree
51 files changed
+2271
-322
lines changed- src/diffusers
- models
- pipelines
- alt_diffusion
- controlnet
- stable_diffusion_xl
- stable_diffusion
- t2i_adapter
- text_to_video_synthesis
- unidiffuser
- versatile_diffusion
- utils
- tests/lora
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
51 files changed
+2271
-322
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
| 304 | + | |
303 | 305 | | |
304 | 306 | | |
305 | 307 | | |
| |||
316 | 318 | | |
317 | 319 | | |
318 | 320 | | |
319 | | - | |
| 321 | + | |
320 | 322 | | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
324 | 326 | | |
| 327 | + | |
325 | 328 | | |
326 | | - | |
| 329 | + | |
327 | 330 | | |
328 | 331 | | |
329 | 332 | | |
| |||
368 | 371 | | |
369 | 372 | | |
370 | 373 | | |
371 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
372 | 377 | | |
373 | 378 | | |
374 | 379 | | |
| |||
377 | 382 | | |
378 | 383 | | |
379 | 384 | | |
380 | | - | |
| 385 | + | |
| 386 | + | |
381 | 387 | | |
382 | 388 | | |
383 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
144 | | - | |
145 | | - | |
| 149 | + | |
| 150 | + | |
146 | 151 | | |
147 | 152 | | |
148 | 153 | | |
149 | 154 | | |
150 | 155 | | |
151 | | - | |
152 | | - | |
| 156 | + | |
| 157 | + | |
153 | 158 | | |
154 | 159 | | |
155 | | - | |
| 160 | + | |
156 | 161 | | |
157 | 162 | | |
158 | 163 | | |
| |||
545 | 550 | | |
546 | 551 | | |
547 | 552 | | |
| 553 | + | |
| 554 | + | |
548 | 555 | | |
549 | 556 | | |
550 | 557 | | |
| |||
562 | 569 | | |
563 | 570 | | |
564 | 571 | | |
565 | | - | |
| 572 | + | |
566 | 573 | | |
567 | 574 | | |
568 | 575 | | |
569 | 576 | | |
570 | 577 | | |
571 | 578 | | |
572 | | - | |
573 | | - | |
| 579 | + | |
| 580 | + | |
574 | 581 | | |
575 | 582 | | |
576 | 583 | | |
| |||
581 | 588 | | |
582 | 589 | | |
583 | 590 | | |
584 | | - | |
| 591 | + | |
585 | 592 | | |
586 | 593 | | |
587 | 594 | | |
| |||
1007 | 1014 | | |
1008 | 1015 | | |
1009 | 1016 | | |
1010 | | - | |
| 1017 | + | |
| 1018 | + | |
1011 | 1019 | | |
1012 | 1020 | | |
1013 | 1021 | | |
1014 | 1022 | | |
1015 | 1023 | | |
1016 | 1024 | | |
1017 | | - | |
1018 | | - | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1019 | 1031 | | |
1020 | 1032 | | |
1021 | 1033 | | |
| |||
1035 | 1047 | | |
1036 | 1048 | | |
1037 | 1049 | | |
1038 | | - | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1039 | 1053 | | |
1040 | 1054 | | |
1041 | 1055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| 170 | + | |
169 | 171 | | |
170 | | - | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| |||
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
183 | | - | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
| 192 | + | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
| |||
292 | 295 | | |
293 | 296 | | |
294 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
295 | 445 | | |
296 | 446 | | |
297 | 447 | | |
| |||
0 commit comments