From 87e04f61e46955c83b77882d048eefd4e5aec425 Mon Sep 17 00:00:00 2001 From: Raykosan <71210053+Raykosan@users.noreply.github.com> Date: Fri, 7 Aug 2026 17:21:59 +0300 Subject: [PATCH] Interface changes in multiple nodes --- __init__.py | 2 +- package.json | 2 +- pyproject.toml | 2 +- web/rs_image-text.js | 26 ++------------------------ 4 files changed, 5 insertions(+), 27 deletions(-) diff --git a/__init__.py b/__init__.py index 0598bef..79db726 100644 --- a/__init__.py +++ b/__init__.py @@ -29,7 +29,7 @@ IGNORED_MODULES: Set[str] = {'__init__.py'} REQUIRED_MODULES: Set[str] = set() PACKAGE_DISPLAY_NAME = "ComfyUI_RaykoStudio" -__version__ = "0.36.3" +__version__ = "0.36.4" def load_modules(): print(f"🦊 {PACKAGE_DISPLAY_NAME}: Version: {__version__}") diff --git a/package.json b/package.json index 1f05a9e..3c76658 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ComfyUI_RaykoStudio", - "version": "0.36.3", + "version": "0.36.4", "description": "Set of custom nodes for ComfyUI providing additional image processing capabilities", "author": "Raykosan", "license": "Apache License 2.0", diff --git a/pyproject.toml b/pyproject.toml index 59471e6..f730579 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "ComfyUI_RaykoStudio" description = "Set of custom nodes for ComfyUI providing additional image processing capabilities" -version = "0.36.3" +version = "0.36.4" license = { file = "LICENSE" } dependencies = ["torch", "numpy", "Pillow>=10.0.0", "freetype-py>=2.5.1", "pycairo>=1.29.0", "scipy>=1.10.0"] diff --git a/web/rs_image-text.js b/web/rs_image-text.js index dca516d..3ce74f1 100644 --- a/web/rs_image-text.js +++ b/web/rs_image-text.js @@ -20,7 +20,7 @@ app.registerExtension({ const MIN_WIDTH = 360; const MIN_HEIGHT = 520; - const PREVIEW_FIXED_HEIGHT = 250; + const PREVIEW_FIXED_HEIGHT = 150; node.MIN_WIDTH = MIN_WIDTH; node.MIN_HEIGHT = MIN_HEIGHT; @@ -75,7 +75,6 @@ app.registerExtension({ node.imageLoaded = false; node.imageLoading = false; - // --- DOM UI --- const mainContainer = document.createElement("div"); mainContainer.style.cssText = ` width: 100%; @@ -88,7 +87,6 @@ app.registerExtension({ pointer-events: none; `; - // Mode buttons const modeContainer = document.createElement("div"); modeContainer.style.cssText = "display:flex; gap:8px; width:100%; pointer-events: auto;"; @@ -120,7 +118,6 @@ app.registerExtension({ }; updateModeVisuals(); - // Prefix input const prefixContainer = document.createElement("div"); prefixContainer.style.cssText = "display:flex; align-items:center; gap:8px; width:100%; pointer-events: auto;"; @@ -142,7 +139,6 @@ app.registerExtension({ prefixContainer.appendChild(prefixLabel); prefixContainer.appendChild(prefixInput); - // Text area const textContainer = document.createElement("div"); textContainer.style.cssText = "width:100%; pointer-events: auto;"; @@ -158,7 +154,6 @@ app.registerExtension({ }; textContainer.appendChild(customTextArea); - // Buttons const buttonsContainer = document.createElement("div"); buttonsContainer.style.cssText = "display:flex; gap:8px; width:100%; pointer-events: auto;"; @@ -200,7 +195,6 @@ app.registerExtension({ cursor: pointer; box-sizing: border-box; flex-shrink: 0; - margin-top: 28px; `; const placeholder = document.createElement("div"); @@ -213,20 +207,15 @@ app.registerExtension({ previewImg.alt = "Image preview"; previewWrap.appendChild(previewImg); - const imgInfo = document.createElement("div"); - imgInfo.style.cssText = "width:100%; text-align:center; color:#888; font-size:13px; font-family:sans-serif; pointer-events:none; user-select:none; display:none; margin-top:-1px; margin-bottom:-28px;"; - mainContainer.appendChild(modeContainer); mainContainer.appendChild(prefixContainer); mainContainer.appendChild(textContainer); mainContainer.appendChild(buttonsContainer); - mainContainer.appendChild(imgInfo); mainContainer.appendChild(previewWrap); node.addDOMWidget("custom_widgets", "customtext", mainContainer); node.customTextArea = customTextArea; - // --- LOAD / UPLOAD --- const buildViewUrl = (imagePath) => { let filename = imagePath; let subfolder = ""; @@ -240,7 +229,6 @@ app.registerExtension({ return url + `&t=${Date.now()}`; }; - // Запрос тСкста с бэкСнда для Ρ€Π΅ΠΆΠΈΠΌΠ° Read let promptRequestId = 0; const fetchTextForRead = async (imagePath) => { if (node.data.mode !== "read" || !imagePath) return; @@ -282,11 +270,8 @@ app.registerExtension({ node.imageLoaded = true; previewImg.style.display = "block"; placeholder.style.display = "none"; - imgInfo.style.display = "block"; - imgInfo.textContent = `${previewImg.naturalWidth} Γ— ${previewImg.naturalHeight}`; node.syncData(); - // Π’ Ρ€Π΅ΠΆΠΈΠΌΠ΅ Read автоматичСски ΠΈΠ·Π²Π»Π΅ΠΊΠ°Π΅ΠΌ тСкст fetchTextForRead(imagePath); }; previewImg.onerror = () => { @@ -294,7 +279,6 @@ app.registerExtension({ node.imageLoaded = false; previewImg.style.display = "none"; placeholder.style.display = "block"; - imgInfo.style.display = "none"; node.syncData(); }; previewImg.src = buildViewUrl(imagePath); @@ -336,7 +320,6 @@ app.registerExtension({ fileInput.click(); }; - // --- DRAG & DROP (ΠΈΠ· ΠΏΡ€ΠΈΠΌΠ΅Ρ€Π°) --- const onDocumentDragOver = (e) => { if (e.dataTransfer && e.dataTransfer.types.includes('Files')) { e.preventDefault(); @@ -382,9 +365,7 @@ app.registerExtension({ previewWrap.addEventListener('click', () => { node.triggerFileUpload(); }); - // -------------------------------------- - // Serialize / Configure node.onSerialize = function (o) { syncWidget(w_mode, 'mode'); syncWidget(w_prefix, 'prefix'); @@ -428,7 +409,6 @@ app.registerExtension({ }; document.addEventListener("visibilitychange", node.visibilityHandler); - // Resize const originalOnResize = node.onResize; node.onResize = function (size) { if (size[0] < MIN_WIDTH) size[0] = MIN_WIDTH; @@ -437,7 +417,7 @@ app.registerExtension({ const titleBarHeight = 30; const topPadding = 18; const gap = 8; - const bottomPadding = 20; + const bottomPadding = 5; const previewSpacing = 35; const fixedElements = titleBarHeight + topPadding + @@ -457,7 +437,6 @@ app.registerExtension({ node.setDirtyCanvas(true, true); }; - // Cleanup const originalOnRemoved = node.onRemoved; node.onRemoved = function () { document.removeEventListener("visibilitychange", node.visibilityHandler); @@ -466,7 +445,6 @@ app.registerExtension({ if (originalOnRemoved) originalOnRemoved.apply(this, arguments); }; - // Background only (preview is now DOM) node.onDrawBackground = function (ctx) { const w = this.size[0]; const h = this.size[1];