mirror of
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
synced 2026-02-27 18:34:26 +00:00
@@ -254,6 +254,9 @@ function hideResults(textArea) {
|
||||
// Function to check activation criteria
|
||||
function isEnabled() {
|
||||
if (CFG.activeIn.global) {
|
||||
// Skip check if the current model was not correctly detected, since it could wrongly disable the script otherwise
|
||||
if (!currentModelName || !currentModelHash) return true;
|
||||
|
||||
let modelList = CFG.activeIn.modelList
|
||||
.split(",")
|
||||
.map(x => x.trim())
|
||||
@@ -822,8 +825,14 @@ async function setup() {
|
||||
for (const mutation of mutationList) {
|
||||
if (mutation.type === "attributes" && mutation.attributeName === "title") {
|
||||
currentModelHash = mutation.target.title;
|
||||
let modelDropdown = gradioApp().querySelector("#setting_sd_model_checkpoint span.single-select");
|
||||
currentModelName = modelDropdown?.textContent;
|
||||
let modelDropdown = gradioApp().querySelector("#setting_sd_model_checkpoint span.single-select")
|
||||
if (modelDropdown) {
|
||||
currentModelName = modelDropdown.textContent;
|
||||
} else {
|
||||
// Fallback for older versions
|
||||
modelDropdown = gradioApp().querySelector("#setting_sd_model_checkpoint select");
|
||||
currentModelName = modelDropdown.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user