Enable INT node inputs and fix live preview sync for MaskRectArea nodes#1168
Merged
ltdrdata merged 1 commit intoltdrdata:Mainfrom Dec 30, 2025
Merged
Conversation
## Overview This PR improves both MaskRectArea and MaskRectAreaAdvanced nodes by allowing them to accept values from connected INT nodes, while preserving backward compatibility with existing workflows. It also fixes several UI and preview issues that prevented the canvas from updating correctly when values were driven by links. Fixes ltdrdata#1126 ## Key changes ### 1. Typed INT inputs support (backend) - Both MaskRectArea and MaskRectAreaAdvanced now declare proper INT inputs in INPUT_TYPES. - This allows parameters such as x, y, width, height, and blur_radius to be driven directly by other nodes. - Existing workflows that relied on node properties remain supported via fallback logic using extra_pnginfo. ### 2. Live preview correctly updates when inputs are linked (frontend) - The canvas preview now updates immediately when values come from linked INT nodes. - This is achieved by synchronizing linked input values into node.properties during canvas rendering, avoiding reliance on widget callbacks or execution timing. - This directly resolves the behavior reported in issue ltdrdata#1126. ### 3. Node height and layout fix (frontend) - The node height calculation was corrected to use the actual widget layout (last_y) instead of input/output counts. - Nodes can now both grow and shrink correctly when resized or when widget content changes. - This removes excessive empty space below the widgets and canvas. ### 4. Widget duplication prevention - Frontend logic now detects when widgets are already created by Python and avoids recreating them in JavaScript. - This prevents duplicated widgets and keeps the node UI consistent. ### 5. Comment cleanup - Remaining comments in Spanish were translated to English for consistency and maintainability. ## Backward compatibility - Existing workflows continue to work without modification. - Default behavior and mask output remain unchanged unless inputs are explicitly linked. ## Motivation These changes make the nodes composable with the rest of the graph (especially math and control nodes), improve the reliability of the preview, and fix UI inconsistencies without introducing breaking changes.
Contributor
Author
ltdrdata
approved these changes
Dec 30, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Overview
This PR improves both MaskRectArea and MaskRectAreaAdvanced nodes by allowing them to accept values from connected INT nodes, while preserving backward compatibility with existing workflows.
It also fixes several UI and preview issues that prevented the canvas from updating correctly when values were driven by links.
Fixes #1126
Key changes
1. Typed INT inputs support (backend)
2. Live preview correctly updates when inputs are linked (frontend)
3. Node height and layout fix (frontend)
4. Widget duplication prevention
5. Comment cleanup
Backward compatibility
Motivation
These changes make the nodes composable with the rest of the graph (especially math and control nodes), improve the reliability of the preview, and fix UI inconsistencies without introducing breaking changes.