From a88afb09568b58991a8a441d7de7f85c7d40d10b Mon Sep 17 00:00:00 2001 From: JeLuF Date: Mon, 9 Jan 2023 18:24:04 +0100 Subject: [PATCH] Add paths to the value field --- ui/media/js/main.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 10e5797d..8a000722 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -1303,12 +1303,12 @@ async function getModels() { vaeOptions.unshift('') // add a None option hypernetworkOptions.unshift('') // add a None option - function createModelOptions(modelField, selectedModel) { - return function(modelName) { + function createModelOptions(modelField, selectedModel, path="") { + return function fn(modelName) { if (typeof(modelName) == 'string') { const modelOption = document.createElement('option') - modelOption.value = modelName - modelOption.innerText = modelName !== '' ? modelName : 'None' + modelOption.value = path + modelName + modelOption.innerHTML = modelName !== '' ? (path != "" ? "   "+modelName : modelName) : 'None' if (modelName === selectedModel) { modelOption.selected = true @@ -1316,9 +1316,9 @@ async function getModels() { modelField.appendChild(modelOption) } else { const modelGroup = document.createElement('optgroup') - modelGroup.label = modelName[0] - modelName[1].forEach( createModelOptions(modelGroup, selectedModel) ) + modelGroup.label = path + modelName[0] modelField.appendChild(modelGroup) + modelName[1].forEach( createModelOptions(modelField, selectedModel, path + modelName[0] + "/" ) ) } } }