Add event emitter subsystem.

This commit is contained in:
SillyLossy
2023-05-16 16:28:38 +03:00
parent 07bc7c434a
commit 5bfd3787fa
5 changed files with 91 additions and 4 deletions

View File

@ -5,7 +5,9 @@ import {
hideSwipeButtons,
showSwipeButtons,
callPopup,
getRequestHeaders
getRequestHeaders,
event_types,
eventSource
} from "../../../script.js";
import { getApiUrl, getContext, extension_settings, defaultRequestArgs, modules } from "../../extensions.js";
import { stringFormat, initScrollHeight, resetScrollHeight } from "../../utils.js";
@ -611,6 +613,9 @@ jQuery(async () => {
initScrollHeight($("#sd_negative_prompt"));
})
await loadSettings();
eventSource.on(event_types.EXTRAS_CONNECTED, async () => {
await Promise.all([loadSamplers(), loadModels()]);
});
await loadSettings();
});