-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Feat: Noise and Blur filters for Canvas #7551
Merged
psychedelicious
merged 10 commits into
invoke-ai:main
from
dunkeroni:distortion_filters
Jan 15, 2025
Merged
Feat: Noise and Blur filters for Canvas #7551
psychedelicious
merged 10 commits into
invoke-ai:main
from
dunkeroni:distortion_filters
Jan 15, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dunkeroni
requested review from
psychedelicious,
blessedcoolant,
maryhipp,
hipsterusername and
brandonrising
as code owners
January 13, 2025 06:22
github-actions
bot
added
python
PRs that change python files
invocations
PRs that change invocations
frontend
PRs that change frontend files
labels
Jan 13, 2025
psychedelicious
approved these changes
Jan 15, 2025
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.
Thanks! I've pushed 3 commits:
- Run
make ruff
to fix python style checks. - Run
make frontend-typegen
to update the frontend generated typescript types. - Hide the layer being filtered when rendering the preview, which fixes that transparency issue.
I also thought about the issue where the blur gets cut off by the layer bounds but I still don't have an easy fix for that, will probably need some deeper fiddling to sort.
Previously, when previewing a filter on a layer with some transparency or a filter that changes the alpha, the preview was rendered on top of the layer. The preview blended with the layer, which isn't right. In this change, the layer is hidden during the preview, and when the filter finishes (having been applied or canceled - the two possible paths), the layer is shown. Technically, we are hiding and showing the layer's object renderer's konva group, which contains the layer's "real" data. Another small change was made to prevent a flash of empty layer, by waiting to destroy a previous filter preview image until the new preview image is ready to display.
psychedelicious
force-pushed
the
distortion_filters
branch
from
January 15, 2025 22:17
dcd734c
to
28b3f02
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
frontend
PRs that change frontend files
invocations
PRs that change invocations
python
PRs that change python files
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
A few things lumped together here.
Image Blur invocation now correctly handles transparent regions instead of darkening edges.
Old method: (center and right image will look the same if your git is not in Dark Mode, but the right image has a white background)
New method:
Paste Image node now respects transparency. Previously alpha channel of the top image would override the bottom.
Added Image Noise invocation to introduce random noise into images. Supports gaussian/salt-and-pepper modes in greyscale/color.
Created filters in Canvas for blur and noise to improve img2img results.
noise_filters_2.mp4
Above video was taken before Noise Size input was added.
Related Issues / Discussions
Additional noise strategies possibly to be added later on:
Known Issues (not from this PR, but visible because of it):
Merge Plan
Ready to merge
Checklist
What's New
copy (if doing a release after this PR)