Skip to content

Enforce image height and width from 0-4096 pixels - #13

Merged
bitgamma merged 3 commits into
lemonade-sdk:mainfrom
ckuethe:add_size_bounds_check
Aug 24, 2026
Merged

Enforce image height and width from 0-4096 pixels#13
bitgamma merged 3 commits into
lemonade-sdk:mainfrom
ckuethe:add_size_bounds_check

Conversation

@ckuethe

@ckuethe ckuethe commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

0 is treated as model default, and anything over 1024 is an error. CLI, API, and WUI all enforce these and give useful errors.

I went with 1024 as the upper limit since I have no evidence that any models are trained on larger inputs; the internet says to use upscaling if you want larger images

Fixes #11

0 is treated as model default, and anything over 1024 is an error. CLI, API,
and WUI all enforce these and give useful errors.

I went with 1024 as the upper limit since I have no evidence that any models
are trained on larger inputs; if you want a bigger output use upscaling.
@bitgamma

Copy link
Copy Markdown
Member

1024 is not even close to being reasonable. 4096 sounds more like it

@bitgamma

Copy link
Copy Markdown
Member

also, I don't like adding hard limits. This limit should only be in the index.html and generate cli to help the user not shot themselves in the foot, but not enforced in the API

WUI and CLI now reject dimensions larger than 4096. A 4096x1024 fox
doesn't render correctly (it's a fox-like centipede) but it doesn't
crash my GPU any more either.
@ckuethe

ckuethe commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author
fox

@ckuethe ckuethe changed the title Enforce image height and width from 0-1024 pixels Enforce image height and width from 0-4096 pixels Aug 23, 2026
@ckuethe

ckuethe commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

WUI and CLI now reject >4096, API goes back to letting you request whatever you want

@bitgamma bitgamma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

doc needs to be aligned and this can be merged

Comment thread README.md Outdated
Comment thread README.md Outdated
@bitgamma
bitgamma merged commit 16cd0ef into lemonade-sdk:main Aug 24, 2026
@bitgamma

Copy link
Copy Markdown
Member

just noticed I could change those two things myself. Merged

@ckuethe

ckuethe commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Cool, thanks. I generally leave "allow maintainer edits" checked just for such things.

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.

add some sensible image size restrictions

2 participants