From c576d582e2c2010c8e3badbb26b56d8dbb949ac6 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Wed, 8 Feb 2023 17:26:55 +0100 Subject: [PATCH] Add hook to implement custom prompt preprocessors --- ui/media/js/main.js | 2 ++ ui/media/js/plugins.js | 1 + 2 files changed, 3 insertions(+) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index b0842620..78015bad 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -1015,6 +1015,8 @@ function getPrompts(prompts) { promptsToMake = applyPermuteOperator(promptsToMake) promptsToMake = applySetOperator(promptsToMake) + PLUGINS['GET_PROMPTS_HOOK'].forEach(fn => { promptsToMake = fn(promptsToMake) }) + return promptsToMake } diff --git a/ui/media/js/plugins.js b/ui/media/js/plugins.js index 3a8bd4a3..2c39ebb8 100644 --- a/ui/media/js/plugins.js +++ b/ui/media/js/plugins.js @@ -25,6 +25,7 @@ const PLUGINS = { * }) */ IMAGE_INFO_BUTTONS: [], + GET_PROMPTS_HOOK: [], MODIFIERS_LOAD: [], TASK_CREATE: [], OUTPUTS_FORMATS: new ServiceContainer(