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

Add size option to choose size with pixels #31

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

bfirsh
Copy link
Member

@bfirsh bfirsh commented Oct 9, 2024

No description provided.

# 1 megapixel sizes
SIZES = {f"{x}x{y}": (x, y) for x, y in ASPECT_RATIOS.values()}
# 0.25 megapixel sizes
SIZES.update({f"{x / 2}x{y / 2}": (x / 2, y / 2) for x, y in ASPECT_RATIOS.values()})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor thing - this should be integer division {x // 2}. if it's {x / 2} then we'll have a trailing .0 on all the strings, e.g. 512.0 instead of 512.

if aspect_ratio is not None or megapixels is not None:
# set defaults
if aspect_ratio is None:
aspect_ratio = "1024x1024"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is off, aspect_ratio should default to 1:1 not 1024x1024

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

Successfully merging this pull request may close these issues.

2 participants