chore: Support more image formats for cover detection, while improving the compatibility of the element selector plugin.
parent
fcf5a27aef
commit
fa604ebc5e
|
|
@ -1,3 +1,4 @@
|
|||
scripts/__pycache__/
|
||||
scripts/ch_lib/__pycache__/
|
||||
setting.json
|
||||
.idea
|
||||
|
|
@ -430,7 +430,7 @@ onUiLoaded(() => {
|
|||
if (!extra_tabs) {console.log("can not find extra_tabs: " + tab_prefix+"_extra_tabs");}
|
||||
|
||||
//get active extratab
|
||||
const active_extra_tab = Array.from(get_uiCurrentTabContent().querySelectorAll('.extra-network-cards,.extra-network-thumbs'))
|
||||
const active_extra_tab = Array.from(document.querySelectorAll('.extra-network-cards,.extra-network-thumbs'))
|
||||
.find(el => el.closest('.tabitem').style.display === 'block')
|
||||
?.id.match(/^(txt2img|img2img)_(.+)_cards$/)[2]
|
||||
|
||||
|
|
|
|||
|
|
@ -319,16 +319,20 @@ def get_preview_image_by_model_path(model_path:str, max_size_preview, skip_nsfw_
|
|||
return
|
||||
|
||||
if not os.path.isfile(model_path):
|
||||
util.printD("model_path is not a file: "+model_path)
|
||||
util.printD("model_path is not a file: "+ model_path)
|
||||
return
|
||||
|
||||
base, ext = os.path.splitext(model_path)
|
||||
|
||||
first_preview = base+".png"
|
||||
sec_preview = base+".preview.png"
|
||||
|
||||
check_preview_files = [base + ext for ext in (".png", ".preview.png", ".jpg", ".preview.jpg", ".webp", ".preview.webp")]
|
||||
|
||||
info_file = base + suffix + model.info_ext
|
||||
|
||||
# check preview image
|
||||
if not os.path.isfile(sec_preview):
|
||||
if not all(os.path.isfile(file) for file in check_preview_files):
|
||||
# need to download preview image
|
||||
util.printD("Checking preview image for model: " + model_path)
|
||||
# load model_info file
|
||||
|
|
|
|||
Loading…
Reference in New Issue