Commit 5990014
[WIP]Vae preprocessor refactor (PR1) (huggingface#3557)
VaeImageProcessor.preprocess refactor
* refactored VaeImageProcessor
- allow passing optional height and width argument to resize()
- add convert_to_rgb
* refactored prepare_latents method for img2img pipelines so that if we pass latents directly as image input, it will not encode it again
* added a test in test_pipelines_common.py to test latents as image inputs
* refactored img2img pipelines that accept latents as image:
- controlnet img2img, stable diffusion img2img , instruct_pix2pix
---------
Co-authored-by: yiyixuxu <yixu310@gmail,com>
Co-authored-by: Patrick von Platen <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
Co-authored-by: Sayak Paul <[email protected]>1 parent 1a6a647 commit 5990014
File tree
38 files changed
+624
-344
lines changed- src/diffusers
- pipelines
- alt_diffusion
- controlnet
- repaint
- stable_diffusion
- unidiffuser
- tests/pipelines
- altdiffusion
- controlnet
- stable_diffusion_2
- stable_diffusion
- stable_unclip
38 files changed
+624
-344
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
72 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
73 | 89 | | |
74 | 90 | | |
75 | 91 | | |
| |||
80 | 96 | | |
81 | 97 | | |
82 | 98 | | |
83 | | - | |
| 99 | + | |
84 | 100 | | |
85 | 101 | | |
86 | 102 | | |
| |||
101 | 117 | | |
102 | 118 | | |
103 | 119 | | |
104 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
105 | 134 | | |
106 | 135 | | |
107 | 136 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
112 | 147 | | |
113 | 148 | | |
114 | 149 | | |
115 | 150 | | |
| 151 | + | |
| 152 | + | |
116 | 153 | | |
117 | 154 | | |
118 | 155 | | |
| |||
126 | 163 | | |
127 | 164 | | |
128 | 165 | | |
| 166 | + | |
| 167 | + | |
129 | 168 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 169 | + | |
| 170 | + | |
133 | 171 | | |
134 | 172 | | |
135 | 173 | | |
| |||
146 | 184 | | |
147 | 185 | | |
148 | 186 | | |
149 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
150 | 193 | | |
151 | 194 | | |
152 | 195 | | |
| |||
Lines changed: 33 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| |||
538 | 543 | | |
539 | 544 | | |
540 | 545 | | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | 546 | | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
552 | 550 | | |
553 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
554 | 564 | | |
555 | | - | |
| 565 | + | |
556 | 566 | | |
557 | 567 | | |
558 | 568 | | |
| |||
586 | 596 | | |
587 | 597 | | |
588 | 598 | | |
589 | | - | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
590 | 607 | | |
591 | 608 | | |
592 | 609 | | |
| |||
609 | 626 | | |
610 | 627 | | |
611 | 628 | | |
612 | | - | |
| 629 | + | |
613 | 630 | | |
614 | | - | |
| 631 | + | |
| 632 | + | |
615 | 633 | | |
616 | 634 | | |
617 | 635 | | |
| |||
0 commit comments