fix a bug when using custom model path
parent
8ee7e6d2a4
commit
6e9c228820
|
|
@ -244,7 +244,10 @@ Since v1.5.5, we've already optimized the SHA256 function to the top. So the onl
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Change Log3
|
# Change Log
|
||||||
|
## v1.10.4
|
||||||
|
* Fix a bug about model path parsing when using custom model folder
|
||||||
|
|
||||||
## v1.10.2
|
## v1.10.2
|
||||||
* Bring back this addon's green refresh button to SD webui v1.8.x
|
* Bring back this addon's green refresh button to SD webui v1.8.x
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1166,6 +1166,7 @@ onUiLoaded(() => {
|
||||||
let sd_version = ch_sd_version();
|
let sd_version = ch_sd_version();
|
||||||
console.log(`sd version is: ${sd_version}`);
|
console.log(`sd version is: ${sd_version}`);
|
||||||
if (compareVersions(sd_version, "1.8.0") >= 0){
|
if (compareVersions(sd_version, "1.8.0") >= 0){
|
||||||
|
console.log("get sd version v1.8.0+");
|
||||||
|
|
||||||
for (let prefix of tab_prefix_list) {
|
for (let prefix of tab_prefix_list) {
|
||||||
toolbar_id = prefix + "_lora_controls";
|
toolbar_id = prefix + "_lora_controls";
|
||||||
|
|
@ -1190,18 +1191,18 @@ onUiLoaded(() => {
|
||||||
|
|
||||||
|
|
||||||
// from sd v1.8.0, we add refresh function to official's refresh button
|
// from sd v1.8.0, we add refresh function to official's refresh button
|
||||||
refresh_btn.onclick = function(event){
|
// refresh_btn.onclick = function(event){
|
||||||
console.log("run refresh button on click");
|
// console.log("run refresh button on click");
|
||||||
//official's refresh function
|
// //official's refresh function
|
||||||
//it will send msg to python to reload card list and won't wait for that.
|
// //it will send msg to python to reload card list and won't wait for that.
|
||||||
extraNetworksControlRefreshOnClick(event, prefix, js_model_type);
|
// extraNetworksControlRefreshOnClick(event, prefix, js_model_type);
|
||||||
|
|
||||||
//this will not get card list if cards need to be reloaded from python side.
|
// //this will not get card list if cards need to be reloaded from python side.
|
||||||
//user need to click refresh button again, after card list is reloaded.
|
// //user need to click refresh button again, after card list is reloaded.
|
||||||
//which does not feel right by user.
|
// //which does not feel right by user.
|
||||||
//so, this addon's green refresh button is still needed.
|
// //so, this addon's green refresh button is still needed.
|
||||||
update_card_for_civitai_with_sd1_8();
|
// update_card_for_civitai_with_sd1_8();
|
||||||
};
|
// };
|
||||||
|
|
||||||
// add refresh button to toolbar
|
// add refresh button to toolbar
|
||||||
let ch_refresh = document.createElement("button");
|
let ch_refresh = document.createElement("button");
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,7 @@ def load_model_info_by_search_term(model_type, search_term):
|
||||||
model_info_base = model_info_base[1:]
|
model_info_base = model_info_base[1:]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
model_folder_name = "";
|
model_folder_name = "";
|
||||||
if model_type == "ti":
|
if model_type == "ti":
|
||||||
model_folder_name = "embeddings"
|
model_folder_name = "embeddings"
|
||||||
|
|
@ -223,6 +224,13 @@ def load_model_info_by_search_term(model_type, search_term):
|
||||||
else:
|
else:
|
||||||
model_folder_name = "Lora"
|
model_folder_name = "Lora"
|
||||||
|
|
||||||
|
# model folder path could be customized
|
||||||
|
model_folder = model.folders[model_type]
|
||||||
|
|
||||||
|
model_folder_name = os.path.basename(model_folder)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# check if model folder is already in search_term
|
# check if model folder is already in search_term
|
||||||
if model_info_base.startswith(model_folder_name):
|
if model_info_base.startswith(model_folder_name):
|
||||||
# this is sd webui v1.8.0+'s search_term
|
# this is sd webui v1.8.0+'s search_term
|
||||||
|
|
@ -237,7 +245,7 @@ def load_model_info_by_search_term(model_type, search_term):
|
||||||
# util.printD("final model_info_base: " + model_info_base)
|
# util.printD("final model_info_base: " + model_info_base)
|
||||||
|
|
||||||
|
|
||||||
model_folder = model.folders[model_type]
|
|
||||||
model_info_filename = model_info_base + suffix + model.info_ext
|
model_info_filename = model_info_base + suffix + model.info_ext
|
||||||
model_info_filepath = os.path.join(model_folder, model_info_filename)
|
model_info_filepath = os.path.join(model_folder, model_info_filename)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import requests
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
version = "1.10.3"
|
version = "1.10.4"
|
||||||
|
|
||||||
def_headers = {'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
|
def_headers = {'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
|
||||||
"Authorization": ""}
|
"Authorization": ""}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue