From 2a31f6af2db20c0b7003c9abf5894c57e0d405e2 Mon Sep 17 00:00:00 2001 From: equal-l2 Date: Fri, 28 Mar 2025 00:47:30 +0900 Subject: [PATCH 1/2] Remove Block Entropy references Block Entropy shut down their service at the end of 2024. --- public/index.html | 15 ---- .../extensions/stable-diffusion/index.js | 73 ---------------- .../extensions/stable-diffusion/settings.html | 3 +- public/scripts/openai.js | 71 ---------------- public/scripts/secrets.js | 2 - public/scripts/slash-commands.js | 1 - public/scripts/tokenizers.js | 9 -- src/constants.js | 1 - src/endpoints/backends/chat-completions.js | 10 --- src/endpoints/secrets.js | 1 - src/endpoints/stable-diffusion.js | 84 ------------------- 11 files changed, 1 insertion(+), 269 deletions(-) diff --git a/public/index.html b/public/index.html index 12ae48143..4cce6ccc6 100644 --- a/public/index.html +++ b/public/index.html @@ -2745,7 +2745,6 @@ - @@ -3375,20 +3374,6 @@ -
-

Block Entropy API Key

-
- - -
-
- For privacy reasons, your API key will be hidden after you reload the page. -
-

Select a Model

-
- -
-

Custom Endpoint (Base URL)

diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index 923ee526b..c0329b45e 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -77,7 +77,6 @@ const sources = { drawthings: 'drawthings', pollinations: 'pollinations', stability: 'stability', - blockentropy: 'blockentropy', huggingface: 'huggingface', nanogpt: 'nanogpt', bfl: 'bfl', @@ -1300,7 +1299,6 @@ async function onModelChange() { sources.togetherai, sources.pollinations, sources.stability, - sources.blockentropy, sources.huggingface, sources.nanogpt, sources.bfl, @@ -1511,9 +1509,6 @@ async function loadSamplers() { case sources.stability: samplers = ['N/A']; break; - case sources.blockentropy: - samplers = ['N/A']; - break; case sources.huggingface: samplers = ['N/A']; break; @@ -1701,9 +1696,6 @@ async function loadModels() { case sources.stability: models = await loadStabilityModels(); break; - case sources.blockentropy: - models = await loadBlockEntropyModels(); - break; case sources.huggingface: models = [{ value: '', text: '' }]; break; @@ -1799,26 +1791,6 @@ async function loadTogetherAIModels() { return []; } -async function loadBlockEntropyModels() { - if (!secret_state[SECRET_KEYS.BLOCKENTROPY]) { - console.debug('Block Entropy API key is not set.'); - return []; - } - - const result = await fetch('/api/sd/blockentropy/models', { - method: 'POST', - headers: getRequestHeaders(), - }); - console.log(result); - if (result.ok) { - const data = await result.json(); - console.log(data); - return data; - } - - return []; -} - async function loadNanoGPTModels() { if (!secret_state[SECRET_KEYS.NANOGPT]) { console.debug('NanoGPT API key is not set.'); @@ -2097,9 +2069,6 @@ async function loadSchedulers() { case sources.stability: schedulers = ['N/A']; break; - case sources.blockentropy: - schedulers = ['N/A']; - break; case sources.huggingface: schedulers = ['N/A']; break; @@ -2188,9 +2157,6 @@ async function loadVaes() { case sources.stability: vaes = ['N/A']; break; - case sources.blockentropy: - vaes = ['N/A']; - break; case sources.huggingface: vaes = ['N/A']; break; @@ -2757,9 +2723,6 @@ async function sendGenerationRequest(generationType, prompt, additionalNegativeP case sources.stability: result = await generateStabilityImage(prefixedPrompt, negativePrompt, signal); break; - case sources.blockentropy: - result = await generateBlockEntropyImage(prefixedPrompt, negativePrompt, signal); - break; case sources.huggingface: result = await generateHuggingFaceImage(prefixedPrompt, signal); break; @@ -2828,40 +2791,6 @@ async function generateTogetherAIImage(prompt, negativePrompt, signal) { } } -async function generateBlockEntropyImage(prompt, negativePrompt, signal) { - const result = await fetch('/api/sd/blockentropy/generate', { - method: 'POST', - headers: getRequestHeaders(), - signal: signal, - body: JSON.stringify({ - prompt: prompt, - negative_prompt: negativePrompt, - model: extension_settings.sd.model, - steps: extension_settings.sd.steps, - width: extension_settings.sd.width, - height: extension_settings.sd.height, - seed: extension_settings.sd.seed >= 0 ? extension_settings.sd.seed : undefined, - }), - }); - - if (result.ok) { - const data = await result.json(); - - // Default format is 'jpg' - let format = 'jpg'; - - // Check if a format is specified in the result - if (data.format) { - format = data.format.toLowerCase(); - } - - return { format: format, data: data.images[0] }; - } else { - const text = await result.text(); - throw new Error(text); - } -} - /** * Generates an image using the Pollinations API. * @param {string} prompt - The main instruction used to guide the image generation. @@ -3845,8 +3774,6 @@ function isValidState() { return true; case sources.stability: return secret_state[SECRET_KEYS.STABILITY]; - case sources.blockentropy: - return secret_state[SECRET_KEYS.BLOCKENTROPY]; case sources.huggingface: return secret_state[SECRET_KEYS.HUGGINGFACE]; case sources.nanogpt: diff --git a/public/scripts/extensions/stable-diffusion/settings.html b/public/scripts/extensions/stable-diffusion/settings.html index 32ecfe28f..2ff19a797 100644 --- a/public/scripts/extensions/stable-diffusion/settings.html +++ b/public/scripts/extensions/stable-diffusion/settings.html @@ -38,7 +38,6 @@