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/__pycache__/
|
||||||
scripts/ch_lib/__pycache__/
|
scripts/ch_lib/__pycache__/
|
||||||
setting.json
|
setting.json
|
||||||
|
.idea
|
||||||
|
|
@ -430,7 +430,7 @@ onUiLoaded(() => {
|
||||||
if (!extra_tabs) {console.log("can not find extra_tabs: " + tab_prefix+"_extra_tabs");}
|
if (!extra_tabs) {console.log("can not find extra_tabs: " + tab_prefix+"_extra_tabs");}
|
||||||
|
|
||||||
//get active extratab
|
//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')
|
.find(el => el.closest('.tabitem').style.display === 'block')
|
||||||
?.id.match(/^(txt2img|img2img)_(.+)_cards$/)[2]
|
?.id.match(/^(txt2img|img2img)_(.+)_cards$/)[2]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -323,12 +323,16 @@ def get_preview_image_by_model_path(model_path:str, max_size_preview, skip_nsfw_
|
||||||
return
|
return
|
||||||
|
|
||||||
base, ext = os.path.splitext(model_path)
|
base, ext = os.path.splitext(model_path)
|
||||||
|
|
||||||
first_preview = base+".png"
|
first_preview = base+".png"
|
||||||
sec_preview = base+".preview.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
|
info_file = base + suffix + model.info_ext
|
||||||
|
|
||||||
# check preview image
|
# 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
|
# need to download preview image
|
||||||
util.printD("Checking preview image for model: " + model_path)
|
util.printD("Checking preview image for model: " + model_path)
|
||||||
# load model_info file
|
# load model_info file
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue