-
Notifications
You must be signed in to change notification settings - Fork 59
Switch OpenAI Image Generation to use new gpt-image-1
model
#897
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
Conversation
… Add new helper methods and filters allowing more control over each option. Start removing the DALLE name
|
||
class DallE extends Provider { | ||
class Images extends Provider { |
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 am changing the class name here but don't think we need to worry about deprecating this as it's unlikely anyone was directly extending this class
Couple things to keep in mind here:
As an example complex prompt, I pulled this from OpenAI's cookbook to test. Took about 45 seconds for me locally:
|
That all sounds good to me. |
Do we have any handling (or even a way with the OAI API) to detect someone's not verified and to throw a notice for them to complete that to ensure the image gen features continue to work as expected? |
Perhaps as part of an error messaging in-context we add a simple note that if they're seeing timeouts beyond 60 seconds that they consider filtering at the app or server level to adjust that limitation? |
Not that I can find (as far as an API that tells us that). We could try and make an image generation request and use that response but not sure I love the idea of automatically doing that (as it costs them money).
If the request times out, an error message will already show (though that's just the HTTP request timing out, not a PHP-level timeout, which I don't think we can capture). |
I agree. |
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.
Code looks good, the PR tested well for me 👍
Description of the Change
OpenAI recently introduced a new image generation model into their API,
gpt-image-1
, which can be used as a replacement for thedall-e-3
anddall-e-2
models. We upgraded fromdall-e-2
todall-e-3
in #717 and seems worthwhile to now upgrade togpt-image-1
, as the quality of the images generated is better (and pricing is similar).There are some differences between these models that we need to account for:
For new users, this won't matter but for existing users, there's code in place that will automatically use the new options when needed. As an example, for an existing user that has an image size set of 1792x1024, when they generate an image, it will force them to use 1024x1024. They'll need to go to the Feature settings screen to update their defaults.
Also worth noting I've updated the use of DALLE to be more general (OpenAI Images) in multiple places, as this makes more sense to what we're doing. I did not deprecate anything and I'm personally fine with that as it's not likely someone is directly using the Provider class. I did leave things like settings alone so none of those configurations will be lost.
How to test the Change
Changelog Entry
Credits
Props @dkotter
Checklist: