From a54a1507eabcaa3589bc3e6ef653be1ee7af50ea Mon Sep 17 00:00:00 2001 From: GenorTG Date: Tue, 10 Nov 2026 15:09:30 +0100 Subject: [PATCH] Persist Idea node size; prompt library in image workflows --- pyproject.toml | 2 +- web/promptforge_h3.js | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4c4c615..b4041f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "ComfyUI-PromptForge" description = "ComfyUI prompt enhancement suite: model/config node with GPU-aware auto settings, prompt enhancer with a preset catalog, and a standalone config finder." -version = "1.28.33" +version = "1.28.34" license = { file = "LICENSE" } dependencies = [ "transformers", diff --git a/web/promptforge_h3.js b/web/promptforge_h3.js index 3e58d8b..6f5a7bf 100644 --- a/web/promptforge_h3.js +++ b/web/promptforge_h3.js @@ -297,6 +297,7 @@ app.registerExtension({ } if (nodeData.name === IDEA) { + const SAVED = "h3_idea_size"; const onCreated = nodeType.prototype.onNodeCreated; nodeType.prototype.onNodeCreated = function () { onCreated?.apply(this, arguments); @@ -305,7 +306,23 @@ app.registerExtension({ for (const [name, fallback] of [["general_prompt", 150], ["negative_prompt", 60], ["dialogue", 60]]) makeResizable(node, find(name), name, fallback); const general = find("general_prompt"); addIdeas(node, (added) => { node.widgets.splice(node.widgets.indexOf(added), 1); node.widgets.splice(node.widgets.indexOf(general), 0, added); }); - node.setSize([Math.max(node.size[0], 560), Math.max(node.size[1], node.computeSize()[1])]); + node.promptforgeRestoreIdeaSize = () => { + const saved = node.properties?.[SAVED]; + node.setSize([Math.max(saved?.[0] || 560, 560), Math.max(saved?.[1] || node.size[1], node.computeSize()[1])]); + }; + node.promptforgeRestoreIdeaSize(); + }; + const onResize = nodeType.prototype.onResize; + nodeType.prototype.onResize = function (size) { + onResize?.apply(this, arguments); + this.properties = this.properties || {}; + this.properties[SAVED] = [Math.round(size[0]), Math.round(size[1])]; + }; + const onConfigure = nodeType.prototype.onConfigure; + nodeType.prototype.onConfigure = function () { + const result = onConfigure?.apply(this, arguments); + setTimeout(() => this.promptforgeRestoreIdeaSize?.(), 0); + return result; }; return; }