Comfy-Org / Comfy-Org/ComfyUI_frontend

[DevTask] LGraph setDirtyCanvas

Open
#4,718 0 comments 0 reactions 0 assignees View on GitHub
area:litegraph developer experience
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

When items are added/removed, LGraph is setting the dirty canvas bit. This is fine for very simple operations, but does not scale when the UI scales in complexity.

If we want to ensure deleted items are also removed from selected items lists, that the canvas is redrawn, and all relevant callbacks are called, it becomes an issue: when removing 20 nodes, everything is run 20 times (including callbacks that should run on e.g. an array of results).

Either:
1. Add remove-many API
2. Ensure callers handle the pre/post remove operations, including dirty canvas.

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-4718-DevTask-LGraph-setDirtyCanvas-2476d73d3650811db176ebe1b2e4debd) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.