Add ability to modify DALL·E 3 generated images

Open
#723 9 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
ai, frontend

Research direction

Start with the Generate images modal at /wp-admin/upload.php?action=classifai-generate-image and review the DALL·E 3 changes from #717. Add the Modify image action, textarea, and Generate modifications flow using each generated image's seed ID. Done means modified images replace the originals in the modal, with prompt and alt-text handling resolved.

Written by the indexing model from the issue text.

Description

Is your enhancement related to a problem? Please describe.

With the update in #717, we can now start to take advantage of some of the enhancements in the DALL·E 3 model. Let's look to extend our Generate images modal (e.g. /wp-admin/upload.php?action=classifai-generate-image) to add in a Modify image action link that further accepts textarea input which is then sent back to DALL·E 3.

When we receive the originally generated image(s) back from DALL·E 3 we'll want to ensure we capture the seed ID for each as that'll be needed for the modification step. We'll capture the desired modifications from the user via a textarea, then send that back to DALL·E 3 (e.g. "Modify image [#] with seed [seed-ID]: "), and then render the newly modified image(s) in place of the first image(s).

Designs

modify-image

In this rough mockup, I'm recommending we first tweak our primary button and secondary action link such that the first two options on generated images are [Insert to Post] and then _Import to Media Library_. A third option here for _Modify image, when clicked, would present a textarea (with "add / remove / change image by..." placeholder text to help guide the user on what to enter) and a [Generate modifications] button. Clicking that button would send the image seed ID and described modifications back to DALL·E 3 and then render in place of the prior image(s) with the newly modified image(s).

Describe alternatives you've considered

There's some consideration for what we do with the original image prompt and modification text (especially if there are multiple modifications made). We currently show the original prompt in the initial textarea in the Generate images modal, so perhaps we continue to amend that text with the modification text? In terms of the alt text that's added to any imported/inserted generated image we could attempt to include that same prompt+modification(s) text (or albeit more lazily / easily stick with the original prompt text).

Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
PHP
Stars
714
Forks
68
Avg merge
4h 32m
Merged PRs (30d)
23

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 10up/classifai

All issues in 10up/classifai

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.