Add image refinement flow to our image generation screens#292
Add image refinement flow to our image generation screens#292dkotter wants to merge 19 commits intoWordPress:developfrom
Conversation
…n passed, add that as a reference image before making our image generation request
…he image description
…mage for easier comparison. In that state, ensure refining further refines the refined image instead of the original. And ensure generating another image sends the original image along with the refinement prompt
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #292 +/- ##
=============================================
+ Coverage 57.05% 57.43% +0.37%
- Complexity 591 596 +5
=============================================
Files 42 42
Lines 3083 3101 +18
=============================================
+ Hits 1759 1781 +22
+ Misses 1324 1320 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… all styles into our stylesheet instead of inline. Minor adjustments to spacing and text
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
So the goal here is to make it easy for them to compare and see what changes have happened. I personally think that's nice, especially if you refine an image multiple times. Worth noting I do have a better approach for this I bundled in the next PR (#305). In there, we highlight the "active" image and also keep track of each refined image, so you can paginate back and forth (see the screenshots in the PR description). So in that approach, if you refine an image 5 times, each time we show the image that was used for the refinement on the left and the newly generated image on the right, highlighting the active image. You can them import that image or toggle back to another image (say the 3rd image you generated) and then import that instead. But I can change all of that to show a single image at a time if we think that's the better approach. |
|
Ok yeah I see what you mean in #305, that's probably a solid iteration to fold back into the work here (or extend that one to include the other work in this PR, whichever you prefer). I've got some feedback for 305 that I'll jump over and leave there now. |
So #305 was branched from this PR so the changes in this PR are already applied to that PR (and vice versa I guess, the UI improvements made there also impact here). Goal was to get this one merged first and then can further iterate on that PR as needed |
|
Let's also move the |


What?
Closes #279
Partially closes #270
Add a "Refine" flow to our existing image generation screens
Why?
It's likely that an image you generate doesn't match exactly what you want the first time. While you can edit the prompt and try again, sometimes the image generated is pretty close and needs just a few refinements. This flow is now supported when generating images, both in the editor and directly in the Media Library.
How?
generate-imageAbility to support passing in areferencebase-64 encoded image. If that is passed, we add that as a file to our promptUse of AI Tools
Pulled my original code from #235 for most of this. Used GPT-5.3 Codex in Cursor to refine and fix a few things with manual review, testing and cleanup done by me
Testing Instructions
npm install && npm run buildMedia > Generate ImageScreenshots