Skip to content

Fix OpenAI image refinement model matching and editing support - #29

Merged
superdav42 merged 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/64918
Jul 15, 2026
Merged

superdav42 merged 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/64918

Conversation

@itzmekhokan

Copy link
Copy Markdown
Contributor

Summary

  • Declare [text, image] input modalities for gpt-image-* and chatgpt-image-* models so refinement prompts can resolve a capable model instead of failing with "No models found that support image_generation".
  • Route prompts containing a reference image to OpenAI's /images/edits endpoint with multipart form data, while keeping /images/generations for text-only prompts.
  • Split DALL-E 2 metadata to support image editing separately from DALL-E 3 generation-only models.

Fixes https://core.trac.wordpress.org/ticket/64918

Test plan

  • Connect OpenAI in Settings > Connectors with a valid API key
  • Enable the AI plugin image generation experiment
  • Generate an image in an Image block using OpenAI
  • Click Refine Image and submit a refinement prompt
  • Confirm the image is updated without the "No models found that support image_generation" error
  • Confirm text-only image generation still works
  • Run composer lint (PHPCS + PHPStan)

Declare text+image input modalities for gpt-image models so refinement
prompts can resolve a capable model, and route prompts with reference
images to the images/edits endpoint.

Fixes https://core.trac.wordpress.org/ticket/64918
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: itzmekhokan <khokansardar@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@superdav42 superdav42 self-assigned this Jun 30, 2026

@superdav42 superdav42 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.

LGTM!
Thanks for your contribution.

@superdav42
superdav42 merged commit bb0af4a into WordPress:trunk Jul 15, 2026
1 check passed
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.

2 participants