From dc34bf2e73b8111343325f964041f93cd9a5ebd3 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Sat, 23 Mar 2024 17:23:21 +0000 Subject: [PATCH] Use loras from node --- web/js/autocompleter.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web/js/autocompleter.js b/web/js/autocompleter.js index 5d12176..ce4dde3 100644 --- a/web/js/autocompleter.js +++ b/web/js/autocompleter.js @@ -293,9 +293,14 @@ app.registerExtension({ } async function addLoras() { - const loras = await api - .fetchApi("/pysssss/loras", { cache: "no-store" }) - .then(res => res.json()); + let loras; + try { + loras = LiteGraph.registered_node_types["LoraLoader"]?.nodeData.input.required.lora_name[0]; + } catch (error) { + loras = await api + .fetchApi("/pysssss/loras", { cache: "no-store" }) + .then(res => res.json()); + } const words = {}; words["lora:"] = { text: "lora:" };