Commit 8dba180
Added support to create asymmetrical U-Net structures (huggingface#5400)
* Added args, kwargs to ```U
* Add UNetMidBlock2D as a supported mid block type
* Fix extra init input for UNetMidBlock2D, change allowed types for Mid-block init
* Update unet_2d_condition.py
* Update unet_2d_condition.py
* Update unet_2d_condition.py
* Update unet_2d_condition.py
* Update unet_2d_condition.py
* Update unet_2d_condition.py
* Update unet_2d_condition.py
* Update unet_2d_condition.py
* Update unet_2d_blocks.py
* Update unet_2d_blocks.py
* Update unet_2d_blocks.py
* Update unet_2d_condition.py
* Update unet_2d_blocks.py
* Updated docstring, increased check strictness
Updated the docstring for ```UNet2DConditionModel``` to include ```reverse_transformer_layers_per_block``` and updated checking for nested list type ```transformer_layers_per_block```
* Add basic shape-check test for asymmetrical unets
* Update src/diffusers/models/unet_2d_blocks.py
Removed blank line
Co-authored-by: Sayak Paul <[email protected]>
* Update unet_2d_condition.py
Remove blank space
* Update unet_2d_condition.py
Changed docstring for `mid_block_type`
* Fixed docstring and wrong default value
* Reformat with black
* Reformat with necessary commands
* Add UNetMidBlockFlat to versatile_diffusion/modeling_text_unet.py to ensure consistency
* Removed args, kwargs, use on mid-block type
* Make fix-copies
* Update src/diffusers/models/unet_2d_condition.py
Wrap into single line
Co-authored-by: Sayak Paul <[email protected]>
* make fix-copies
---------
Co-authored-by: Sayak Paul <[email protected]>1 parent 5366db5 commit 8dba180
File tree
7 files changed
+272
-46
lines changed- src/diffusers
- models
- pipelines
- alt_diffusion
- stable_diffusion
- versatile_diffusion
- tests/models
7 files changed
+272
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
| 637 | + | |
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
657 | 661 | | |
658 | 662 | | |
659 | 663 | | |
| |||
671 | 675 | | |
672 | 676 | | |
673 | 677 | | |
674 | | - | |
| 678 | + | |
675 | 679 | | |
676 | 680 | | |
677 | 681 | | |
678 | 682 | | |
679 | 683 | | |
680 | 684 | | |
681 | | - | |
| 685 | + | |
682 | 686 | | |
683 | 687 | | |
684 | 688 | | |
| |||
1018 | 1022 | | |
1019 | 1023 | | |
1020 | 1024 | | |
1021 | | - | |
| 1025 | + | |
1022 | 1026 | | |
1023 | 1027 | | |
1024 | 1028 | | |
| |||
1041 | 1045 | | |
1042 | 1046 | | |
1043 | 1047 | | |
| 1048 | + | |
| 1049 | + | |
1044 | 1050 | | |
1045 | 1051 | | |
1046 | 1052 | | |
| |||
1064 | 1070 | | |
1065 | 1071 | | |
1066 | 1072 | | |
1067 | | - | |
| 1073 | + | |
1068 | 1074 | | |
1069 | 1075 | | |
1070 | 1076 | | |
| |||
2167 | 2173 | | |
2168 | 2174 | | |
2169 | 2175 | | |
2170 | | - | |
| 2176 | + | |
2171 | 2177 | | |
2172 | 2178 | | |
2173 | 2179 | | |
| |||
2190 | 2196 | | |
2191 | 2197 | | |
2192 | 2198 | | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
2193 | 2202 | | |
2194 | 2203 | | |
2195 | 2204 | | |
| |||
2214 | 2223 | | |
2215 | 2224 | | |
2216 | 2225 | | |
2217 | | - | |
| 2226 | + | |
2218 | 2227 | | |
2219 | 2228 | | |
2220 | 2229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | | - | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
| |||
142 | 148 | | |
143 | 149 | | |
144 | 150 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| |||
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
187 | | - | |
| 193 | + | |
| 194 | + | |
188 | 195 | | |
189 | 196 | | |
190 | 197 | | |
| |||
265 | 272 | | |
266 | 273 | | |
267 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
268 | 279 | | |
269 | 280 | | |
270 | 281 | | |
| |||
500 | 511 | | |
501 | 512 | | |
502 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
503 | 527 | | |
504 | 528 | | |
505 | 529 | | |
| |||
513 | 537 | | |
514 | 538 | | |
515 | 539 | | |
516 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
517 | 545 | | |
518 | 546 | | |
519 | 547 | | |
| |||
1062 | 1090 | | |
1063 | 1091 | | |
1064 | 1092 | | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
1073 | 1105 | | |
1074 | 1106 | | |
1075 | 1107 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| |||
0 commit comments