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

[WebUI] Fix 'Use All' Params not Respecting Hi-Res Fix #2840

Merged
merged 3 commits into from
Mar 8, 2023

Conversation

blhook
Copy link
Contributor

@blhook blhook commented Mar 1, 2023

This is a different source/base branch from #2823 but is otherwise the same content. yarn build was ran on this clean branch.

What was the problem/requirement? (What/Why)

As part of a change in 2.3.0, the high resolution fix was no longer being applied when 'Use all' was selected. This effectively meant that users had to manually analyze images to ensure that the parameters were set to match.
Additionally, and never actually working, Upscaling and Face Restoration parameters were also not pulling through with the action, causing a similar usability issue. See: #2823 (comment)

What was the solution? (How)

This change adds a new reducer to the postprocessingSlice file, mimicking the generationSlice reducer to assign all parameters appropriate for the post processing options. This reducer assigns:

  • Hi-res's toggle button only if the type is txt2img, since img2img hi-res was removed previously
  • Upscaling's toggle button, scale, denoising strength, and upscale strength
  • Face Restoration's toggle button, type, strength, and fidelity (if present/applicable)

Minor

  • Added endOfLine: 'crlf' to prettier's config to prevent all files from being checked out on Windows due to difference of line endings (and git not picking up those changes as modifications, causing ghost modified files from Git)

Revision 2:

  • Removed out upscaling and face restoration pulling of parameters

Revision 3:

  • More defensive coding for the hires_fix not present (assume false)

Out of Scope

  • Hi-res strength (applied as img2img strength in the initial image that is generated) is not in the metadata of the final image and can't be reconstructed easily
  • Upscaling and face restoration have some peculiarities for multi-post processing outside of the UI, which complicates it enough to scope out of this PR.

How were these changes tested?

  • yarn dev => Server started successfully
  • Manual testing on the development server to ensure parameters pulled correctly
  • yarn build => Success

Notes

As with generationSlice, this code assumes action.payload.image is valid and doesn't do a formal check on it to ensure it is valid.

Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for redoing this PR. I've requested two changes.

invokeai/frontend/.prettierrc.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, pending the changes requested by @psychedelicious

@blhook blhook force-pushed the bugfix-use-all-params-2.3 branch from d81d39b to 79606f8 Compare March 7, 2023 01:47
@blhook blhook force-pushed the bugfix-use-all-params-2.3 branch from 79606f8 to f207647 Compare March 8, 2023 01:22
@psychedelicious
Copy link
Collaborator

@blhook is this ready for review? Sorry if I missed a notification.

@blhook
Copy link
Contributor Author

blhook commented Mar 8, 2023

@psychedelicious , yes, it should be ready. I probably should have made a specific comment for it after the push (which was not too long after my replies to the conversation).

@psychedelicious
Copy link
Collaborator

Ah, good. I'll do my review this evening.

Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, thank @blhook !

@blessedcoolant blessedcoolant merged commit 5a633ba into invoke-ai:v2.3 Mar 8, 2023
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.

None yet

4 participants