-
Notifications
You must be signed in to change notification settings - Fork 419
GPU accelerated maskeditor rendering #6767
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
Merged
jtydhr88
merged 19 commits into
Comfy-Org:main
from
trsommer:webGPU-maskeditor-rendering
Nov 22, 2025
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
beb520e
phase 1 complete
trsommer edaf3d5
gpu painting works on mouse up
trsommer fff8680
gpu painitng works much better now, but some things still need work
trsommer e2c7510
changed interpolation to Centripetal Catmull-Rom splines, generating …
trsommer 3619ced
removed logging from debugging stroke smoothing
trsommer 66ed91a
fixed shift click line drawing
trsommer 9603446
fixed inter brush stroke accumulation, fixed bug that created inter b…
trsommer fc970d6
fixed tons of bugs
trsommer 1e838f4
fixed some more issues
trsommer 6c7bdd9
removed unused exports
trsommer 1ffc13c
initial eraser implementation
trsommer bb5e308
fixed erasing preview not showing up, fixed errors
trsommer 9d8f134
Implemented brush shape selection and refactored WGSL shaders into a …
trsommer 22c54ca
fixed many performance issues
trsommer 506a217
fixed single click painting not working
trsommer e34ee91
fixed preview black tint, increased max brush size
trsommer f80e465
fixed old, misconfigured test and added/fixed comments, fixed alt rig…
trsommer 625a2e5
adaptive stroke sampling, GPU bind group optimizations, improved mask…
trsommer b4f2beb
added shift click line drawing for eraser on gpu
trsommer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,7 @@ | |
| <SliderControl | ||
| :label="t('maskEditor.thickness')" | ||
| :min="1" | ||
| :max="100" | ||
| :max="500" | ||
| :step="1" | ||
| :model-value="store.brushSettings.size" | ||
| @update:model-value="onThicknessChange" | ||
|
|
@@ -80,12 +80,12 @@ | |
| /> | ||
|
|
||
| <SliderControl | ||
| :label="t('maskEditor.smoothingPrecision')" | ||
| label="Stepsize" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add it into en/main.json for i18n? |
||
| :min="1" | ||
| :max="100" | ||
| :step="1" | ||
| :model-value="store.brushSettings.smoothingPrecision" | ||
| @update:model-value="onSmoothingPrecisionChange" | ||
| :model-value="store.brushSettings.stepSize" | ||
| @update:model-value="onStepSizeChange" | ||
| /> | ||
| </div> | ||
| </template> | ||
|
|
@@ -119,8 +119,8 @@ const onHardnessChange = (value: number) => { | |
| store.setBrushHardness(value) | ||
| } | ||
|
|
||
| const onSmoothingPrecisionChange = (value: number) => { | ||
| store.setBrushSmoothingPrecision(value) | ||
| const onStepSizeChange = (value: number) => { | ||
| store.setBrushStepSize(value) | ||
| } | ||
|
|
||
| const resetToDefault = () => { | ||
|
|
||
Oops, something went wrong.
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.
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.
Aligns cursor preview with effective brush size/hardness; consider relaxing float equality
Using
getEffectiveBrushSize/getEffectiveHardnessfor both the cursor radius and gradient makes the preview much closer to the actual brush behavior and the new soft‑edge model, and switchingbrushOpacityto numeric values is also cleaner for CSS.One minor robustness point:
if (effectiveHardness === 1)relies on an exact floating‑point comparison. IfeffectiveHardnessis computed (rather than directly set to 1), you could occasionally get0.999...and skip the solid‑brush shortcut unintentionally. Consider either:store.brushSettings.hardness === 1, orif (effectiveHardness >= 0.999)).This would make the “fully hard” visual consistent even in the face of small floating‑point rounding differences.
Also applies to: 46-51, 87-109
🤖 Prompt for AI Agents