Fix ComfyUI workflow not saving
This commit is contained in:
parent
47d99a0047
commit
66c4824a8a
|
@ -30,7 +30,7 @@ import { SlashCommand } from '../../slash-commands/SlashCommand.js';
|
||||||
import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from '../../slash-commands/SlashCommandArgument.js';
|
import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from '../../slash-commands/SlashCommandArgument.js';
|
||||||
import { debounce_timeout } from '../../constants.js';
|
import { debounce_timeout } from '../../constants.js';
|
||||||
import { SlashCommandEnumValue } from '../../slash-commands/SlashCommandEnumValue.js';
|
import { SlashCommandEnumValue } from '../../slash-commands/SlashCommandEnumValue.js';
|
||||||
import { POPUP_TYPE, callGenericPopup } from '../../popup.js';
|
import { POPUP_TYPE, Popup, callGenericPopup } from '../../popup.js';
|
||||||
export { MODULE_NAME };
|
export { MODULE_NAME };
|
||||||
|
|
||||||
const MODULE_NAME = 'sd';
|
const MODULE_NAME = 'sd';
|
||||||
|
@ -3150,7 +3150,12 @@ async function onComfyOpenWorkflowEditorClick() {
|
||||||
}),
|
}),
|
||||||
})).json();
|
})).json();
|
||||||
const editorHtml = $(await $.get('scripts/extensions/stable-diffusion/comfyWorkflowEditor.html'));
|
const editorHtml = $(await $.get('scripts/extensions/stable-diffusion/comfyWorkflowEditor.html'));
|
||||||
const popupResult = callGenericPopup(editorHtml, POPUP_TYPE.CONFIRM, '', { okButton: 'Save', cancelButton: 'Cancel', wide: true, large: true });
|
const saveValue = (/** @type {Popup} */ _popup) => {
|
||||||
|
workflow = $('#sd_comfy_workflow_editor_workflow').val().toString();
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
const popup = new Popup(editorHtml, POPUP_TYPE.CONFIRM, '', { okButton: 'Save', cancelButton: 'Cancel', wide: true, large: true, onClosing: saveValue });
|
||||||
|
const popupResult = popup.show();
|
||||||
const checkPlaceholders = () => {
|
const checkPlaceholders = () => {
|
||||||
workflow = $('#sd_comfy_workflow_editor_workflow').val().toString();
|
workflow = $('#sd_comfy_workflow_editor_workflow').val().toString();
|
||||||
$('.sd_comfy_workflow_editor_placeholder_list > li[data-placeholder]').each(function (idx) {
|
$('.sd_comfy_workflow_editor_placeholder_list > li[data-placeholder]').each(function (idx) {
|
||||||
|
@ -3219,7 +3224,7 @@ async function onComfyOpenWorkflowEditorClick() {
|
||||||
headers: getRequestHeaders(),
|
headers: getRequestHeaders(),
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
file_name: extension_settings.sd.comfy_workflow,
|
file_name: extension_settings.sd.comfy_workflow,
|
||||||
workflow: $('#sd_comfy_workflow_editor_workflow').val().toString(),
|
workflow: workflow,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|
Loading…
Reference in New Issue