From e3e6fa22187f5e25a661770a385142f747292f05 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 3 Sep 2023 00:41:26 +0300 Subject: [PATCH] Connect to AUTO111 without Extras. Add NAI Diffusion. --- .../extensions/stable-diffusion/index.js | 501 +++++++++++++----- .../extensions/stable-diffusion/settings.html | 94 ++++ server.js | 234 +++++++- 3 files changed, 692 insertions(+), 137 deletions(-) create mode 100644 public/scripts/extensions/stable-diffusion/settings.html diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index 38d26cb4d..efb190770 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -10,11 +10,13 @@ import { appendImageToMessage, generateQuietPrompt, this_chid, + getCurrentChatId, } from "../../../script.js"; -import { getApiUrl, getContext, extension_settings, doExtrasFetch, modules } from "../../extensions.js"; +import { getApiUrl, getContext, extension_settings, doExtrasFetch, modules, renderExtensionTemplate } from "../../extensions.js"; import { selected_group } from "../../group-chats.js"; import { stringFormat, initScrollHeight, resetScrollHeight, timestampToMoment, getCharaFilename, saveBase64AsFile } from "../../utils.js"; import { getMessageTimeStamp, humanizedDateTime } from "../../RossAscends-mods.js"; +import { SECRET_KEYS, secret_state } from "../../secrets.js"; export { MODULE_NAME }; // Wraps a string into monospace font-face span @@ -27,10 +29,12 @@ const p = a => `
${a}
` const MODULE_NAME = 'sd'; const UPDATE_INTERVAL = 1000; -const postHeaders = { - 'Content-Type': 'application/json', - 'Bypass-Tunnel-Reminder': 'bypass', -}; +const sources = { + extras: 'extras', + horde: 'horde', + auto: 'auto', + novel: 'novel', +} const generationMode = { CHARACTER: 0, @@ -116,6 +120,8 @@ const helpString = [ ].join('