-
Notifications
You must be signed in to change notification settings - Fork 157
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
Caching brush settings in mask editor #2271
Conversation
Also, getting this error on every pre-commit run, even trivial changes. I've just been
|
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.
Tested and works for me.
There's also this: ComfyUI_frontend/src/scripts/utils.ts Lines 167 to 175 in 7fd41ee
|
Does running |
Running |
ahhh thanks for letting me know, I didn't see this. let me try and implement this. |
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.
Alternatively you can also do hidden setting for restoring these states, e.g.
ComfyUI_frontend/src/constants/coreSettings.ts
Lines 197 to 203 in 7fd41ee
// Hidden setting used by the queue for how to fit images | |
{ | |
id: 'Comfy.Queue.ImageFit', | |
name: 'Queue image fit', | |
type: 'hidden', | |
defaultValue: 'cover' | |
}, |
But that would require you debounce the setter calls, as each adjustment triggers a request to update it in the backend server.
@@ -2545,23 +2584,27 @@ class BrushTool { | |||
|
|||
private setBrushSize(size: number) { | |||
this.brushSettings.size = size | |||
saveBrushToCache('maskeditor_brush_settings', this.brushSettings) |
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.
Maybe we would want to debounce these cache calls? You can use https://lodash.com/docs/#debounce
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.
that's a good point. i didn't think of that.
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.
The current state lgtm. You can open a new PR if session/local storage does become an issue later.
For #2190 and comfyanonymous/ComfyUI#6458
I think the mask editor needs a lot of refactoring, fixes, and features. I couldn't even navigate the file without resorting to ctrl + f and vscode's minimap.
I tested my changes and they work on my machine, but it might break on desktop? Not too sure how
localStorage.setItem
works with Electron.┆Issue is synchronized with this Notion page by Unito