Small fixes

a9700c0ff0764ed9fc8e1c93250e92f26df969cd

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +25 -4Ignore whitespace
public/scripts/extensions/stable-diffusion/index.js+22 -1
@@ -1242,7 +1242,16 @@ async function onModelChange() {
12421242 extension_settings.sd.model = $('#sd_model').find(':selected').val();
12431243 saveSettingsDebounced();
12441244
1245- const cloudSources = [sources.horde, sources.novel, sources.openai, sources.togetherai, sources.pollinations, sources.stability, sources.blockentropy];
1245+ const cloudSources = [
1246+ sources.horde,
1247+ sources.novel,
1248+ sources.openai,
1249+ sources.togetherai,
1250+ sources.pollinations,
1251+ sources.stability,
1252+ sources.blockentropy,
1253+ sources.huggingface,
1254+ ];
12461255
12471256 if (cloudSources.includes(extension_settings.sd.source)) {
12481257 return;
@@ -1457,6 +1466,9 @@ async function loadSamplers() {
14571466 case sources.blockentropy:
14581467 samplers = ['N/A'];
14591468 break;
1469+ case sources.huggingface:
1470+ samplers = ['N/A'];
1471+ break;
14601472 }
14611473
14621474 for (const sampler of samplers) {
@@ -1646,6 +1658,9 @@ async function loadModels() {
16461658 case sources.blockentropy:
16471659 models = await loadBlockEntropyModels();
16481660 break;
1661+ case sources.huggingface:
1662+ models = [{ value: '', text: '<Enter Model ID above>' }];
1663+ break;
16491664 }
16501665
16511666 for (const model of models) {
@@ -1993,6 +2008,9 @@ async function loadSchedulers() {
19932008 case sources.blockentropy:
19942009 schedulers = ['N/A'];
19952010 break;
2011+ case sources.huggingface:
2012+ schedulers = ['N/A'];
2013+ break;
19962014 }
19972015
19982016 for (const scheduler of schedulers) {
@@ -2072,6 +2090,9 @@ async function loadVaes() {
20722090 case sources.blockentropy:
20732091 vaes = ['N/A'];
20742092 break;
2093+ case sources.huggingface:
2094+ vaes = ['N/A'];
2095+ break;
20752096 }
20762097
20772098 for (const vae of vaes) {
public/scripts/extensions/stable-diffusion/settings.html+3 -3
@@ -41,6 +41,7 @@
4141 <option value="comfy">ComfyUI</option>
4242 <option value="drawthings">DrawThings HTTP API</option>
4343 <option value="extras">Extras API (local / remote)</option>
44+ <option value="huggingface">HuggingFace Inference API (serverless)</option>
4445 <option value="novel">NovelAI Diffusion</option>
4546 <option value="openai">OpenAI (DALL-E)</option>
4647 <option value="pollinations">Pollinations</option>
@@ -49,7 +50,6 @@
4950 <option value="auto">Stable Diffusion Web UI (AUTOMATIC1111)</option>
5051 <option value="horde">Stable Horde</option>
5152 <option value="togetherai">TogetherAI</option>
52- <option value="huggingface">HuggingFace (Image Inference Endpoint)</option>
5353 </select>
5454 <div data-sd-source="auto">
5555 <label for="sd_auto_url">SD Web UI URL</label>
@@ -84,9 +84,9 @@
8484 <i><b data-i18n="Important:">Important:</b></i><i data-i18n="sd_drawthings_auth_txt"> run DrawThings app with HTTP API switch enabled in the UI! The server must be accessible from the SillyTavern host machine.</i>
8585 </div>
8686 <div data-sd-source="huggingface">
8787 <i>Hint: Save an API key in the Hugging Face (Text Completion) API settings to use it here.</i>
8888 <label for="sd_huggingface_model_id" data-i18n="Model ID">Model ID</label>
8989 <input id="sd_huggingface_model_id" type="text" class="text_pole" data-i18n="[placeholder] e.g. black-forest-labs/FLUX.1-dev" placeholder="e.g. black-forest-labs/FLUX.1-dev" value="" />
9090 </div>
9191 <div data-sd-source="vlad">
9292 <label for="sd_vlad_url">SD.Next API URL</label>