Use gfpgan as the default model for face restoration

This commit is contained in:
cmdr2 2023-06-08 15:52:41 +05:30
parent 5398765fd7
commit 4f799a2bf0
2 changed files with 7 additions and 1 deletions

View File

@ -2061,3 +2061,10 @@ prettifyInputs(document)
// set the textbox as focused on start
promptField.focus()
promptField.selectionStart = promptField.value.length
// use gfpgan as the default model for face restoration
document.addEventListener("refreshModels", function() {
let gfpganIdx = gfpganModelField.inputModels.findIndex((e) => e.toLowerCase().startsWith("gfpgan"))
let gfpganElem = gfpganModelField.modelElements[gfpganIdx]
gfpganModelField.selectModelEntry(gfpganElem)
})

View File

@ -103,7 +103,6 @@ class ModelDropdown {
"refreshModels",
this.bind(function(e) {
// reload the models
this.inputModels = modelsOptions[this.modelKey]
this.inputModels = []
let modelKeys = Array.isArray(this.modelKey) ? this.modelKey : [this.modelKey]
for (let i = 0; i < modelKeys.length; i++) {