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

Fix/440 Per-image customization for quality, size, and style in Image Generation #857

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

faisal-alvi
Copy link
Member

@faisal-alvi faisal-alvi commented Feb 21, 2025

Description of the Change

This PR enhances the Image Generation feature by allowing users to modify image quality, size, and style directly from the media modal. Previously, these options were only configurable at the global settings level, requiring users to change settings manually before generating an image and then reverting them if needed.

classifai-440-01

  • Added controls in the media modal for adjusting image quality (standard/HD), size (1024x1024, 1792x1024, 1024x1792), and style (vivid/natural) per image generation.
  • Defaults to global settings, ensuring consistency while allowing flexibility for individual use cases.
  • Introduced a global setting to disable per-image adjustments.

image

Closes #440

How to test the Change

  1. Navigate to ClassifAI Image Generation Settings and note the global settings for quality, size, and style.
  2. Navigate to the image generation section. Ensure that the quality, size, and style options default to the global settings.
  3. In the media modal, change the quality (standard/HD), size (1024x1024, 1792x1024, 1024x1792), and style (vivid/natural). Generate an image and verify that it reflects the selected options.
  4. In ClassifAI Image Generation Settings, toggle the new setting to disable per-image adjustments. Open the media modal again and verify that the optios for quality, size, and style are now hidden.
  5. If per-image settings are disabled, generate an image and confirm that it uses the global settings instead.
  6. Also ensure that the same behaviour occurs in both image generation pages, 1) Under Media and 2) While adding an image in edit post page.

Changelog Entry

Added - Per-image customization for quality, size, and style in Image Generation.

Credits

Props @dkotter @jeffpaul @faisal-alvi

Checklist:

@faisal-alvi faisal-alvi added this to the Future Release milestone Feb 21, 2025
@faisal-alvi faisal-alvi self-assigned this Feb 21, 2025
@faisal-alvi faisal-alvi requested review from a team and peterwilsoncc and removed request for a team and peterwilsoncc February 21, 2025 14:33
/home/runner/work/classifai/classifai/src/js/features/image-generation/media-modal/collections/images.js
Error:   16:2  error  Missing JSDoc @param "quality" declaration  jsdoc/require-param
Error:   16:2  error  Missing JSDoc @param "size" declaration     jsdoc/require-param
Error:   16:2  error  Missing JSDoc @param "style" declaration    jsdoc/require-param

/home/runner/work/classifai/classifai/src/js/features/image-generation/media-modal/views/generated-images-container.js
Error:   31:31  error  Replace `·this.prompt,·this.quality,·this.size,·this.style·` with `⏎↹↹↹this.prompt,⏎↹↹↹this.quality,⏎↹↹↹this.size,⏎↹↹↹this.style⏎↹↹`  prettier/prettier

✖ 4 problems (4 errors, 0 warnings)
  4 errors and 0 warnings potentially fixable with the `--fix` option.

Error: Process completed with exit code 1.
FILE: includes/Classifai/Features/ImageGeneration.php
-----------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 0 WARNINGS AFFECTING 6 LINES
-----------------------------------------------------------------------------------------------
 316 | ERROR | Line indented incorrectly; expected 8 tabs, found 9 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
 318 | ERROR | Line indented incorrectly; expected 8 tabs, found 9 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
 328 | ERROR | Line indented incorrectly; expected 8 tabs, found 9 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
 330 | ERROR | Line indented incorrectly; expected 8 tabs, found 9 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
 340 | ERROR | Line indented incorrectly; expected 8 tabs, found 9 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
 342 | ERROR | Line indented incorrectly; expected 8 tabs, found 9 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
-----------------------------------------------------------------------------------------------
Error: Process completed with exit code 1.
/home/runner/work/classifai/classifai/src/js/features/image-generation/media-modal/collections/images.js
Error:   16:2  error  Expected JSDoc block lines to be aligned  jsdoc/check-line-alignment
@faisal-alvi faisal-alvi changed the title Fix/440 Additional Settings for Image Generation Fix/440 Per-image customization for quality, size, and style in Image Generation Feb 21, 2025
@faisal-alvi faisal-alvi requested a review from dkotter February 21, 2025 18:21
@faisal-alvi faisal-alvi marked this pull request as ready for review February 21, 2025 18:21
@faisal-alvi faisal-alvi requested review from jeffpaul and a team as code owners February 21, 2025 18:21
@github-actions github-actions bot added the needs:code-review This requires code review. label Feb 21, 2025
@faisal-alvi faisal-alvi removed request for jeffpaul and a team February 21, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-review This requires code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenAI Image Generation Tweaks
1 participant