mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-08-19 12:54:45 +02:00
A better way to make gfpgan show up at the top
This commit is contained in:
@@ -38,6 +38,8 @@ class ModelDropdown {
|
||||
noneEntry //= ''
|
||||
modelFilterInitialized //= undefined
|
||||
|
||||
sorted //= true
|
||||
|
||||
/* MIMIC A REGULAR INPUT FIELD */
|
||||
get parentElement() {
|
||||
return this.modelFilter.parentElement
|
||||
@@ -83,10 +85,11 @@ class ModelDropdown {
|
||||
|
||||
/* SEARCHABLE INPUT */
|
||||
|
||||
constructor(input, modelKey, noneEntry = "") {
|
||||
constructor(input, modelKey, noneEntry = "", sorted = true) {
|
||||
this.modelFilter = input
|
||||
this.noneEntry = noneEntry
|
||||
this.modelKey = modelKey
|
||||
this.sorted = sorted
|
||||
|
||||
if (modelsOptions !== undefined) {
|
||||
// reuse models from cache (only useful for plugins, which are loaded after models)
|
||||
@@ -566,11 +569,15 @@ class ModelDropdown {
|
||||
})
|
||||
|
||||
const childFolderNames = Array.from(foldersMap.keys())
|
||||
this.sortStringArray(childFolderNames)
|
||||
if (this.sorted) {
|
||||
this.sortStringArray(childFolderNames)
|
||||
}
|
||||
const folderElements = childFolderNames.map((name) => foldersMap.get(name))
|
||||
|
||||
const modelNames = Array.from(modelsMap.keys())
|
||||
this.sortStringArray(modelNames)
|
||||
if (this.sorted) {
|
||||
this.sortStringArray(modelNames)
|
||||
}
|
||||
const modelElements = modelNames.map((name) => modelsMap.get(name))
|
||||
|
||||
if (modelElements.length && folderName) {
|
||||
|
Reference in New Issue
Block a user