forked from extern/easydiffusion
Fix GFPGAN settings import
The word None which many txt metadata files contain as value for the GFPGAN field should not be considered to be a model name. If the value is None, disable the checkbox
This commit is contained in:
parent
3d7e16cfd9
commit
30dcc7477f
@ -172,16 +172,22 @@ const TASK_MAPPING = {
|
|||||||
name: "Use Face Correction",
|
name: "Use Face Correction",
|
||||||
setUI: (use_face_correction) => {
|
setUI: (use_face_correction) => {
|
||||||
const oldVal = gfpganModelField.value
|
const oldVal = gfpganModelField.value
|
||||||
gfpganModelField.value = getModelPath(use_face_correction, [".pth"])
|
console.log("use face correction", use_face_correction)
|
||||||
if (gfpganModelField.value) {
|
if (use_face_correction == null || use_face_correction == "None") {
|
||||||
// Is a valid value for the field.
|
|
||||||
useFaceCorrectionField.checked = true
|
|
||||||
gfpganModelField.disabled = false
|
|
||||||
} else {
|
|
||||||
// Not a valid value, restore the old value and disable the filter.
|
|
||||||
gfpganModelField.disabled = true
|
gfpganModelField.disabled = true
|
||||||
gfpganModelField.value = oldVal
|
|
||||||
useFaceCorrectionField.checked = false
|
useFaceCorrectionField.checked = false
|
||||||
|
} else {
|
||||||
|
gfpganModelField.value = getModelPath(use_face_correction, [".pth"])
|
||||||
|
if (gfpganModelField.value) {
|
||||||
|
// Is a valid value for the field.
|
||||||
|
useFaceCorrectionField.checked = true
|
||||||
|
gfpganModelField.disabled = false
|
||||||
|
} else {
|
||||||
|
// Not a valid value, restore the old value and disable the filter.
|
||||||
|
gfpganModelField.disabled = true
|
||||||
|
gfpganModelField.value = oldVal
|
||||||
|
useFaceCorrectionField.checked = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//useFaceCorrectionField.checked = parseBoolean(use_face_correction)
|
//useFaceCorrectionField.checked = parseBoolean(use_face_correction)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user