fix(image): preserve resolution with enum validation when changing aspect ratio#13935
Open
Mati0kez wants to merge 2 commits intolobehub:canaryfrom
Open
fix(image): preserve resolution with enum validation when changing aspect ratio#13935Mati0kez wants to merge 2 commits intolobehub:canaryfrom
Mati0kez wants to merge 2 commits intolobehub:canaryfrom
Conversation
|
@Mati0kez is attempting to deploy a commit to the LobeHub OSS Team on Vercel. A member of the Team first needs to authorize it. |
Author
Member
|
@tjx666 - This is an image generation fix (resolution preservation when changing aspect ratio). Please take a look. |
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.
Summary
When using models that support resolution enum (1K/2K/4K), selecting a different aspect ratio would cause the resolution to be lost. This PR fixes the issue by:
Fixes #13283
Changes
Code Fix (
action.ts)Added validation logic to
setAspectRatiothat:parameters.resolutionif the new schema's enum includes the current valueparameters.resolutionif the new schema's enum doesn't include the value, or if the schema has no resolution enumTests (
action.test.ts)Added 3 regression tests under Aspect Ratio Setting describe block:
should preserve resolution when changing aspect ratio for models with resolution enumshould strip resolution when new schema does not support the current resolution valueshould strip resolution when schema has no resolution enumReviewer Feedback Addressed
This PR supersedes #13324 by addressing: