From 9b773390a2c507dca675c3e0bd6a25c006a34edd Mon Sep 17 00:00:00 2001 From: mcDandy Date: Thu, 28 May 2026 15:00:53 +0200 Subject: [PATCH] AI: frontend ready for V2 --- web/ScriptTextInput.vue | 613 +++++++++++++++++++++++++++++++++++++++ web/script_text_input.js | 24 +- 2 files changed, 634 insertions(+), 3 deletions(-) create mode 100644 web/ScriptTextInput.vue diff --git a/web/ScriptTextInput.vue b/web/ScriptTextInput.vue new file mode 100644 index 0000000..582db91 --- /dev/null +++ b/web/ScriptTextInput.vue @@ -0,0 +1,613 @@ + + + + + diff --git a/web/script_text_input.js b/web/script_text_input.js index bbbc4f5..9f17611 100644 --- a/web/script_text_input.js +++ b/web/script_text_input.js @@ -537,9 +537,16 @@ if (!window.__mrmthScriptInputUnifiedInit) { // ensure wrapper and editor container fill the desired height try { - wrapper.style.minHeight = '0'; - wrapper.style.height = desired + 'px'; - editorContainer.style.height = desired + 'px'; + wrapper.style.minHeight = '170px'; + // FIX: If the parent container is larger than the desired content height (e.g. node was enlarged/resized), + // allow it to occupy 100% of the parent height. Otherwise, let it match content size. + if (parentHeight && parentHeight > desired + 20) { + wrapper.style.height = '100%'; + editorContainer.style.height = '100%'; + } else { + wrapper.style.height = desired + 'px'; + editorContainer.style.height = desired + 'px'; + } } catch (e) { // ignore if elements unavailable } @@ -581,6 +588,17 @@ if (!window.__mrmthScriptInputUnifiedInit) { app.registerExtension({ name: "mrmth.ScriptTextInput.Unified", + nodeCreated(node, app) { + if (node.comfyClass === "mrmth_ScriptInput" || node.type === "mrmth_ScriptInput") { + const widget = node.widgets?.find(w => w.name === "script"); + if (widget) { + const isVue = app.ui?.settings?.getSettingValue?.("Comfy.VueNodes.Enabled") || document.getElementById("vue-app"); + if (isVue) { + widget.type = "scriptinput"; + } + } + } + }, async setup() { scan(document);