From e8dd930a50dc8bbb094419213b51a216585807fd Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Tue, 22 Nov 2022 00:06:43 -0800 Subject: [PATCH] Add support for custom modifiers to d&d and clipboard Add support for custom modifiers to d&d and clipboard and remove now-redundant code in restoreTaskToUI. --- ui/media/js/dnd.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/media/js/dnd.js b/ui/media/js/dnd.js index 4c14333c..bb5dfe07 100644 --- a/ui/media/js/dnd.js +++ b/ui/media/js/dnd.js @@ -51,6 +51,13 @@ const TASK_MAPPING = { readUI: () => negativePromptField.value, parse: (val) => val }, + active_tags: { name: "Image Modifiers", + setUI: (active_tags) => { + refreshModifiersState(active_tags) + }, + readUI: () => activeTags.map(x => x.name), + parse: (val) => val + }, width: { name: 'Width', setUI: (width) => { const oldVal = widthField.value @@ -267,11 +274,6 @@ function restoreTaskToUI(task, fieldsToSkip) { // restore the original tag promptField.value = task.reqBody.original_prompt || task.reqBody.prompt - // Restore modifiers - if (task.reqBody.active_tags) { - refreshModifiersState(task.reqBody.active_tags) - } - // properly reset checkboxes if (!('use_face_correction' in task.reqBody)) { useFaceCorrectionField.checked = false