Fixed model parsing...

This commit is contained in:
Marc-Andre Ferland 2022-10-30 23:41:26 -04:00
parent 965efc3a13
commit 83d541b60d

View File

@ -112,7 +112,17 @@ const TASK_MAPPING = {
use_stable_diffusion_model: { name: 'Stable Diffusion model', use_stable_diffusion_model: { name: 'Stable Diffusion model',
setUI: (use_stable_diffusion_model) => { setUI: (use_stable_diffusion_model) => {
const oldVal = stableDiffusionModelField.value const oldVal = stableDiffusionModelField.value
const pathIdx = use_stable_diffusion_model.lastIndexOf('/')
if (pathIdx >= 0) {
use_stable_diffusion_model = use_stable_diffusion_model.slice(pathIdx + 1)
}
if (use_stable_diffusion_model.endsWith('.ckpt')) {
use_stable_diffusion_model = use_stable_diffusion_model.slice(0, use_stable_diffusion_model.length - 5)
}
stableDiffusionModelField.value = use_stable_diffusion_model stableDiffusionModelField.value = use_stable_diffusion_model
if (!stableDiffusionModelField.value) { if (!stableDiffusionModelField.value) {
stableDiffusionModelField.value = oldVal stableDiffusionModelField.value = oldVal
} }