Small fixes

This commit is contained in:
Cohee
2024-08-20 10:53:37 +00:00
parent ea0508b910
commit a9700c0ff0
2 changed files with 25 additions and 4 deletions

View File

@ -1242,7 +1242,16 @@ async function onModelChange() {
extension_settings.sd.model = $('#sd_model').find(':selected').val();
saveSettingsDebounced();
const cloudSources = [sources.horde, sources.novel, sources.openai, sources.togetherai, sources.pollinations, sources.stability, sources.blockentropy];
const cloudSources = [
sources.horde,
sources.novel,
sources.openai,
sources.togetherai,
sources.pollinations,
sources.stability,
sources.blockentropy,
sources.huggingface,
];
if (cloudSources.includes(extension_settings.sd.source)) {
return;
@ -1457,6 +1466,9 @@ async function loadSamplers() {
case sources.blockentropy:
samplers = ['N/A'];
break;
case sources.huggingface:
samplers = ['N/A'];
break;
}
for (const sampler of samplers) {
@ -1646,6 +1658,9 @@ async function loadModels() {
case sources.blockentropy:
models = await loadBlockEntropyModels();
break;
case sources.huggingface:
models = [{ value: '', text: '<Enter Model ID above>' }];
break;
}
for (const model of models) {
@ -1993,6 +2008,9 @@ async function loadSchedulers() {
case sources.blockentropy:
schedulers = ['N/A'];
break;
case sources.huggingface:
schedulers = ['N/A'];
break;
}
for (const scheduler of schedulers) {
@ -2072,6 +2090,9 @@ async function loadVaes() {
case sources.blockentropy:
vaes = ['N/A'];
break;
case sources.huggingface:
vaes = ['N/A'];
break;
}
for (const vae of vaes) {

View File

@ -41,6 +41,7 @@
<option value="comfy">ComfyUI</option>
<option value="drawthings">DrawThings HTTP API</option>
<option value="extras">Extras API (local / remote)</option>
<option value="huggingface">HuggingFace Inference API (serverless)</option>
<option value="novel">NovelAI Diffusion</option>
<option value="openai">OpenAI (DALL-E)</option>
<option value="pollinations">Pollinations</option>
@ -49,7 +50,6 @@
<option value="auto">Stable Diffusion Web UI (AUTOMATIC1111)</option>
<option value="horde">Stable Horde</option>
<option value="togetherai">TogetherAI</option>
<option value="huggingface">HuggingFace (Image Inference Endpoint)</option>
</select>
<div data-sd-source="auto">
<label for="sd_auto_url">SD Web UI URL</label>
@ -84,9 +84,9 @@
<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>
</div>
<div data-sd-source="huggingface">
<i>Hint: Save an API key in the Hugging Face API settings to use it here.</i>
<i>Hint: Save an API key in the Hugging Face (Text Completion) API settings to use it here.</i>
<label for="sd_huggingface_model_id" data-i18n="Model ID">Model ID</label>
<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="" />
<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="" />
</div>
<div data-sd-source="vlad">
<label for="sd_vlad_url">SD.Next API URL</label>