Persist Idea node size; prompt library in image workflows

This commit is contained in:
GenorTG
2026-11-10 15:09:30 +01:00
parent e6671d5cbd
commit a54a1507ea
2 changed files with 19 additions and 2 deletions
+1 -1
View File
@@ -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",
+18 -1
View File
@@ -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;
}