Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It turns out there's a much more ratio and resolutions to add for SDXL #2

Closed
marhensa opened this issue Aug 12, 2023 · 2 comments
Closed

Comments

@marhensa
Copy link
Owner

marhensa commented Aug 12, 2023

https://arxiv.org/abs/2307.01952

https://arxiv.org/pdf/2307.01952.pdf

image

@marhensa
Copy link
Owner Author

marhensa commented Aug 13, 2023

adding this now

    # Accepted aspect ratios and corresponding XSIZE, YSIZE, and NUMRATIO

    # Accepted aspect ratios and pixel size is derived from this SDXL paper
    # https://arxiv.org/abs/2307.01952 https://arxiv.org/pdf/2307.01952.pdf
    # Page 17 "We use the following image resolutions for mixed-aspect ratio finetuning as described in Section 2.3"
    
# Horizontal aspect ratio
accepted_ratios_horizontal = {
    "4:1": (2048, 512, 4.000000000),
    "31:8": (1984, 512, 3.875000000),
    "15:4": (1920, 512, 3.750000000),
    "29:8": (1856, 512, 3.625000000),
    "28:9": (1792, 576, 3.111111111),
    "3:1": (1728, 576, 3.000000000),
    "26:9": (1664, 576, 2.888888889),
    "5:2": (1600, 640, 2.500000000),
    "12:5": (1536, 640, 2.400000000),
    "23:11": (1472, 704, 2.090909091),
    "2:1": (1408, 704, 2.000000000),
    "21:11": (1344, 704, 1.909090909),
    "7:4": (1344, 768, 1.750000000),
    "5:3": (1280, 768, 1.666666667),
    "19:13": (1216, 832, 1.461538462),
    "18:13": (1152, 832, 1.384615385),
    "9:7": (1152, 896, 1.285714286),
    "17:14": (1088, 896, 1.214285714),
    "17:15": (1088, 960, 1.133333333),
    "16:15": (1024, 960, 1.066666667)
}

# Vertical aspect ratio
accepted_ratios_vertical = {
    "15:16": (960, 1024, 0.937500000),
    "15:17": (960, 1088, 0.882352941),
    "14:17": (896, 1088, 0.823529412),
    "7:9": (896, 1152, 0.777777778),
    "13:18": (832, 1152, 0.722222222),
    "13:19": (832, 1216, 0.684210526),
    "3:5": (768, 1280, 0.600000000),
    "4:7": (768, 1344, 0.571428571),
    "11:21": (704, 1344, 0.523809524),
    "1:2": (704, 1408, 0.500000000),
    "11:23": (704, 1472, 0.478260870),
    "5:12": (640, 1536, 0.416666667),
    "2:5": (640, 1600, 0.400000000),
    "9:26": (576, 1664, 0.346153846),
    "1:3": (576, 1728, 0.333333333),
    "9:28": (576, 1792, 0.321428571),
    "8:29": (512, 1856, 0.275862069),
    "4:15": (512, 1920, 0.266666667),
    "8:31": (512, 1984, 0.258064516),
    "1:4": (512, 2048, 0.250000000)
    }
    
# Square aspect ratio
accepted_ratios_square = {
    "1:1": (1024, 1024, 1.00000000)
}

@marhensa
Copy link
Owner Author

marhensa commented Aug 13, 2023

done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant