- Add centralized CONFIG object with PROJECT_NAME, PROJECT_ICON, CSS_PREFIX,
LOGGER_NAME, and SHARED_CONTAINER_ID to prevent hardcoded values
- Refactor showNotification to accept both legacy (backgroundColor, duration, type)
and new (options object) signatures for backward compatibility
- Replace hardcoded CSS IDs and keyframe names with CONFIG-prefixed variants
- Change notification container layout from row-reverse to column for proper stacking
- Add context menu binding support via contextMenuModel and contextMenuTooltip options
- Extract SVG icons into dedicated iconSVGs record/object
- Fix wrapper functions (showSuccessNotification, showErrorNotification etc.) to
pass type as first argument instead of undefined
- Increase container z-index to 100005 to appear above modal overlays
- Remove unused lf-progress and lf-progress-rewind keyframes
Refactors all custom CSS class names to include an 'lf-' prefix
(e.g. .painter-button -> .lf-painter-button, .clipboard-switch -> .lf-clipboard-switch).
This isolates LayerForge styles within the ComfyUI DOM and prevents
CSS namespace collisions with other custom nodes or host page styles.
Changes span src/ TypeScript source files and src/css/ stylesheets.
- Replace CSS animation-based notification progress bar with requestAnimationFrame-driven animation
- Centralize getCanvasState/setCanvasState imports at top-level in CanvasView (remove dynamic import())
- Clean up animation frame lifecycle tracking to prevent orphaned rAF callbacks
- Set local debug log level in python/config.py for development diagnostics
Insert an "Undo & Redo" section into standard_shortcuts.html in both js/templates and src/templates. Documents Ctrl+Z for undo and Ctrl+Y or Ctrl+Shift+Z for redo so the UI shortcut list includes undo/redo actions.
Technical details:
- skip LayerForge canvas and panel shortcuts when focus is inside editable controls
- patch ComfyUI ChangeTracker undoRedo so Ctrl/Cmd+Z does not leak to graph history while LayerForge owns the shortcut context
- stop clipboard copy/cut/paste events from editable LayerForge UI from bubbling into ComfyUI node clipboard handlers
- route widget-root Ctrl/Cmd+Z, Ctrl/Cmd+Y, and Ctrl/Cmd+Shift+Z through LayerForge canvas undo and redo when the widget is active
Store canvas state in IndexedDB clipboard on copy, allowing nodes to be
duplicated with their layers preserved across different workflows.
When copying a node, the canvas state is stored in a special
'__clipboard__' entry that persists across workflow switches. On paste,
if the source node doesn't exist (indicating cross-workflow paste), the
system falls back to loading from the clipboard entry.
Implements two new features:
- Layer copy/paste within canvas using Ctrl+C/V
- Node duplication that preserves all layers
Layer Copy/Paste:
- Added Ctrl+V keyboard shortcut handler for pasting layers
- Intercept keydown events during capture phase to handle before ComfyUI
- Focus canvas when layer is clicked to ensure shortcuts work
- Prevent layers panel from stealing focus on mousedown
Node Duplication:
- Store source node ID during serialize for copy operations
- Track pending copy sources across node ID changes (-1 to real ID)
- Copy canvas state from source to destination in onAdded hook
- Use Map to persist copy metadata through node lifecycle
Increase robustness of image loading check before sending canvas data.
Now retries up to 5 times with 200ms delays (1 second total) instead
of a single 100ms wait.
This fixes the 'Failed to get confirmation from server' error that
appeared when executing workflows immediately after ComfyUI restart,
before images finished loading from IndexedDB.
Prevents workflow execution failures due to timing issues during
canvas initialization.
The canvas was getting corrupted to a small strip because of confusion
between two different dimension types:
- Output area dimensions (logical working area, e.g. 512x512)
- Display canvas dimensions (actual pixels shown on screen)
Root cause: Setting canvas.width/height attributes to match output area
while also using CSS width:100%/height:100% created conflicts. When
zooming or reloading, wrong dimensions would be read and saved.
Fix: Remove canvas element width/height attribute assignments. Let the
render loop control display size based on clientWidth/clientHeight.
Keep output area dimensions separate.
This prevents the canvas from being saved with corrupted tiny dimensions
and fixes the issue where canvas would only show in a small strip after
zooming or reloading workflows.
Fix critical issue where LayerForge was trying to send canvas data
even when the node was bypassed (mode === 4). This caused unnecessary
errors and blocked workflow execution.
Now properly checks node.mode before attempting to send data via
WebSocket, skipping bypassed nodes entirely.
- Add image loading validation before sending canvas data to server
Prevents 'Failed to get confirmation' error when images haven't
finished loading after workflow reload. Waits 100ms and checks
if all layer images are complete before rendering output.
- Improve layer loading error handling in CanvasState
Better logging when layers fail to load from IndexedDB.
Allows empty canvas as valid state instead of failing.
- Add ResizeObserver for canvas container
Fixes bug where canvas only shows in top half of node.
Watches container size changes and triggers re-render to ensure
canvas dimensions are correctly calculated after DOM layout.
Ensure the canvas element is actually connected to the DOM before
handling paste events. This prevents LayerForge from capturing paste
events when navigating in subgraphs where the canvas is not visible.
Adds check for canvas.isConnected and document.body.contains() to
verify the canvas is part of the active DOM tree.
Prevent LayerForge from intercepting Ctrl+C, Ctrl+V, and other keyboard
shortcuts when the canvas is not focused. This was causing unwanted
popups and interfering with other nodes in ComfyUI.
Changes:
- Remove document.body focus check from handlePasteEvent
- Add focus validation to handleKeyDown before processing shortcuts
- Modifier keys (Ctrl, Shift, Alt, Meta) are still tracked globally
- All other shortcuts only trigger when canvas is focused
Fixes issue where paste events were captured globally regardless of focus.
Implemented grab icon feature in transform mode to move selected layers without changing selection, even when behind other layers. Added hover detection, cursor updates, and visual rendering in CanvasInteractions.ts and CanvasRenderer.ts.