Spaces:
Runtime error
Runtime error
File size: 1,240 Bytes
60ae8ae |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# https://arxiv.org/abs/2307.01952, Appendix I
SD_XL_BASE_RATIOS = {
"0.25": (512, 2048),
"0.26": (512, 1984),
"0.27": (512, 1920),
"0.28": (512, 1856),
"0.32": (576, 1792),
"0.33": (576, 1728),
"0.35": (576, 1664),
"0.4": (640, 1600),
"0.42": (640, 1536),
"0.48": (704, 1472),
"0.5": (704, 1408),
"0.52": (704, 1344),
"0.57": (768, 1344),
"0.6": (768, 1280),
"0.68": (832, 1216),
"0.72": (832, 1152),
"0.78": (896, 1152),
"0.82": (896, 1088),
"0.88": (960, 1088),
"0.94": (960, 1024),
"1.0": (1024, 1024),
"1.07": (1024, 960),
"1.13": (1088, 960),
"1.21": (1088, 896),
"1.29": (1152, 896),
"1.38": (1152, 832),
"1.46": (1216, 832),
"1.67": (1280, 768),
"1.75": (1344, 768),
"2.0": (1408, 704),
"2.09": (1472, 704),
"2.4": (1536, 640),
"2.5": (1600, 640),
"2.89": (1664, 576),
"3.0": (1728, 576),
"3.11": (1792, 576),
"3.62": (1856, 512),
"3.75": (1920, 512),
"3.88": (1984, 512),
"4.0": (2048, 512),
}
def get_resolution_string(width, height):
return str(width) + '×' + str(height)
resolutions = {get_resolution_string(v[0], v[1]):v for v in SD_XL_BASE_RATIOS.values()}
|