Skip to content

Commit f6b4e1a

Browse files
authored
Merge pull request #1422 from bghira/bugfix/sana-pipeline-bucket-4k
make imports more backwards-compatible
2 parents f2f1a6d + 659a81f commit f6b4e1a

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

helpers/models/sana/pipeline.py

+43-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
retrieve_timesteps,
4444
)
4545
from diffusers.pipelines.sana.pipeline_sana import (
46-
ASPECT_RATIO_4096_BIN,
4746
SanaPipelineOutput,
4847
)
4948
import ftfy
@@ -60,6 +59,49 @@
6059
else:
6160
XLA_AVAILABLE = False
6261

62+
ASPECT_RATIO_4096_BIN = {
63+
"0.25": [2048.0, 8192.0],
64+
"0.26": [2048.0, 7936.0],
65+
"0.27": [2048.0, 7680.0],
66+
"0.28": [2048.0, 7424.0],
67+
"0.32": [2304.0, 7168.0],
68+
"0.33": [2304.0, 6912.0],
69+
"0.35": [2304.0, 6656.0],
70+
"0.4": [2560.0, 6400.0],
71+
"0.42": [2560.0, 6144.0],
72+
"0.48": [2816.0, 5888.0],
73+
"0.5": [2816.0, 5632.0],
74+
"0.52": [2816.0, 5376.0],
75+
"0.57": [3072.0, 5376.0],
76+
"0.6": [3072.0, 5120.0],
77+
"0.68": [3328.0, 4864.0],
78+
"0.72": [3328.0, 4608.0],
79+
"0.78": [3584.0, 4608.0],
80+
"0.82": [3584.0, 4352.0],
81+
"0.88": [3840.0, 4352.0],
82+
"0.94": [3840.0, 4096.0],
83+
"1.0": [4096.0, 4096.0],
84+
"1.07": [4096.0, 3840.0],
85+
"1.13": [4352.0, 3840.0],
86+
"1.21": [4352.0, 3584.0],
87+
"1.29": [4608.0, 3584.0],
88+
"1.38": [4608.0, 3328.0],
89+
"1.46": [4864.0, 3328.0],
90+
"1.67": [5120.0, 3072.0],
91+
"1.75": [5376.0, 3072.0],
92+
"2.0": [5632.0, 2816.0],
93+
"2.09": [5888.0, 2816.0],
94+
"2.4": [6144.0, 2560.0],
95+
"2.5": [6400.0, 2560.0],
96+
"2.89": [6656.0, 2304.0],
97+
"3.0": [6912.0, 2304.0],
98+
"3.11": [7168.0, 2304.0],
99+
"3.62": [7424.0, 2048.0],
100+
"3.75": [7680.0, 2048.0],
101+
"3.88": [7936.0, 2048.0],
102+
"4.0": [8192.0, 2048.0],
103+
}
104+
63105

64106
class SanaImg2ImgPipeline(DiffusionPipeline, SanaLoraLoaderMixin):
65107
r"""

0 commit comments

Comments
 (0)