Commit 7448258
authored
Add FLUX.2 Klein Inpaint Pipeline (#13050)
* Add Flux2KleinInpaintPipeline
* Fixed mask channel mismatch and a bit of cleaning
* Added tests and minor refactors
* Added support for reference images for inpainting
* Style fixes
* Fixed the example docstring
* Corrected mask latent preparation for correct dimensional alignment
* replace masked_image_latents context with clean_source_latents, fix mask spatial alignment and remove unused VAE encoding
* Fix T-coordinate collision for conditioning
* Changed the default strength from 0.6 to 0.8
* Added reference image test and updated the frozenset
* Validated ref image, latent passing support and fixed ref image preprocessing
* Refined preprocessing with 1MP resolution cap and timestep tracking
* Updated typing, improved validation and changed the example docstring
* Style fixes
* Fixed batch inference discrepancy and addressed review comments
* Fixed a typo
Co-authored-by: Álvaro Somoza <asomoza@users.noreply.github.com>
* Apply suggestion from @asomoza
Co-authored-by: Álvaro Somoza <asomoza@users.noreply.github.com>
* Reused encoded latents and fix channel check consistency
* fixed pre-encoded latent preprocessing for source and ref images
* Apply style fixes
* Updated the docstring with the shape requirements
* Apply style fixes
* Fixed copies1 parent 160852d commit 7448258
7 files changed
Lines changed: 1503 additions & 2 deletions
File tree
- src/diffusers
- pipelines
- flux2
- utils
- tests/pipelines/flux2
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| 536 | + | |
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
| |||
1317 | 1318 | | |
1318 | 1319 | | |
1319 | 1320 | | |
| 1321 | + | |
1320 | 1322 | | |
1321 | 1323 | | |
1322 | 1324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
164 | 169 | | |
165 | 170 | | |
166 | 171 | | |
| |||
697 | 702 | | |
698 | 703 | | |
699 | 704 | | |
700 | | - | |
| 705 | + | |
701 | 706 | | |
702 | 707 | | |
703 | 708 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| 53 | + | |
49 | 54 | | |
| 55 | + | |
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| 62 | + | |
56 | 63 | | |
| 64 | + | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| |||
0 commit comments