Windows paths...

This commit is contained in:
Marc-Andre Ferland 2022-11-03 03:04:21 -04:00
parent 5a18144366
commit d2e6011089

View File

@ -117,7 +117,10 @@ const TASK_MAPPING = {
setUI: (use_stable_diffusion_model) => {
const oldVal = stableDiffusionModelField.value
const pathIdx = use_stable_diffusion_model.lastIndexOf('/')
let pathIdx = use_stable_diffusion_model.lastIndexOf('/') // Linux, Mac paths
if (pathIdx < 0) {
pathIdx = use_stable_diffusion_model.lastIndexOf('\\') // Windows paths.
}
if (pathIdx >= 0) {
use_stable_diffusion_model = use_stable_diffusion_model.slice(pathIdx + 1)
}