Skip to content
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

OpenAI image generation tweaks #441

Merged
merged 7 commits into from
Apr 27, 2023
Merged

OpenAI image generation tweaks #441

merged 7 commits into from
Apr 27, 2023

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Apr 26, 2023

Description of the Change

This PR refines and fixes some issues with the OpenAI image generation feature that was added in #419.

  1. Ensure the CSS we need is always enqueued. Previously our CSS was in the language-processing.scss file but that is only enqueued if the IBM Watson integration is on. So if that feature was off, the CSS we need was never loaded, resulting in some UI issues. In addition to ensuring CSS is always enqueued, moved the media modal CSS into it's own file
  2. Changed the prompt input from a normal text input into a textarea, allowing the prompt to be longer without cutting off
  3. After images are generated, keep the prompt text in the input so it can easily be tweaked if another request needs to be made
  4. Adjust some styling, most based on comments left on Image generation using OpenAI's DALL·E API #419 after it was merged but also to reduce the size of the generated images so we get 4 across instead of 3 across
  5. Add the prompt text as the alt text to any images that we import
  6. Remove the secondary import button after an image is imported, as it's no longer needed
  7. Moves the Generate images tab as the second item, before the Media Library tab

Partially closes #440

Screen Shot 2023-04-26 at 11 25 09 AM

How to test the Change

  1. Setup the OpenAI DALLE image generation feature
  2. Within a post, add a new Image block and then enter the media modal flow
  3. Switch to the Generate image tab and ensure styling looks correct
  4. Enter in a prompt and submit that, ensuring loading states show and images populate
  5. Import one or more images, ensuring alt text is set

Changelog Entry

Added - Add the image generation prompt as alt text to imported generated images
Changed - Tweaks to the image generation UI
Fixed - Ensure proper CSS is always loaded based on the enabled features

Credits

Props @dkotter, @jeffpaul, @mehidi258

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter added this to the 2.1.0 milestone Apr 26, 2023
@dkotter dkotter self-assigned this Apr 26, 2023
@dkotter dkotter requested review from a team and jeffpaul as code owners April 26, 2023 18:40
@jeffpaul
Copy link
Member

Awesome, ship it!

@dkotter dkotter mentioned this pull request Apr 26, 2023
1 task
@dkotter dkotter merged commit 8b9948b into develop Apr 27, 2023
@dkotter dkotter deleted the fix/440 branch April 27, 2023 20:32
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.

OpenAI Image Generation Tweaks
2 participants