Commit e6d4612
Support unittest for Z-image ⚡️ (#12715)
* Add Support for Z-Image.
* Reformatting with make style, black & isort.
* Remove init, Modify import utils, Merge forward in transformers block, Remove once func in pipeline.
* modified main model forward, freqs_cis left
* refactored to add B dim
* fixed stack issue
* fixed modulation bug
* fixed modulation bug
* fix bug
* remove value_from_time_aware_config
* styling
* Fix neg embed and devide / bug; Reuse pad zero tensor; Turn cat -> repeat; Add hint for attn processor.
* Replace padding with pad_sequence; Add gradient checkpointing.
* Fix flash_attn3 in dispatch attn backend by _flash_attn_forward, replace its origin implement; Add DocString in pipeline for that.
* Fix Docstring and Make Style.
* Revert "Fix flash_attn3 in dispatch attn backend by _flash_attn_forward, replace its origin implement; Add DocString in pipeline for that."
This reverts commit fbf26b7.
* update z-image docstring
* Revert attention dispatcher
* update z-image docstring
* styling
* Recover attention_dispatch.py with its origin impl, later would special commit for fa3 compatibility.
* Fix prev bug, and support for prompt_embeds pass in args after prompt pre-encode as List of torch Tensor.
* Remove einop dependency.
* remove redundant imports & make fix-copies
* fix import
* Support for num_images_per_prompt>1; Remove redundant unquote variables.
* Fix bugs for num_images_per_prompt with actual batch.
* Add unit tests for Z-Image.
* Refine unitest and skip for cases needed separate test env; Fix compatibility with unitest in model, mostly precision formating.
* Add clean env for test_save_load_float16 separ test; Add Note; Styling.
* Update dtype mentioned by yiyi.
---------
Co-authored-by: liudongyang <[email protected]>1 parent a88a7b4 commit e6d4612
File tree
3 files changed
+336
-28
lines changed- src/diffusers
- models/transformers
- pipelines/z_image
- tests/pipelines/z_image
3 files changed
+336
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
129 | 136 | | |
130 | 137 | | |
131 | 138 | | |
| |||
306 | 313 | | |
307 | 314 | | |
308 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
309 | 320 | | |
310 | 321 | | |
311 | 322 | | |
| |||
317 | 328 | | |
318 | 329 | | |
319 | 330 | | |
| 331 | + | |
320 | 332 | | |
321 | 333 | | |
322 | 334 | | |
| |||
553 | 565 | | |
554 | 566 | | |
555 | 567 | | |
556 | | - | |
557 | | - | |
558 | 568 | | |
559 | 569 | | |
560 | 570 | | |
| |||
572 | 582 | | |
573 | 583 | | |
574 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
575 | 588 | | |
576 | 589 | | |
577 | 590 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | 168 | | |
171 | 169 | | |
172 | 170 | | |
173 | 171 | | |
174 | 172 | | |
175 | | - | |
176 | 173 | | |
177 | 174 | | |
178 | 175 | | |
179 | 176 | | |
180 | 177 | | |
181 | | - | |
182 | | - | |
183 | 178 | | |
184 | 179 | | |
185 | 180 | | |
| |||
193 | 188 | | |
194 | 189 | | |
195 | 190 | | |
196 | | - | |
197 | | - | |
198 | 191 | | |
199 | 192 | | |
200 | 193 | | |
| |||
206 | 199 | | |
207 | 200 | | |
208 | 201 | | |
209 | | - | |
210 | | - | |
211 | 202 | | |
212 | 203 | | |
213 | 204 | | |
214 | | - | |
215 | 205 | | |
216 | 206 | | |
217 | 207 | | |
| |||
417 | 407 | | |
418 | 408 | | |
419 | 409 | | |
420 | | - | |
421 | | - | |
422 | 410 | | |
423 | 411 | | |
424 | 412 | | |
| |||
434 | 422 | | |
435 | 423 | | |
436 | 424 | | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | 425 | | |
442 | 426 | | |
443 | 427 | | |
| |||
455 | 439 | | |
456 | 440 | | |
457 | 441 | | |
458 | | - | |
459 | 442 | | |
460 | | - | |
461 | 443 | | |
462 | | - | |
463 | 444 | | |
464 | 445 | | |
465 | 446 | | |
| |||
475 | 456 | | |
476 | 457 | | |
477 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
478 | 467 | | |
479 | 468 | | |
480 | 469 | | |
| |||
523 | 512 | | |
524 | 513 | | |
525 | 514 | | |
526 | | - | |
| 515 | + | |
527 | 516 | | |
528 | 517 | | |
529 | 518 | | |
530 | 519 | | |
531 | | - | |
| 520 | + | |
532 | 521 | | |
533 | 522 | | |
534 | 523 | | |
| |||
543 | 532 | | |
544 | 533 | | |
545 | 534 | | |
546 | | - | |
547 | | - | |
| 535 | + | |
| 536 | + | |
548 | 537 | | |
549 | 538 | | |
550 | | - | |
| 539 | + | |
551 | 540 | | |
552 | 541 | | |
553 | 542 | | |
| |||
588 | 577 | | |
589 | 578 | | |
590 | 579 | | |
591 | | - | |
592 | 580 | | |
593 | 581 | | |
594 | 582 | | |
595 | 583 | | |
| 584 | + | |
596 | 585 | | |
597 | 586 | | |
598 | 587 | | |
| |||
0 commit comments