From 5dba4fa448b9e40ecf23283373862c736d510228 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 30 Jun 2024 22:12:44 +0300 Subject: [PATCH] Update SD extension to new popup --- .../scripts/extensions/stable-diffusion/index.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index 49f5e2d78..cfff05c8d 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -3,7 +3,6 @@ import { systemUserName, hideSwipeButtons, showSwipeButtons, - callPopup, getRequestHeaders, event_types, eventSource, @@ -29,10 +28,9 @@ import { getMultimodalCaption } from '../shared.js'; import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js'; import { SlashCommand } from '../../slash-commands/SlashCommand.js'; import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from '../../slash-commands/SlashCommandArgument.js'; -import { resolveVariable } from '../../variables.js'; import { debounce_timeout } from '../../constants.js'; -import { commonEnumProviders } from '../../slash-commands/SlashCommandCommonEnumsProvider.js'; import { SlashCommandEnumValue } from '../../slash-commands/SlashCommandEnumValue.js'; +import { POPUP_TYPE, callGenericPopup } from '../../popup.js'; export { MODULE_NAME }; const MODULE_NAME = 'sd'; @@ -572,7 +570,7 @@ async function onDeleteStyleClick() { return; } - const confirmed = await callPopup(`Are you sure you want to delete the style "${selectedStyle}"?`, 'confirm', '', { okButton: 'Delete' }); + const confirmed = await callGenericPopup(`Are you sure you want to delete the style "${selectedStyle}"?`, POPUP_TYPE.CONFIRM, '', { okButton: 'Delete', cancelButton: 'Cancel' }); if (!confirmed) { return; @@ -601,7 +599,7 @@ async function onDeleteStyleClick() { } async function onSaveStyleClick() { - const userInput = await callPopup('Enter style name:', 'input', '', { okButton: 'Save' }); + const userInput = await callGenericPopup('Enter style name:', POPUP_TYPE.INPUT); if (!userInput) { return; @@ -670,7 +668,7 @@ async function refinePrompt(prompt, allowExpand, isNegative = false) { if (extension_settings.sd.refine_mode) { const text = isNegative ? '