-
Notifications
You must be signed in to change notification settings - Fork 33
Add the Image Generation Experiment base #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the Image Generation Experiment base #134
Conversation
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @prabinjha, @kurtrank. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #134 +/- ##
=============================================
+ Coverage 38.83% 46.89% +8.05%
- Complexity 177 208 +31
=============================================
Files 16 19 +3
Lines 1012 1271 +259
=============================================
+ Hits 393 596 +203
- Misses 619 675 +56
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:
|
…when we make an image generation request
JasonTheAdams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, @dkotter! Couple small suggestions. 😄
includes/Abilities/Image/Import.php
Outdated
| * | ||
| * @since 0.1.0 | ||
| */ | ||
| class Import extends Abstract_Ability { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call this Import_Base64_Image for clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed: 6536248
JasonTheAdams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, @dkotter!
felixarntz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkotter This looks excellent! A few small notes, but after that it'll be good to merge.
felixarntz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkotter Great! Just one somewhat unrelated note, but this is good to merge 👍
| /** | ||
| * Image generation WordPress Ability. | ||
| * | ||
| * @since x.x.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note: In WordPress/performance, WordPress/php-ai-client, and a few other projects we established the convention of @since n.e.x.t. Obviously it's an arbitrary decision, but I wonder whether we should use that here too.
Most importantly, we should probably choose a convention and document it, so that it's easy for a pre-release step to replace all those with the actual version. Maybe we can even build linting for it at some point.
This is mostly a thing we'll want to figure out soon, feel free to change it here or leave as is if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine if we update to using this, no strong opinion on my end but noting this is currently documented as the approach (which is why I used that here) and there is a step in our release process to update these
What?
Partially closes #13
Adds the base Experiment and Ability code for Image Generation and Import. There will be a followup PR that adds in the UI to trigger image generation and import.
Why?
We want an Experiment that allows you to generate images, whether that is in-content images, featured images or an image used elsewhere and then import those images into your media library. To keep PRs as small as possible, this introduces the base framework for image generation and import, both the Image Generation Experiment and the Image Generation and Image Import Abilities.
How?
Testing Instructions
Since there isn't a UI for this yet, will need to make direct API requests to see this working.
Make an authenticated
GETrequest to the main abilities endpoint and ensure the Image Generation and Image Import abilities shows thereMake an authenticated
GETrequest to the Image Generation endpoint and ensure information about the ability showsMake an authenticated
GETrequest to the Image Import endpoint and ensure information about the ability showsMake an authenticated
POSTrequest to the Image Generation run endpoint without passing a prompt and ensure an error showsMake an authenticated
POSTrequest to the Image Generation run endpoint and pass in a prompt and ensure base64 encoded data is returnedMake an authenticated
POSTrequest to the Image Import run endpoint without passing data and ensure an error showsMake an authenticated
POSTrequest to the Image Import run endpoint and pass in valid base64 data (and any optional data) and ensure the image data is returned and the image is in your media libraryTest using WordPress Playground
The changes in this pull request can be previewed and tested using this WordPress Playground instance:
Click here to test this pull request.