Skip to content

fix: Add Support for Proper Image Size Constraints#1413

Open
sfreeman422 wants to merge 6 commits intogoogleapis:mainfrom
sfreeman422:main
Open

fix: Add Support for Proper Image Size Constraints#1413
sfreeman422 wants to merge 6 commits intogoogleapis:mainfrom
sfreeman422:main

Conversation

@sfreeman422
Copy link
Copy Markdown

@sfreeman422 sfreeman422 commented Mar 16, 2026

This pull request refactors the handling of image size configuration across several API and type definition files. The main improvement is the introduction of a dedicated ImageSizeConfig type, replacing the previous use of generic strings for specifying image sizes. This change enhances type safety and ensures that only supported image sizes can be used in the relevant interfaces.

Type safety improvements for image size configuration:

  • Introduced a new ImageSizeConfig type ('1K' | '2K' | '4K') to represent valid image sizes, replacing the previous untyped string usage in image-related configuration interfaces. ([[1]](https://github.com/googleapis/js-genai/pull/1413/files#diff-5e6f47503bac0a3672b747dd68d8cad573b5e0d78c77b7a659488d98d39a93b5R1499-R1500), [[2]](https://github.com/googleapis/js-genai/pull/1413/files#diff-c54113cf61ec99691748a3890bfbeb00e10efb3f0a76f03a0fd9ec49072e410aR2348-R2349))
  • Updated the imageSize property in the ImageConfig interface to use ImageSizeConfig instead of string in both the TypeScript types and the generated API report files. ([[1]](https://github.com/googleapis/js-genai/pull/1413/files#diff-5e6f47503bac0a3672b747dd68d8cad573b5e0d78c77b7a659488d98d39a93b5L2008-R2010), [[2]](https://github.com/googleapis/js-genai/pull/1413/files#diff-20ae5185c323ce5cf41072fbd950bfa72b92eb8d3ccd8776c085b477bb361b6eL2008-R2008), [[3]](https://github.com/googleapis/js-genai/pull/1413/files#diff-c54113cf61ec99691748a3890bfbeb00e10efb3f0a76f03a0fd9ec49072e410aL2356-R2358))
  • Updated the imageSize property in the GenerateImagesConfig interface to use ImageSizeConfig (or a version omitting '4K' where not supported), replacing the previous string type in both the TypeScript types and the generated API report files. ([[1]](https://github.com/googleapis/js-genai/pull/1413/files#diff-5e6f47503bac0a3672b747dd68d8cad573b5e0d78c77b7a659488d98d39a93b5L1507-R1509), [[2]](https://github.com/googleapis/js-genai/pull/1413/files#diff-20ae5185c323ce5cf41072fbd950bfa72b92eb8d3ccd8776c085b477bb361b6eL1507-R1507), [[3]](https://github.com/googleapis/js-genai/pull/1413/files#diff-c54113cf61ec99691748a3890bfbeb00e10efb3f0a76f03a0fd9ec49072e410aL3487-R3489))

These changes make the codebase more robust by preventing invalid image size values at compile time and clarifying the supported options for image generation.

@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 16, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@sfreeman422 sfreeman422 changed the title feat: Add Support for Proper Image Size Constraints fix: Add Support for Proper Image Size Constraints Mar 16, 2026
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.

1 participant