Small fixes
| @@ -1242,7 +1242,16 @@ async function onModelChange() { | |||
| 1242 | extension_settings.sd.model = $('#sd_model').find(':selected').val(); | 1242 | extension_settings.sd.model = $('#sd_model').find(':selected').val(); |
| 1243 | saveSettingsDebounced(); | 1243 | saveSettingsDebounced(); |
| 1244 | 1244 | ||
| 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 | ]; | ||
| 1246 | 1255 | ||
| 1247 | if (cloudSources.includes(extension_settings.sd.source)) { | 1256 | if (cloudSources.includes(extension_settings.sd.source)) { |
| 1248 | return; | 1257 | return; |
| @@ -1457,6 +1466,9 @@ async function loadSamplers() { | |||
| 1457 | case sources.blockentropy: | 1466 | case sources.blockentropy: |
| 1458 | samplers = ['N/A']; | 1467 | samplers = ['N/A']; |
| 1459 | break; | 1468 | break; |
| 1469 | case sources.huggingface: | ||
| 1470 | samplers = ['N/A']; | ||
| 1471 | break; | ||
| 1460 | } | 1472 | } |
| 1461 | 1473 | ||
| 1462 | for (const sampler of samplers) { | 1474 | for (const sampler of samplers) { |
| @@ -1646,6 +1658,9 @@ async function loadModels() { | |||
| 1646 | case sources.blockentropy: | 1658 | case sources.blockentropy: |
| 1647 | models = await loadBlockEntropyModels(); | 1659 | models = await loadBlockEntropyModels(); |
| 1648 | break; | 1660 | break; |
| 1661 | case sources.huggingface: | ||
| 1662 | models = [{ value: '', text: '<Enter Model ID above>' }]; | ||
| 1663 | break; | ||
| 1649 | } | 1664 | } |
| 1650 | 1665 | ||
| 1651 | for (const model of models) { | 1666 | for (const model of models) { |
| @@ -1993,6 +2008,9 @@ async function loadSchedulers() { | |||
| 1993 | case sources.blockentropy: | 2008 | case sources.blockentropy: |
| 1994 | schedulers = ['N/A']; | 2009 | schedulers = ['N/A']; |
| 1995 | break; | 2010 | break; |
| 2011 | case sources.huggingface: | ||
| 2012 | schedulers = ['N/A']; | ||
| 2013 | break; | ||
| 1996 | } | 2014 | } |
| 1997 | 2015 | ||
| 1998 | for (const scheduler of schedulers) { | 2016 | for (const scheduler of schedulers) { |
| @@ -2072,6 +2090,9 @@ async function loadVaes() { | |||
| 2072 | case sources.blockentropy: | 2090 | case sources.blockentropy: |
| 2073 | vaes = ['N/A']; | 2091 | vaes = ['N/A']; |
| 2074 | break; | 2092 | break; |
| 2093 | case sources.huggingface: | ||
| 2094 | vaes = ['N/A']; | ||
| 2095 | break; | ||
| 2075 | } | 2096 | } |
| 2076 | 2097 | ||
| 2077 | for (const vae of vaes) { | 2098 | for (const vae of vaes) { |
| @@ -41,6 +41,7 @@ | |||
| 41 | <option value="comfy">ComfyUI</option> | 41 | <option value="comfy">ComfyUI</option> |
| 42 | <option value="drawthings">DrawThings HTTP API</option> | 42 | <option value="drawthings">DrawThings HTTP API</option> |
| 43 | <option value="extras">Extras API (local / remote)</option> | 43 | <option value="extras">Extras API (local / remote)</option> |
| 44 | <option value="huggingface">HuggingFace Inference API (serverless)</option> | ||
| 44 | <option value="novel">NovelAI Diffusion</option> | 45 | <option value="novel">NovelAI Diffusion</option> |
| 45 | <option value="openai">OpenAI (DALL-E)</option> | 46 | <option value="openai">OpenAI (DALL-E)</option> |
| 46 | <option value="pollinations">Pollinations</option> | 47 | <option value="pollinations">Pollinations</option> |
| @@ -49,7 +50,6 @@ | |||
| 49 | <option value="auto">Stable Diffusion Web UI (AUTOMATIC1111)</option> | 50 | <option value="auto">Stable Diffusion Web UI (AUTOMATIC1111)</option> |
| 50 | <option value="horde">Stable Horde</option> | 51 | <option value="horde">Stable Horde</option> |
| 51 | <option value="togetherai">TogetherAI</option> | 52 | <option value="togetherai">TogetherAI</option> |
| 52 | <option value="huggingface">HuggingFace (Image Inference Endpoint)</option> | ||
| 53 | </select> | 53 | </select> |
| 54 | <div data-sd-source="auto"> | 54 | <div data-sd-source="auto"> |
| 55 | <label for="sd_auto_url">SD Web UI URL</label> | 55 | <label for="sd_auto_url">SD Web UI URL</label> |
| @@ -84,9 +84,9 @@ | |||
| 84 | <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> | 84 | <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> |
| 85 | </div> | 85 | </div> |
| 86 | <div data-sd-source="huggingface"> | 86 | <div data-sd-source="huggingface"> |
| 87 | <i>Hint: Save an API key in the Hugging Face API settings to use it here.</i> | 87 | <i>Hint: Save an API key in the Hugging Face (Text Completion) API settings to use it here.</i> |
| 88 | <label for="sd_huggingface_model_id" data-i18n="Model ID">Model ID</label> | 88 | <label for="sd_huggingface_model_id" data-i18n="Model ID">Model ID</label> |
| 89 | <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="" /> | 89 | <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="" /> |
| 90 | </div> | 90 | </div> |
| 91 | <div data-sd-source="vlad"> | 91 | <div data-sd-source="vlad"> |
| 92 | <label for="sd_vlad_url">SD.Next API URL</label> | 92 | <label for="sd_vlad_url">SD.Next API URL</label> |