Repository navigation
Python: Accept gpt-image-1 landscape and portrait sizes in OpenAITextToImageExecutionSettings - #14798
Open
Abhishek Acharya (abhishekacharya200) wants to merge 1 commit into
Conversation
…ToImageExecutionSettings
Abhishek Acharya (abhishekacharya200)
requested a review
from a team
as a code owner
November 16, 2026 04:04
Abhishek Acharya (abhishekacharya200)
deployed
to
github-app-auth
November 16, 2026 04:05 — with
GitHub Actions
Active
Copilot started reviewing on behalf of
Abhishek Acharya (abhishekacharya200)
November 16, 2026 04:05
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change adding landscape and portrait image sizes to the Python OpenAI text-to-image connector.
No open issues 🎉
What changed in this PR
Updates the Python OpenAI text-to-image connector to accept gpt-image-1 landscape and portrait sizes while retaining the existing DALL-E sizes.
Changes:
- Adds
1536x1024and1024x1536to the allowed image sizes. - Adds a parameterized unit test verifying both sizes are accepted and forwarded to the mocked image-generation API.
| File | Description |
|---|---|
python/tests/unit/connectors/ai/open_ai/services/test_openai_text_to_image.py |
Tests generation requests for both gpt-image-1 sizes. |
python/semantic_kernel/connectors/ai/open_ai/prompt_execution_settings/open_ai_text_to_image_execution_settings.py |
Extends the valid image-size list without removing existing sizes. |
Review effort: Balanced
This branch was successfully 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.
Motivation and Context
The OpenAI text-to-image connector now targets gpt-image-1 (quality is limited to high/medium/low and style was removed), but the size check still only allows the DALL-E sizes. Passing 1536x1024 or 1024x1536, both supported by gpt-image-1, fails before any request is sent:
Description
Add (1536, 1024) and (1024, 1536) to VALID_IMAGE_SIZES. The existing sizes are kept so DALL-E deployments are unaffected.
Added a unit test that calls generate_images with both sizes against a mocked images.generate and checks the size sent in the request. It fails without the change.
Contribution Checklist