Repository navigation
Conversation
geometry() and the latent upscaler used strict Python-int checks
(isinstance(n, int) / type(n) is int). When width/height came from a
widget as a string ("640"), numpy.int64, or an integer-valued float,
they were wrongly rejected with "Width and height must be multiples of
32, at least 256 pixels", even though the value was a valid multiple of 32.
Normalize via float() and compare by numeric value before validating the
>=256 and %32 constraints. Non-numeric, fractional, undersized and
non-multiple values are still correctly rejected.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复自定义分辨率 bug(Fix custom resolution validation)
Problem
geometry()and the latent upscaler validated dimensions with strict Python-native integer checks (isinstance(n, int)/type(n) is not int). When width/height were provided as a string from a typed widget ("640"), a numpy integer (numpy.int64), or an integer-valued float, they were wrongly rejected with:This happened even when the value was a perfectly valid multiple of 32 (e.g. 640x960). The built-in presets worked because they submit a native
int, while manually entered custom values arrive as strings.Fix
float()and compare by numeric value before validating the>= 256and% 32constraints.Tested
Using the main environment Python, with 640x960:
640,"640",640.0,numpy.int64(640)→ all accepted642(not multiple),128(too small),"abc","640.5"→ all rejectedFiles changed
freevideo_engine/geometry.pyfreevideo_engine/latent_upscale.py