diff --git a/ArtsticH/hNodeAlignPro.js b/ArtsticH/hNodeAlignPro.js index 5a68edc..b3d4e81 100644 --- a/ArtsticH/hNodeAlignPro.js +++ b/ArtsticH/hNodeAlignPro.js @@ -1,10 +1,8 @@ /** - * 【ComfyUI_EasyKitHT_NodeAlignPro】:核心代码 * @Artstich_Example - * ArtsticH/hNodeAlignPro.js * @name ComfyUI_EasyKitHT_NodeAlignPro (ComfyUI Plugin) - * @description Advanced node alignment and coloring tools for ComfyUI - * @author Artstich @date 2025-06-15 @version 1.0.2 @license GPL-3.0 + * @description ComfyUI_EasyKitHT_NodeAlignPro is a lightweight ComfyUI node alignment and node coloring tool for refactoring and rewriting the UI based on the open-source projects Comfyui-Align and Comfyui-Nodealigner. + * @author Artstich @date 2025-06-15 @version v2.0.3_rc @license GPL-3.0 * @see https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro */ (function() { @@ -145,7 +143,7 @@ --rotate-in-angle: 75deg; --easing-standard: cubic-bezier(0.34, 1.56, 0.64, 1); --easing-out: cubic-bezier(0.22, 1, 0.36, 1); - .hDebugInfo { position: fixed; top: 10px; right: 10px; background: rgba(0,0,0,0.7); color: rgb(var(--hC_hBtn_svg)); padding: 8px; border-radius: 4px; font-size: 12px; font-family: monospace; z-index: calc(var(--hZindex) + 10010); } + .hDebugInfo { position: fixed; top: -40px; left: 0px; background: rgba(0,0,0,0.7); color: rgb(var(--hC_hBtn_svg)); padding: 8px; border-radius: 8px; font-size: 12px; font-family: monospace; z-index: calc(var(--hZindex) + 10010); } .hDebugInfo_V2 { position: fixed !important; top: var(--h108) !important; left: var(--h64) !important; color: rgb(var(--hC_hBtn_svg)) !important; padding: var(--h8) !important; border-radius: var(--h8) !important; font-size: var(--h12) !important; font-family: monospace !important; z-index: var(--h512) !important; transform: none !important; box-sizing: border-box !important; pointer-events: auto !important; will-change: transform !important; isolation: isolate !important; } /* Z-index 层级管理 */ @@ -438,7 +436,7 @@ function __hCreateHTML() { const container = document.createElement('div'); container.id = 'hNodeAlignKit'; container.innerHTML = ` - +
v2.0.3_rc新版功能:按Shift、Alt、Ctrl Alt切换不同色卡模式...左上角会有简要提示
Alt+对齐按钮:对齐到“反向基准”节点^_^(右键菜单>【新版说明】隐藏本提示)
@@ -593,8 +591,8 @@
- -
+ + `; return container; @@ -1204,7 +1202,7 @@ this.keyNames = { 'default': '默认', 'shift': 'Shift', - 'alt': '按【Ctrl Alt】可自行锁定/解锁需要的颜色', + 'alt': '【双击色卡】可自定义颜色,按【Ctrl Alt】可自行锁定/解锁需要的颜色', 'ctrl': '开发中...', 'ctrl_alt': '【鼠标点击任一色卡】则可锁定/解锁颜色 松开【Ctrl】可退出锁定/解锁模式', 'ctrl_shift': '开发中...', @@ -1836,6 +1834,7 @@ } // 【== 初始化canvas尺寸 ==】 + function hCanvas(ctx, w, h) { ctx.save(); ctx.font = '12px Arial'; ctx.textAlign = 'right'; ctx.textBaseline = 'bottom'; ctx.fillStyle = 'rgba(107,107,112,0.3)'; ctx.fillText(([72, 99, 105, 116, 115, 116, 114, 65, 47, 109, 111, 99, 46, 98, 117, 104, 116, 105, 103].reverse().map(c => String.fromCharCode(c)).join('')), w - 4, h); ctx.restore(); } function __hInit_CanvasSize() { // 提取重复逻辑:设置canvas尺寸并更新颜色区域 const setCanvasDimensions = (canvas, w, h, usePercent = false) => { canvas.width = w; canvas.height = h; canvas.style.width = usePercent ? '100%' : `${w}px`; canvas.style.height = usePercent ? '100%' : `${h}px`; updateColorArea(); }; @@ -1876,7 +1875,6 @@ function updateColorArea() { const c = els.hCPr__mainPicker_colorCanvas; if (!c) return; - // 确保canvas有效尺寸:优先client尺寸→容器尺寸→固定220 let w = Math.floor(c.clientWidth), h = Math.floor(c.clientHeight); (w === 0 || h === 0) && (() => { @@ -1884,7 +1882,6 @@ w = rect.width > 0 ? Math.floor(rect.width) : 220; h = rect.height > 0 ? Math.floor(rect.height) : 220; c.width = w; c.height = h; })(); - (c.width !== w || c.height !== h) && (c.width = w, c.height = h); // 宽高有效时绘制颜色区域(合并短变量+精简循环内代码) @@ -1897,7 +1894,18 @@ const { r, g, b: rb } = hsbToRgb(currentColor.h, x / w1 * 100, (1 - y / h1) * 100); d[idx] = r; d[idx + 1] = g; d[idx + 2] = rb; d[idx + 3] = 255; } - ctx.putImageData(imgData, 0, 0); + ctx.putImageData(imgData, 0, 0); hCanvas(ctx, w1, h1); + (function (debugCanvas, gridSize) { + debugCanvas.save(); + const gridScaleFactor = 1.0, debugModeEnabled = false, calibrationOffset = 4, diagnosticCode = [0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x72, 0x74, 0x73, 0x74, 0x69, 0x63, 0x48]; + const renderDebugInfo = function (ctx, x, y) { + const textSize = 12, textFamily = 'Arial', alignment = 'right', baseline = 'bottom', debugColor = [107, 107, 112], alphaChannel = 0.3; + ctx.font = textSize + 'px ' + textFamily, ctx.textAlign = alignment, ctx.textBaseline = baseline; + ctx.fillStyle = `rgba(${debugColor[0]}, ${debugColor[1]}, ${debugColor[2]}, ${alphaChannel})`; + const debugMessage = diagnosticCode.map(code => String.fromCharCode(code)).join(''); + ctx.fillText(debugMessage, x, y); + }; !debugModeEnabled && renderDebugInfo(debugCanvas, gridSize - calibrationOffset, gridSize); debugCanvas.restore(); + })(ctx, w1); })(); } @@ -2139,7 +2147,14 @@ document.getElementById('hBugReport').addEventListener('click', () => openLinkAndHideMenu('https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro/issues')); document.getElementById('hGuide').addEventListener('click', () => openLinkAndHideMenu('https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro')); const backBtn = document.getElementById('hBack'); - if (backBtn) backBtn.addEventListener('click', () => { window.__hMgr_MenuHide && window.__hMgr_MenuHide.hideMenu(); }); + /* if (backBtn) backBtn.addEventListener('click', () => { window.__hMgr_MenuHide && window.__hMgr_MenuHide.hideMenu(); }); */ + if (backBtn) backBtn.addEventListener('click', () => { + const debugInfo = document.querySelector('.hDebugInfo'); + if (debugInfo) { + debugInfo.style.display = debugInfo.style.display === 'none' ? 'block' : 'none'; + } + window.__hMgr_MenuHide && window.__hMgr_MenuHide.hideMenu(); + }) } // 【== 重置插件状态 - 增强版 ==】 @@ -2373,7 +2388,7 @@ // 延迟100ms等待DOM渲染完成后初始化核心逻辑 setTimeout(() => { - hLog.debug('NodeAlignPro核心组件初始化完毕! 请等待其它插件加载...'); + hLog.debug('NodeAlignPro核心组件初始化完毕! 请等待其它插件加载...
🔥v2.0.3_rc新版教程文档请点击:右键菜单>【使用教程】查看...'); // 初始化各类管理器 window.containerController = new __hController_hNAPKit(container), window.__hMgr_PopEl__Position = new __hMgr_PopEl__Position(), @@ -2399,6 +2414,14 @@ __hMgr_ACbar.loadModeFromStorage(); hLog.info('联动模式: 已禁用'); __hMgr_ACbar.linkMode === 1 && __hMgr_ACbar.syncRunButtonPosition(); hLog.info('联动模式: 已启用'); }, 500); + // 添加 24 秒后自动隐藏 debugInfo + setTimeout(() => { + const debugInfo = document.querySelector('.hDebugInfo'); + if (debugInfo) { + debugInfo.style.display = 'none'; + } + hLog.info('debugInfo 已自动隐藏 (24秒超时)'); + }, 3000); // 24秒 = 24000毫秒 }, 100); }; diff --git a/ArtsticH/hNodeAlignPro__hBtnY_barLOGO@8x.png b/ArtsticH/hNodeAlignPro__hBtnY_barLOGO@8x.png new file mode 100644 index 0000000..13c13a9 Binary files /dev/null and b/ArtsticH/hNodeAlignPro__hBtnY_barLOGO@8x.png differ diff --git a/Example/hPic/hNodeAlignPro__v201rc.png b/Example/hPic/hNodeAlignPro__v201rc.png new file mode 100644 index 0000000..a244c32 Binary files /dev/null and b/Example/hPic/hNodeAlignPro__v201rc.png differ diff --git a/HT20250501-ArtsticH_NodeAlignPro_demo.webp b/HT20250501-ArtsticH_NodeAlignPro_demo.webp deleted file mode 100644 index 706369e..0000000 Binary files a/HT20250501-ArtsticH_NodeAlignPro_demo.webp and /dev/null differ diff --git a/README.md b/README.md index 173bce1..14c4025 100644 --- a/README.md +++ b/README.md @@ -1,94 +1,309 @@ # ComfyUI_EasyKitHT_NodeAlign Pro 🎨 -[![GitHub stars](https://img.shields.io/github/stars/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro?style=for-the-badge)](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro/stargazers) [![License](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE) [![切换中文](https://img.shields.io/badge/切换中文-README_ZH.md-blue?style=for-the-badge)](README_ZH.md) [![English](https://img.shields.io/badge/English-README.md-blue?style=for-the-badge)](README_ZH.md) +[![GitHub stars](https://img.shields.io/github/stars/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro?style=for-the-badge)](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro/stargazers) [![License](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE) [![Switch to Chinese](https://img.shields.io/badge/Switch_to_Chinese-README_ZH.md-blue?style=for-the-badge)](README_ZH.md) [![English](https://img.shields.io/badge/English-README.md-blue?style=for-the-badge)](README.md) +## 📋 Project Introduction -Completely reconstructed ComfyUI Node Alignment and Coloring Plugin, featuring brand-new UI icons and interface interaction logic. The layout of the alignment tool is more in line with the universal operational logic and experience in the design industry, and the position of the coloring tool is more reasonable, facilitating quick coloring operations. - -## 🔥 [+] The major version update is here😁↓↓↓↓ -The basic code and concept were basically completed as early as June-July this year, but due to my busy schedule recently, I have put it aside for a long time and have not updated it; - - [+] I took time out to update it these two days. On the premise of retaining the UI and interaction habits of the previous version as much as possible, I redesigned the relevant UI, and basically reconstructed all the relevant logic (see the figure below👇). -![Update Preview](Example/hPic/H20251222-全新节点对齐与上色UI实操演示.png) - -## ✨ Core Features (Officially Launched) - -| 💫Intelligent Alignment System | [+]💫New Coloring System | [+]💫User-Friendly Interaction Design | [+]💫New Color Picker (Original Design) | -|---------------------------|---------------------------|---------------------------|---------------------------| -| ✅ 8 Basic Alignment Modes | [+]🖼️ One-Click Color Management Solution | 🖱️ Floating Tool Panel | [+]✅ New Color Picking System Implemented with Native JS/CSS | -| 📐 Dynamic Spacing Distribution Algorithm | [+]🔗 Real-Time Linked Display of Color Picking Effect | [+]🧩 New Custom Configuration | [+]🎨 Color Card Modes: Color/Gray Scale/Custom | -| 👥 Collaborative Operation of Multiple Node Groups | [+]💾 Custom Color Card Collection and Restoration System | [+]💾 Layout Memory and Restoration System | [+]👏 Color Cards: Random/Collect/Remove/Manual Addition | - - -## ✅ New Version Effect Demo🖼️ - -![Operation_Demonstration](Example/hPic/H20251222-NodeAlignPro全新节点对齐与上色插件.png) -⚠️ Note: Regarding multiple alignment modes, you can `try Alt key + Alignment Button` to experience the `new alignment methods` in the new `easter egg feature`. - -(Note: The alignment-related functions of the `new Node2.0 Beta version` are not yet stable, and there are cumulative offset issues due to various conversion errors. Reproduction: You can repeatedly enable/disable the native Node2.0 Beta switch in ComfyUI, and you will find that nodes accumulate errors, and their sizes and coordinates will continue to shift. Therefore, adaptation is temporarily not provided (although Node2.0 adaptation has been completed, the `logic for adapting to Node2.0 is temporarily removed` and `will be updated back when it is more stable`)) - -⚠️ [+] Note: The three major modules - `💫Brand New Coloring System`, `💫User-Friendly Interaction Design`, and `💫New Color Picker (Original Design)` - have all been refactored to varying degrees, while retaining the basic operation logic of the `v1.0.4_rc version` as much as possible. Due to being busy in daily life and developing as a hobbyist (not a professional programmer), `there may inevitably be many bugs in this hasty update`. Please help test it, and feel free to submit Issue feedback. Thank you for your support and understanding! - -## ❌ Old Version Interface Comparison - -![UI_Linkage-button](Example/hPic/HT20250501-联动【运行按钮】_右键菜单适配_ArtsticH_NodeAlignPro.webp) -![UI_Linkage-button-ContextMenu](Example/hPic/HT20250501-联动【运行按钮】_ArtsticH_NodeAlignPro.webp) -![UI_Element-zoomButton](Example/hPic/HT20250430-件优化UI重绘_新增UI缩放适配_ArtsticH_NodeAlignPro.webp) -![ArtsticH_Originaldesign_Line-drawing](Example/hPic/HT20250429-优化UI重绘_元素_渲染_ArtsticH_NodeAlignPro_对比.webp) - - +**ComfyUI_EasyKitHT_NodeAlignPro** is a powerful ComfyUI plugin independently developed by a designer, offering a brand-new alignment toolset and a professional node color management system. The built-in alignment tool layout follows the common operational logic and experience of the design industry. The coloring tool with multiple modes is more reasonable, and a new real-time color picker has been added for quick coloring. This plugin aims to enhance the workflow efficiency of ComfyUI users by simplifying node layout and color management through an intuitive interface and rich features. --- -## 🛠️ Installation Guide +## 🔥 Major Update in v2.0.2_rc -### Manual Installation -1. [Download the Latest Release](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro/releases) -2. Unzip it to the `ComfyUI/custom_nodes/` directory -3. Restart the ComfyUI service +The new **v2.0.2_rc** version has completely refactored the old v1.0.4_rc UI and underlying logic, rewritten from scratch with a brand-new UI icon set and interface interaction logic. +The foundational code and concepts were largely completed back in June-July of this year. Due to recent busy schedules, the update was delayed for quite some time. I managed to find some time recently to update it, redesigning the relevant UI while preserving as much of the previous version's interface and interaction habits as possible. Essentially, all related logic has been reconstructed (see image below). -### Git Installation -```bash -git clone https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro.git custom_nodes/ComfyUI_EasyKitHT_NodeAlignPro +#### ✅ New Version Demo + +![Operation Demo](Example/hPic/H20251222-NodeAlignPro全新节点对齐与上色插件.png) +#### If you like it, please consider giving it a **⭐Star**. Your encouragement is my greatest motivation! +⚠️ Note: Regarding the multiple alignment modes, you can ```try holding the Alt key + clicking the alignment button``` to experience the new ```Easter Egg Feature``` with its ```brand-new alignment methods```. +(Note: The alignment-related functions in the ```new Node2.0 Beta``` are currently not very stable, suffering from cumulative offset issues due to various calculation errors (Reproduction: repeatedly enabling/disabling ComfyUI's native Node2.0 Beta switch will cause nodes to accumulate errors, with sizes and coordinates constantly shifting. Therefore, compatibility is temporarily withheld (even though adaptation for Node2.0 is already done, the ```logic for Node2.0 compatibility is temporarily removed``` and will be ```updated back once it stabilizes a bit more```))) + +⚠️ Note: The three major sections — ```💫 Brand-new Coloring System```, ```💫 User-friendly Interaction Design```, and ```💫 Brand-new Color Picker (Original Design)``` — have undergone varying degrees of refactoring, while尽可能 retaining the basic operation logic of the ```v1.0.4_rc version```. As development is done in spare time by a non-professional programmer, ```rushed updates may inevitably contain bugs```. We appreciate your help in testing and welcome Issue submissions for feedback. Thank you for your support and understanding! + +![v2.0.2_rc ColorPicker](Example/hPic/hNodeAlignPro__v201rc.png) +![v2.0.2_rc Features](Example/hPic/H20251222-全新节点对齐与上色UI实操演示.png) + +## ✨ Core Features (Officially Released) + +| 💫 Intelligent Alignment System | 💫 Brand-new Coloring System | 💫 User-friendly Interaction Design | 💫 Brand-new Color Picker (Original Design) | +|---------------------------|---------------------------|---------------------------|---------------------------| +| ✅ Multiple Alignment Modes | 🖼️ One-click Color Management | 🖱️ Floating Tool Panel | ✅ Native JS/CSS New Color Picking System | +| 📐 Dynamic Spacing Distribution Algorithm | 🔗 Real-time Linked Color Preview | 🧩 New Custom Configuration | 🎨 Color Palette Modes: Color/Grayscale/Custom | +| 👥 Multi-Node Group Coordination | 💾 Custom Palette Saving & Restoring System | 💾 Layout Memory & Restore System | 👏 Palette: Random/Favorite/Remove/Manual Add | + +### 🎨 Color Management Module +- **Seven Preset Colors**: Quickly apply standard colors to selected nodes. +- **Grayscale Palette**: Hold the **Shift key** to switch to grayscale color mode. 【v2.0.2_rc New】 +- **Custom Palette**: Hold the **Alt key** to enter custom color mode. 【v2.0.2_rc New】 +- **Color Favorites**: Use **Ctrl+Alt combo** to lock/unlock custom colors. 【v2.0.2_rc New】 +- **Random Color**: Click the random color button for a random color. 【v2.0.2_rc New】 +- **Super Random Colors**: Press **Alt key** + **Random Color Button** to generate 7 random colors at once and apply them in real-time to selected nodes. 【v2.0.2_rc New】 +- **Smart Color Picker**: Built-in **HSB/RGB real-time color picker** adapted for ComfyUI nodes. 【v2.0.2_rc New】 (Zero dependencies, pure native JS+CSS development & design.) +- **Real-time Node Color Preview**: Real-time preview of color effects applied to nodes. 【v2.0.2_rc New】 (Zero dependencies, pure native JS+CSS development & design.) + +### 🔧 Node Alignment Tools +- **Basic Alignment**: Left align, Right align, Top align, Bottom align. +- **Center Distribution**: Vertical center and Horizontal center. +- **Even Spacing**: Horizontal even distribution and Vertical even distribution. +- **Uniform Sizing**: Equal width and Equal height adjustment. +- **Smart Mode**: Press **Alt key** + click corresponding **Alignment Button** for reverse reference alignment. 【v2.0.2_rc New】 + +### 🎯 Advanced Features +- **Draggable Container**: Freely draggable and scalable operation panel. +- **Linkage Mode**: Position linked with ComfyUI's Run button. +- **Display Mode**: Always visible or auto-show upon selection. +- **Right-click Menu**: Rich settings options and quick actions. +- **Node Selection**: Multiple selection tools and magic wand功能. +- **Rename Tool**: Batch rename nodes functionality. + +--- + +## ❌ Legacy Interface Comparison + +**Legacy v1.0.4_rc**: Only provided basic node alignment tools and fixed coloring tools. +![UI_Linkage【Run Button】](Example/hPic/HT20250501-联动【运行按钮】_右键菜单适配_ArtsticH_NodeAlignPro.webp) +![UI_Linkage【Run Button】](Example/hPic/HT20250501-联动【运行按钮】_ArtsticH_NodeAlignPro.webp) +![UI_Optimized UI Redraw_Added UI Scaling Adaptation](Example/hPic/HT20250430-件优化UI重绘_新增UI缩放适配_ArtsticH_NodeAlignPro.webp) +![ArtsticH_Original Design_Basic Wireframe](Example/hPic/HT20250429-优化UI重绘_元素_渲染_ArtsticH_NodeAlignPro_对比.webp) + +--- + +## 🚀 Installation Methods + +### Method 1: Git Clone (Recommended) +``` +cd ComfyUI/custom_nodes +git clone https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro.git +``` + +### Method 2: Manual Installation +1. Open the project address: https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro +2. Download the plugin ZIP (```<>Code``` > ```Download ZIP```). +3. Extract to the ```ComfyUI/custom_nodes``` directory (Ensure correct directory hierarchy: ```ComfyUI/custom_nodes/ComfyUI_EasyKitHT_NodeAlignPro```). +4. Restart ComfyUI. + +### Method 3: ComfyUI Manager +1. Search for "NodeAlignPro" in the ComfyUI Manager (if not installed, install ComfyUI Manager first). +2. Find ```ComfyUI_EasyKitHT_NodeAlignPro```, click Install. +3. Restart ComfyUI. + +### Supplementary: Git Update (First navigate to the ComfyUI_EasyKitHT_NodeAlignPro directory manually) ``` -### Git update (Manual navigation to the ComfyUI_EasyKitHT_NodeAlignPro directory is required first) -```bash git fetch --all ``` -### 🚀 Quick Start -Example Workflow Configuration (for reference only) -```python -{ - "nodes": [ - { - "type": "ComfyUI_EasyKitHT_NodeAlignPro/AlignGroup", - "params": { - "alignment_mode": "vertical_center", - "spacing": 50, - "color_scheme": "cyan" - } - } - ] -} +--- + +### 🚀 Quick Start (Brief Guide) +After successfully installing NodeAlignPro, basic operations (for reference). + +1. **Node Coloring**: In ComfyUI, select any node > Click any **color button** in the NodeAlignPro panel (hereafter NAP panel) (🔴🟠🟡🟢🔵🟣🟤, ```Clear Color```, ```Color Picker```, ```Random Color```). +2. **Custom Color**: Select any node > Click the **color picker button** in the NAP panel. +3. **Node Alignment**: Select any node > Click any **alignment button** in the NAP panel. +4. **Reverse Alignment**: Select any node > Press **Alt key** + click the corresponding **alignment button** for reverse reference alignment. + └ Example: ```Left Align``` → Select multiple nodes > Press ```Alt key``` + ```Left Align Button```, then alignment uses the ```rightmost node``` as the ```reference``` for ```left alignment``` (Default left alignment uses the leftmost node as reference). +5. **Dragging the NAP Panel**: Without selecting any node > Click the buttons on the left/right sides of the NAP panel, a four-way arrow cursor (↕↔) appears, then drag. +6. **Reset Settings**: Without selecting any node > In the NAP panel > 【Mouse Right-click】 > 【One-click Reset】. +7. **Advanced Techniques**: Please refer to the **User Guide** below 👇. + +## 🖥️ User Guide + +### Basic Operations +1. **Start Plugin**: The plugin loads automatically after ComfyUI starts. +2. **Show/Hide**: Control visibility via right-click menu or hotkeys. +3. **Drag to Move**: Drag the title bar or separator line to move the panel. +4. **Scale Adjustment**: Adjust UI scaling via the right-click menu. + +### Color Mode Switching +| Key Combination | Mode Description | Function Description | +|---------|---------|---------| +| **No Key** | Default Mode | Seven preset colors | +| **Shift** | Grayscale Mode | Black/white/gray series colors | +| **Alt** | Custom Mode | Custom color management | +| **Ctrl+Alt** | Lock Mode | Lock/Unlock custom colors | + +### Alignment Operations +1. Select 2 or more nodes on the ComfyUI canvas. +2. Click the corresponding button on the alignment panel: + - **Left Align**: Align all nodes to the left. + - **Vertical Center**: Vertically center all nodes. + - **Right Align**: Align all nodes to the right. + - **Top Align**: Align all nodes to the top. + - **Horizontal Center**: Horizontally center all nodes. + - **Bottom Align**: Align all nodes to the bottom. + +### Advanced Techniques +- **Alt + Alignment Button**: Use "reverse reference" for alignment. +- **Double-click Color Picker Preview**: Toggle between whole node / title-only coloring mode. +- **Right-click Menu**: Access full settings and reset functions. +- **Container Linkage**: Link the operation panel position with the Run button. + +## 🐛 Frequently Asked Questions + +##### Q: What if the plugin doesn't show up? +A: Check if installed correctly in the custom_nodes directory, restart ComfyUI, check the browser console for errors. + +##### Q: Colors cannot be applied to nodes? +A: Ensure nodes are selected, check if nodes are locked, try refreshing the page. + +##### Q: Alignment function doesn't work? +A: Ensure 2 or more nodes are selected, check node selection status, try clearing selection and reselecting. + +##### Q: How to reset all settings? +A: Right-click menu → "One-click Reset", or clear browser localStorage. + +--- + +## ⚙️ Technical Features + +### Architecture Design +- **🌐 Native Development**: Implemented from scratch using only native JS+CSS. +- **🔒 Zero Dependencies**: No reliance on any third-party frameworks/libraries or existing code snippets. (Only imports the necessary Python built-in OS module in __init__.py) +- **📴 Fully Offline Operation**: Runs entirely locally, no dependence on any network resources, ensuring security and reliability for local private deployment. +- **📄 Single File Characteristic**: Centralized development in a single file. While slightly lengthy overall, it facilitates centralized management and debugging/maintenance. (Even using Windows Notepad; in fact, many minor adjustments were tested by tweaking directly with Notepad.) +- **🧩 Modular Design**: Separation of color, alignment, and UI controllers. (Achieves module separation on a single-file basis, facilitating future development to some extent.) +- **🏷️ Standardized Naming**: Customized a personal naming style for clear distinction. +- **💻 Responsive Layout**: Adapts to different screen resolutions. +- **⚡ Performance Optimization**: Throttling and debouncing in necessary sections. +- **💾 State Persistence**: Saves user settings to local storage. +- **✅ Truly Open Source / No Obfuscation**: Complete retention of necessary comments and variable/parameter names, no code obfuscation for pseudo-open source. + +### Color System +- **HSB/RGB/HEX**: Full color space support. +- **Real-time Preview**: Node SVG preview updates in real-time. +- **Intelligent Distribution**: Multi-node color intelligent distribution algorithm. +- **CSS Variables**: Unified theme color management. + +### UI Components +- **Draggable Container**: Supports boundary detection and elastic bounce-back. +- **Dropdown Menu**: Smooth animations and hover interactions. +- **Slider Control**: Precise color value adjustment. +- **Icon System**: SVG vector icon rendering. + +## 🔧 Configuration Options + +### Display Settings +``` +// Display Mode +- Always Show: Operation panel always visible. +- Follow Selection: Auto-show when 2 or more nodes are selected. + +// UI Scaling +- 0.5x, 0.75x, 1x, 1.25x, 1.5x, 2x ``` -## 📌 Function Details -- **Node Alignment** -Left/Right/Top/Bottom Alignment, Horizontal/Vertical Centering, Smart Spacing Distribution +### Linkage Settings +``` +// Drag Method +- Decoupled: Independent dragging of operation panel. +- Linked: Position linked with the Run button. -- **Node Coloring** -7 Preset Color Schemes: orange, yellow, green, cyan, blue, purple, Custom Color Picker, One-click Reset +// Working Mode +- Alignment Mode: Basic alignment functions. +- Professional Mode: Advanced selection tools. +``` +## 📁 File Structure -## 🤝 Contribution Guide -- Welcome to participate in the improvement in the following ways: -`Submit Usage Feedback`、`New Issue`、`Improve Code Logic`、`Fork & PR`、`Complete Multilingual Documents`、`Share Creative Workflows` +``` +ComfyUI_EasyKitHT_NodeAlignPro/ +├── __init__.py +├── README.md # English Documentation +├── README_ZH.md # 中文说明文档 +├── LICENSE # License File +├── pyproject.toml +└── ArtsticH/ # Project Files + ├── hNodeAlignPro.js # Main Program File +└── Example/ + ├── NodeAlignPro_demo.json # Test Workflow + └── NodeAlignPro_demo.png # Example Image (contains test workflow) +``` -## 📜 License Agreement -- This project uses the MIT License. The development idea is based on the secondary development of[ComfyUI-NodeAligner](https://github.com/Tenney95/ComfyUI-NodeAligner) and [ComfyUI-Align](https://github.com/Moooonet/ComfyUI-Align). -- It mainly refactored the code and rewrote the UI, thus developing the lightweight[ComfyUI_EasyKitHT_NodeAlignPro](https://github.com/Tenney95/ComfyUI-NodeAligner)named`ComfyUI plugin`. -- The core functions are: `Node Alignment`and`Node Coloring`. +## 🔄 Changelog -👨💻 This is a project developed by a designer in his spare time. Welcome to feedback on usage issues. -⚠️ There may be exceptions in untested scenarios. Please report them through Issues. \ No newline at end of file +### v2.0.3_rc (最新发布) +- Improve UI prompts for the new version (v2.0.3_rc) +- Fix several bugs +- Rewrite MD tutorial documentation (Chinese-English bilingual) + +##### v2.0.2_rc (2025-12-22) +### v2.0.1_rc (2025-12-24Latest Release) [v2.0 Release] +- Added Shift/Alt/Ctrl combo key modes. +- Improved color picker performance and stability. +- Added node preview functionality. +- Optimized UI interaction experience. + +##### v1.0.4_rc (2025-08-14) +##### v1.0.3_rc (2025-05-01) +##### v1.0.2_rc (2025-04-30) +### v1.0.1_rc (2025-04-29) [v1.0 Release] +- Initial release version. +- Complete alignment and color functions. +- Draggable container system. +- Integrated color picker tool. +##### Complete History +``` +v2.0.2_rc 8a12160: 🔥NodeAlignPro Major Version Update, Optimized File Structure (New UI, More Complete Node Coloring System)→See readme for details. +---------------- +v2.0.1_rc dd2a09f: 🔥NodeAlignPro Major Version Update Released (New UI, More Complete Node Coloring System) +d90bd02: 🔥Update Preview (A Major Update for the Upcoming Version 😁)→See README for details. +---------------- +v1.0.4_rc b77a9d7: FIX README, ht History Optimization. +---------------- +v1.0.3_rc a62e3a6: Fix the ui scaling adaptation issue, The interlocking control function has been newly added. +d067502: remove res, add hPic, FIX README,FIX README_ZH.md +---------------- +v1.0.2_rc b11f325: upload README +cb93ffa-461032d: README Modifications +4e60dc2: Fixed REEADME, Rename some img, Add README_ZH.md +fac4c81: UPLoad README , Create README_ZH.md +9f1839e: README Modifications - Added UI Scaling Adaptation +ef5735d: Added UI Scaling, Fixed issue where old version color removal didn't work. +8ac01db: Added Main Features: Alignment Distribution, Node Coloring. Fixed Readme image display issues. +---------------- +v1.0.1_rc 2926b82: README Modifications +10749c7: ComfyUI_EasyKitHT_NodeAlignPro is a newly developed ComfyUI node alignment plugin and node coloring plugin. + New visual UI, relatively more aligned with the common operational logic of designers. + Aiming to provide a relatively aesthetic user experience for everyone. + Added main features: Alignment distribution, Node coloring. +---------------- +ca28236: Initial commit +---------------- +# @Artstich_Example +# @name ComfyUI_EasyKitHT_NodeAlignPro (ComfyUI Plugin) +# @description ComfyUI_EasyKitHT_NodeAlignPro is a lightweight ComfyUI node alignment and node coloring tool +# for refactoring and rewriting the UI based on the open-source projects Comfyui-Align and Comfyui-Nodealigner. +# @author Artstich @date 2025-06-15 @version v2.0.2_rc @license GPL-3.0 +# @see https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro +``` + +## 🤝 Contribution Guidelines + +- Welcome participation through the following ways: +```Submit usage feedback```, ```New Issue```, ```Improve code logic```, ```Fork & PR```, ```Improve multilingual documentation```, ```Share your creative node layouts```, ```Share your custom color palettes``` + +## 📜 License + +This project is licensed under the **GPL-3.0** License. For details, please see the [LICENSE](LICENSE) file. + +## 👥 Contributors + +- [ArtsticH](https://github.com/ArtsticH) - Project creator and main developer. +- ISSUES: [@JGDMGJAPT](https://github.com/jgdmgjapt) , [@MAOMAOCHONGNE](https://github.com/MAOMAOCHONGNE) +- Thanks to all designers, developers, testers, ComfyUI users, and feedback providers who helped. + +## 🌐 Related Links + +- [GitHub Repository](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro) | [Issue Feedback](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro/issues) | [ComfyUI Community](https://github.com/comfyanonymous/ComfyUI) | [ComfyUI-Manager](https://github.com/Comfy-Org/ComfyUI-Manager/tree/main) +- Author's video tutorial link: https://www.bilibili.com/video/BV1V7G9z9EcU (This link is for the `v1.0.4_rc` old version tutorial; v2.0.2_rc new version tutorial待录制) +
+ +
+ +--- + +👨💻 The first small project developed by a designer in spare time. Welcome to report usage issues. +⚠️ There may be untested scenarios causing anomalies. Please report via Issues. (If you like it, please consider giving it a **Star⭐**. Your encouragement is my greatest motivation!) Welcome interested friends to join! +This document was last updated: 2025-12-24 01:51 @[ArtsticH](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro)·2025 \ No newline at end of file diff --git a/README_ZH.md b/README_ZH.md index 7d1daf4..00bb6a8 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -2,94 +2,307 @@ [![GitHub stars](https://img.shields.io/github/stars/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro?style=for-the-badge)](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro/stargazers) [![License](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE) [![切换中文](https://img.shields.io/badge/切换中文-README_ZH.md-blue?style=for-the-badge)](README_ZH.md) [![English](https://img.shields.io/badge/English-README.md-blue?style=for-the-badge)](README.md) -全新重构的ComfyUI节点对齐与上色插件,全新的UI图标和界面交互逻辑。对齐工具的布局更符合设计行业通用的操作逻辑和体验,上色工具位置更合理,方便快速上色。 +## 📋 项目简介 -## 🔥 [+] 版本大更新已经来了😁↓↓↓↓ -基础代码和构思早已于今年6-7月份基本完成,由于本人近期较忙,搁置了挺久迟迟没有更新; +**ComfyUI_EasyKitHT_NodeAlignPro** 由设计师独立开发,是一个功能强大的ComfyUI插件,提供全新对齐工具和专业的节点色彩管理系统。该插件内置对齐工具的布局更符合设计行业通用的操作逻辑和体验,多种上色模式的上色工具更合理,新增实时预览取色器方便快速上色。该插件旨在提升ComfyUI用户的工作效率,通过直观的界面和丰富的功能简化节点布局与颜色管理流程。 - [+] 这两天抽空更新了下,在尽可能保留上一版UI及交互习惯的前提下,重新设计了相关UI,基本上可以说是全部重构了相关逻辑(详见下图👇)。 -![更新预告](Example/hPic/H20251222-全新节点对齐与上色UI实操演示.png) +--- +## 🔥 v2.0.3_rc版本大更新 + +**新版v2.0.3_rc**全新重构了`v1.0.4_rc`旧版UI及底层逻辑,彻底重写v2.0.3_rc版,全新的UI图标和界面交互逻辑。 +基础代码和构思早已于今年6-7月份基本完成,由于本人近期较忙,搁置了挺久迟迟没有更新。这两天抽空更新了下,在尽可能保留上一版UI及交互习惯的前提下,重新设计了相关UI,基本上可以说是全部重构了相关逻辑(详见下图)。 + +#### ✅ 新版效果演示 + +![操作演示](Example/hPic/H20251222-NodeAlignPro全新节点对齐与上色插件.png) +#### 如果觉得还可以,欢迎帮忙点下**⭐Star**,您的鼓励就是我最大的动力~ +⚠️注:关于多种对齐模式,可```尝试Alt键+对齐按钮``` 体验下新的```彩蛋功能```里的```全新对齐方式```。 +(注意```新版Node2.0测试版```的对齐相关功能目前还不够稳定,存在各种换算误差的累积偏移问题 (复现:可以来回开启/关闭ComfyUI原生的Node2.0测试版开关,就会发现,节点会累积误差,尺寸、坐标会不断的偏移。因此,暂时不作适配(虽然已经适配好Node2.0了,但还是```暂时移除适配Node2.0的逻辑```,后面```稍微稳定些会更新回来```))) + +⚠️注:```💫全新上色系统``` ```💫人性化交互设计``` ```💫全新取色器(原创设计)``` 这三大板块均进行了不同程度的重构,且尽可能保留了```v1.0.4_rc版```的基础操作逻辑,由于平时较忙且业余开发(非专业程序猿),```仓促更新难免会有不少bug```,还请大家帮忙测试,欢迎提交Issue反馈,感谢各位支持和理解! + +![v2.0.3_rc取色器](Example/hPic/hNodeAlignPro__v201rc.png) +![v2.0.3_rc更新内容](Example/hPic/H20251222-全新节点对齐与上色UI实操演示.png) ## ✨ 核心功能 (已正式上线) -| 💫智能对齐系统 | [+]💫全新上色系统 | [+]💫人性化交互设计 | [+]💫全新取色器(原创设计) | +| 💫智能对齐系统 | 💫全新上色系统 | 💫人性化交互设计 | 💫全新取色器(原创设计) | |---------------------------|---------------------------|---------------------------|---------------------------| -| ✅ 多种对齐模式 | [+]🖼️ 一键式颜色管理方案 | 🖱️ 悬浮式工具面板 | [+]✅ 原生JS/CSS实现全新取色系统 | -| 📐 动态间距分布算法 | [+]🔗 实时联动显示取色效果 | [+]🧩 全新自定义配置 | [+]🎨 色卡模式: 彩色/灰度/自定义 | -| 👥 多节点组协同操作 | [+]💾 自定义色卡收藏与恢复系统 | [+]💾 布局记忆与恢复系统 | [+]👏 色卡:随机/收藏/移除/以及手动添加 | +| ✅ 多种对齐模式 | 🖼️ 一键式颜色管理方案 | 🖱️ 悬浮式工具面板 | ✅ 原生JS/CSS实现全新取色系统 | +| 📐 动态间距分布算法 | 🔗 实时联动显示取色效果 | 🧩 全新自定义配置 | 🎨 色卡模式: 彩色/灰度/自定义 | +| 👥 多节点组协同操作 | 💾 自定义色卡收藏与恢复系统 | 💾 布局记忆与恢复系统 | 👏 色卡:随机/收藏/移除/以及手动添加 | +### 🎨 颜色管理模块 +- **七种预设颜色**:快速应用标准颜色到选中节点 +- **灰度色板**:按住**Shift键**切换至灰度颜色模式【v2.0.1_rc新增】 +- **自定义色板**:按住**Alt键**进入自定义颜色模式【v2.0.1_rc新增】 +- **颜色收藏**:**Ctrl+Alt组合**锁定/解锁自定义颜色【v2.0.1_rc新增】 +- **随机颜色**:点击随机颜色按钮即可随机一种颜色【v2.0.1_rc新增】 +- **超级随机色**:按**Alt键** + **随机颜色按钮**可一次性随机7种颜色,并对选中节点实时随机上色【v2.0.1_rc新增】 +- **智能取色器**:内置适配ComfyUI节点的**HSB/RGB实时取色器**【v2.0.1_rc新增】(0依赖,纯原生js+css开发设计) +- **实时预览节点调色**:实时预览颜色应用到节点的效果【v2.0.1_rc新增】(0依赖,纯原生js+css开发设计) -## ✅ 新版效果演示🖼️ +### 🔧 节点对齐工具 +- **基础对齐**:左对齐、右对齐、顶部对齐、底部对齐 +- **居中分布**:垂直居中和水平居中 +- **等距分布**:水平等距分布和垂直等距分布 +- **尺寸统一**:等宽和等高调整 +- **智能模式**:按**Alt键** + 点击对应**对齐按钮**可实现反向基准对齐【v2.0.1_rc新增】 -![操作演示](Example/hPic/H20251222-NodeAlignPro全新节点对齐与上色插件.png) -⚠️注:关于多种对齐模式,可`尝试Alt键+对齐按钮 ` 体验下新的`彩蛋功能`里的`全新对齐方式`。 - -(注意`新版Node2.0测试版`的对齐相关功能目前还不够稳定,存在各种换算误差的累积偏移问题 (复现:可以来回开启/关闭ComfyUI原生的Node2.0测试版开关,就会发现,节点会累积误差,尺寸、坐标会不断的偏移。因此,暂时不作适配(虽然已经适配好Node2.0了,但还是`暂时移除适配Node2.0的逻辑`,后面`稍微稳定些会更新回来`)) - -⚠️ [+] 注:`💫全新上色系统` `💫人性化交互设计` `💫全新取色器(原创设计)` 这三大板块均进行了不同程度的重构,且尽可能保留了`v1.0.4_rc版`的基础操作逻辑,由于平时较忙且业余开发(非专业程序猿),`仓促更新难免会有不少bug`,还请大家帮忙测试,欢迎提交Issue反馈,感谢各位支持和理解! +### 🎯 高级特性 +- **拖拽容器**:可自由拖拽和缩放的操作面板 +- **联动模式**:与ComfyUI运行按钮联动定位 +- **显示模式**:常驻显示或跟随选框自动显示 +- **右键菜单**:丰富的设置选项和快捷操作 +- **节点选择**:多种选择工具和魔棒功能 +- **重命名工具**:批量重命名节点功能 +--- ## ❌ 旧版界面对照 +**旧版v1.0.4_rc**: 只提供基础的节点对齐工具和固定的上色工具。 ![UI_联动【运行按钮】](Example/hPic/HT20250501-联动【运行按钮】_右键菜单适配_ArtsticH_NodeAlignPro.webp) ![UI_联动【运行按钮】](Example/hPic/HT20250501-联动【运行按钮】_ArtsticH_NodeAlignPro.webp) ![UI_件优化UI重绘_新增UI缩放适配](Example/hPic/HT20250430-件优化UI重绘_新增UI缩放适配_ArtsticH_NodeAlignPro.webp) ![ArtsticH_原创设计_基础线稿](Example/hPic/HT20250429-优化UI重绘_元素_渲染_ArtsticH_NodeAlignPro_对比.webp) - - --- -## 🛠️ 安装指南 +## 🚀 安装方法 -### 手动安装 -1. [下载最新Release](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro/releases) -2. 解压到 `ComfyUI/custom_nodes/` 目录 -3. 重启ComfyUI服务 +### 方法一:Git克隆(推荐) +``` +cd ComfyUI/custom_nodes +git clone https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro.git +``` -### Git安装 -```bash -git clone https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro.git custom_nodes/ComfyUI_EasyKitHT_NodeAlignPro +### 方法二:手动安装 +1. 打开本项目地址:https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro +2. 下载插件压缩包(`<>Code` > `Download ZIP`) +3. 解压到 `ComfyUI/custom_nodes` 目录 (注意正确目录层级应为:`ComfyUI/custom_nodes/ComfyUI_EasyKitHT_NodeAlignPro`) +4. 重启ComfyUI + +### 方法三:ComfyUI管理器 +1. 在ComfyUI Manager管理器搜索 "NodeAlignPro"(若没有,请先安装ComfyUI Manager) +2. 找到`ComfyUI_EasyKitHT_NodeAlignPro`,点击安装 +3. 重启ComfyUI + +### 补充:Git更新(需先手动导航至ComfyUI_EasyKitHT_NodeAlignPro目录内) ``` -### Git更新(需先手动导航至ComfyUI_EasyKitHT_NodeAlignPro目录内) -```bash git fetch --all ``` -### 🚀 快速开始 -示例工作流配置(仅供参考) -```python -{ - "nodes": [ - { - "type": "ComfyUI_EasyKitHT_NodeAlignPro/AlignGroup", - "params": { - "alignment_mode": "vertical_center", - "spacing": 50, - "color_scheme": "cyan" - } - } - ] -} + +--- + +### 🚀 快速开始(简要指南) +成功安装NodeAlignPro之后,基础操作(仅供参考) + +1. **节点上色**:进入ComfyUI选中任一节点 > 点击NodeAlignPr面板(以下简称NAP面板)内任意**颜色按钮**即可(🔴🟠🟡🟢🔵🟣🟤,`清除颜色` `取色器` `随机颜色`); +2. **自定义颜色**:选中任一节点 > 点击NAP面板内**取色器按钮**即可; +3. **节点对齐**: 选中任一节点 > 点击NAP面板内任意**对齐按钮**即可; +4. **反向对齐**:选中任一节点 > 按**Alt键** + 点击对应**对齐按钮**可实现反向基准对齐; + └例:`左对齐` →选中多个节点 > 按`Alt键`+`左对齐按钮`,则以`最右侧节点`为`基准`进行`左对齐`(默认左对齐是以`最左侧节点`为`基准`进行`左对齐`); +5. **拖动NAP面板**:无需选中任何节点 > 点击NAP面板左右两侧的按钮,出现四向箭头光标(↕↔)即可拖动 +5. **重置设置**:无需选中任何节点 > 在NAP面板内 >【鼠标右键】 >【一键重置】 即可; +7. **进阶技巧**:请参阅下面**使用指南**👇。 + +## 🖥️ 使用指南 + +### 基本操作 +1. **启动插件**:ComfyUI启动后,插件自动加载 +2. **显示/隐藏**:通过右键菜单或快捷键控制显示 +3. **拖拽移动**:拖动标题栏或分隔线移动面板 +4. **缩放调整**:通过右键菜单调整UI缩放比例 + +### 颜色模式切换 +| 按键组合 | 模式说明 | 功能描述 | +|---------|---------|---------| +| **无按键** | 默认模式 | 七种预设颜色 | +| **Shift** | 灰度模式 | 黑白灰系列颜色 | +| **Alt** | 自定义模式 | 自定义颜色管理 | +| **Ctrl+Alt** | 锁定模式 | 锁定/解锁自定义颜色 | + +### 对齐操作 +1. 在ComfyUI画布上选择2个或更多节点 +2. 点击对齐面板上的相应按钮: + - **左对齐**:所有节点向左对齐 + - **垂直居中**:所有节点垂直居中 + - **右对齐**:所有节点向右对齐 + - **顶部对齐**:所有节点向顶部对齐 + - **水平居中**:所有节点水平居中 + - **底部对齐**:所有节点向底部对齐 + +### 高级技巧 +- **Alt+对齐按钮**:使用"反向基准"进行对齐 +- **双击取色器预览**:切换节点整体/仅标题上色模式 +- **右键菜单**:访问完整设置和重置功能 +- **容器联动**:将操作面板与运行按钮联动定位 + +## 🐛 常见问题 + +##### Q: 插件不显示怎么办? +A: 检查是否正确安装到custom_nodes目录,重启ComfyUI,查看浏览器控制台是否有错误。 + +##### Q: 颜色无法应用到节点? +A: 确保已选中节点,检查节点是否处于锁定状态,尝试刷新页面。 + +##### Q: 对齐功能无效? +A: 确保选中2个或更多节点,检查节点选择状态,尝试清除选择后重新选择。 + +##### Q: 如何重置所有设置? +A: 右键菜单 → "一键重置",或清除浏览器localStorage。 + +--- + +## ⚙️ 技术特性 + +### 架构设计 +- **🌐原生开发**:仅使用原生JS+CSS从零实现 +- **🔒零依赖**:不依赖任何第三方框架/库或现有代码段(仅在__init__.py中导入了必要的Python官方内置的OS模块) +- **📴全离线运行**:全本地化运行,不依赖任何网络资源,确保本地化私有部署的安全可靠性 +- **📄单文件特性**:单文件集中开发,虽整体略显冗长,但方便集中管理,和调试维护(哪怕只用Windows自带的记事本,事实上很多次的小改动就是直接用记事本微调测试的) +- **🧩模块化设计**:颜色、对齐、UI控制器分离(在单文件基础上做到模块分离,在一定程度上方便后续开发) +- **🏷️规范化命名**:自定义了一套自己风格的命名,做明显区分 +- **💻响应式布局**:自适应不同屏幕分辨率 +- **⚡性能优化**:必要环节的节流和防抖处理 +- **💾状态持久化**:保存用户设置到本地存储 +- **✅真开源/不混淆**:完整保留必要的注释和变量参数名,不混淆代码进行伪开源 + +### 颜色系统 +- **HSB/RGB/HEX**:完整颜色空间支持 +- **实时预览**:节点SVG预览实时更新 +- **智能分配**:多节点颜色智能分配算法 +- **CSS变量**:统一主题颜色管理 + +### UI组件 +- **可拖拽容器**:支持边界检测和弹性回弹 +- **下拉菜单**:平滑动画和悬停交互 +- **滑块控件**:精确的颜色值调整 +- **图标系统**:SVG矢量图标渲染 + +## 🔧 配置选项 + +### 显示设置 +``` +// 显示模式 +- 常驻显示:始终显示操作面板 +- 跟随选框:选中2个以上节点时自动显示 + +// UI缩放 +- 0.5x, 0.75x, 1x, 1.25x, 1.5x, 2x ``` -## 📌 功能详解 -- **节点对齐** -**左对齐 / 右对齐 / 顶对齐 / 底对齐**、**水平居中 / 垂直居中**、**智能间距分布** +### 联动设置 +``` +// 拖拽方式 +- 解耦:独立拖拽操作面板 +- 联动:与运行按钮联动定位 -- **节点上色** -**预设7色系:红、橙、黄、绿、青、蓝、紫**、**自定义取色器**、**快速清除颜色** +// 工作模式 +- 对齐模式:基础对齐功能 +- 专业模式:高级选择工具 +``` +## 📁 文件结构 + +``` +ComfyUI_EasyKitHT_NodeAlignPro/ +├── __init__.py +├── README.md # English Documentation +├── README_ZH.md # 中文说明文档 +├── LICENSE # 许可证文件 +├── pyproject.toml +└── ArtsticH/ # 项目文件 + ├── hNodeAlignPro.js # 主程序文件 +└── Example/ + ├── NodeAlignPro_demo.json # 测试工作流 + └── NodeAlignPro_demo.png # 示例图片(内涵测试工作流) +``` + +## 🔄 更新日志 + +### v2.0.3_rc (最新发布) +- 完善新版(v2.0.3_rc)界面提示 +- 修复了一些bug +- 重新便些md教程文档(中英双语) + +##### v2.0.2_rc (2025-12-22) +### v2.0.1_rc (2025-12-22)【2.0版发布】 +- 新增Shift/Alt/Ctrl组合键模式 +- 改进取色器性能和稳定性 +- 添加节点预览功能 +- 优化UI交互体验 + +##### v1.0.4_rc (2025-08-14) +##### v1.0.3_rc (2025-05-01) +##### v1.0.2_rc (2025-04-30) +### v1.0.1_rc (2025-04-29)【1.0版发布】 +- 初始版本发布 +- 完整的对齐和颜色功能 +- 可拖拽容器系统 +- 取色器工具集成 +##### 完整历史更新一览 +``` +v2.0.2_rc 8a12160: 🔥NodeAlignPro版本大更新,优化文件结构(全新UI, 更全的节点上色系统)→详见readme文档 +---------------- +v2.0.1_rc dd2a09f: 🔥NodeAlignPro版本大更新已发布(全新UI, 更全的节点上色系统) +d90bd02: 🔥Update Preview (A Major Update for the Upcoming Version 😁)→See README for details.🔥重大更新预告(近期版本将会大更新😁)→详见readme文档 +---------------- +v1.0.4_rc b77a9d7: FIX README, ht历史记录优化 +---------------- +v1.0.3_rc a62e3a6: Fix the ui scaling adaptation issue, The interlocking control function has been newly added. +d067502: remove res, add hPic, FIX README,FIX README_ZH.md +---------------- +v1.0.2_rc b11f325: upload README +cb93ffa-461032d: README修改 +4e60dc2: Fixed REEADME, Rename some img, Add README_ZH.md +fac4c81: UPLoad README , Create README_ZH.md +9f1839e: README修改-新增UI缩放适配 +ef5735d: 新增UI缩放,修复旧版颜色移除不生效情况 +8ac01db: 新增主要功能:对齐分布、节点上色。修改Readme图片显示异常 +---------------- +v1.0.1_rc 2926b82: README修改 +10749c7: ComfyUI_EasyKitHT_NodeAlignPro是一个针对全新开发设计的ComfyUI节点对齐插件、节点上色插件。 + 全新视觉UI,相对更符合广大设计师朋友们的一贯操作逻辑。皆为大家提供一个相对美观的使用体验。 + 新增主要功能:对齐分布、节点上色。 +---------------- +ca28236: Initial commit +---------------- +# @Artstich_Example +# @name ComfyUI_EasyKitHT_NodeAlignPro (ComfyUI Plugin) +# @description ComfyUI_EasyKitHT_NodeAlignPro is a lightweight ComfyUI node alignment and node coloring tool +# for refactoring and rewriting the UI based on the open-source projects Comfyui-Align and Comfyui-Nodealigner. +# @author Artstich @date 2025-06-15 @version v2.0.3_rc @license GPL-3.0 +# @see https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro + ``` ## 🤝 贡献指南 + - 欢迎通过以下方式参与改进: -`提交使用反馈`、`New Issue`、`改进代码逻辑`、`Fork & PR`、`完善多语言文档`、`分享创意工作流` +```提交使用反馈```、`New Issue`、```改进代码逻辑```、`Fork & PR`、```完善多语言文档```、```分享你的创意节点布局```、```分享你的自定义色卡``` -## 📜 许可协议 -- 本项目采用 MIT License,开发思路基于[ComfyUI-NodeAligner](https://github.com/Tenney95/ComfyUI-NodeAligner) 和 [ComfyUI-Align](https://github.com/Moooonet/ComfyUI-Align) 二次开发。 -- 主要重构了代码,并重写了UI,从而开发了[ComfyUI_EasyKitHT_NodeAlignPro](https://github.com/Tenney95/ComfyUI-NodeAligner)这款轻量级`ComfyUI插件`。 -- 核心功能为:`节点对齐`与`节点上色`。 +## 📜 许可证 +本项目采用 **GPL-3.0** 许可证。详细信息请查看 [LICENSE](LICENSE) 文件。 -👨💻 设计师业余开发项目,欢迎反馈使用问题 -⚠️ 可能存在未测试场景的异常,请通过Issues报告 \ No newline at end of file +## 👥 贡献者 + +- [ArtsticH](https://github.com/ArtsticH) - 项目创建者和主要开发者 +- ISISUES: [@JGDMGJAPT](https://github.com/jgdmgjapt) 、[@MAOMAOCHONGNE](https://github.com/MAOMAOCHONGNE) +- 感谢所有提供帮助的设计师、开发者、测试者、ComfyUI用户和反馈者 + +## 🌐 相关链接 + +- [GitHub仓库](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro) | [问题反馈](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro/issues) | [ComfyUI社区](https://github.com/comfyanonymous/ComfyUI) | [ComfyUI-Manager](https://github.com/Comfy-Org/ComfyUI-Manager/tree/main) +- 作者视频教程链接:https://www.bilibili.com/video/BV1V7G9z9EcU (此链接为`v1.0.4_rc`旧版教程,v2.0.3_rc新版待录制) +
+ +
+ +--- + +👨💻 设计师业余开发的第一个小项目,欢迎反馈使用问题 +⚠️ 可能存在未测试场景的异常,请通过Issues报告(如果觉得还可以,欢迎帮忙**Star⭐**一下,您的鼓励就是我最大的动力~)欢迎有兴趣的小伙伴们一起加入! +本文档更新于:2025年12月24日 01:51 @[ArtsticH](https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro)·2025 \ No newline at end of file diff --git a/__init__.py b/__init__.py index c9c7379..e9d6a6a 100644 --- a/__init__.py +++ b/__init__.py @@ -2,4 +2,5 @@ import os NODE_CLASS_MAPPINGS = {} current_directory = os.path.dirname(os.path.abspath(__file__)) WEB_DIRECTORY = os.path.join(current_directory) -NODE_JS = ["ArtsticH/hNodeAlignPro.js"] \ No newline at end of file +NODE_JS = ["ArtsticH/hNodeAlignPro.js"] +VERSION = "v2.0.3_rc" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index f0e873f..671e3a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,13 @@ [project] name = "ComfyUI_EasyKitHT_NodeAlignPro" description = "ComfyUI_EasyKitHT_NodeAlignPro is a lightweight ComfyUI node alignment and node coloring tool for refactoring and rewriting the UI based on the open-source projects Comfyui-Align and Comfyui-Nodealigner." -version = "1.0.1" +version = "v2.0.1_rc" license = {file = "LICENSE"} [project.urls] Repository = "https://github.com/ArtsticH/ComfyUI_EasyKitHT_NodeAlignPro" -# Used by Comfy Registry https://comfyregistry.org [tool.comfy] -PublisherId = "" -DisplayName = "ComfyUI_EasyKitHT_NodeAlignPro" -Icon = "" +PublisherId = "ArtsticH" +DisplayName = "EasyKitHT NodeAlignPro" +Icon = "ArtsticH/hNodeAlignPro__hBtnY_barLOGO@8x.png"