From 00909062bb56af198a09dcaa337da597694ae405 Mon Sep 17 00:00:00 2001 From: tritant Date: Sun, 5 Jul 2026 19:07:50 +0200 Subject: [PATCH] add prompt enhancer --- js/dynamique-ui.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/js/dynamique-ui.js b/js/dynamique-ui.js index 3d55edb..594a90c 100644 --- a/js/dynamique-ui.js +++ b/js/dynamique-ui.js @@ -73,6 +73,9 @@ function cleanupWidgets(node, targetConfigKeys) { "seed", "Prompt_count", "CreaPrompt_Collection", + "Enhancer", + "Enhancer_precision", + "Enhancer_preset", "separator_top", "separator_bottom" ]; @@ -234,6 +237,23 @@ app.registerExtension({ loadDefaultConfig(node); }, 100); + // ================= SPACER ENHANCER ================= + addCustomSpacer(node, "separator_enhancer", "Enhancer"); + { + const spIdx = node.widgets.findIndex(w => w.name === "separator_enhancer"); + const enhIdx = node.widgets.findIndex(w => w.name === "Enhancer"); + if (spIdx > -1 && enhIdx > -1) { + const [sp] = node.widgets.splice(spIdx, 1); + // Sérialisation SYMÉTRIQUE : le spacer est un widget normal avec une valeur. + // Il occupe le même slot dans widgets_values au serialize ET au configure, + // donc aucun décalage positionnel des widgets Enhancer. + delete sp.serialize; + delete sp.options; + sp.value = ""; + node.widgets.splice(enhIdx, 0, sp); + } + } + // ================= 1. SPACER HAUT ================= addCustomSpacer(node, "separator_top", "Preset Actions");