Fix upscaling when a source image is set (#593)

* Fix upscaling when a source image is set

If you have an image selected (img2img) then clicking Upscale on another unrelated image, the image for img2img is used and you get something very unexpected.

* Fix for img2img and mask gens
This commit is contained in:
patriceac 2022-12-03 08:55:14 -08:00 committed by GitHub
parent 0f96688a54
commit bd10a850fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -387,9 +387,28 @@ function enqueueImageVariationTask(req, img, reqDiff) {
}
function onUpscaleClick(req, img) {
enqueueImageVariationTask(req, img, {
use_upscale: upscaleModelField.value
})
if (IMAGE_REGEX.test(req.init_image) && IMAGE_REGEX.test(req.mask)) {
enqueueImageVariationTask(req, img, {
use_upscale: upscaleModelField.value,
init_image: req.init_image,
mask: req.mask
})
}
else if (IMAGE_REGEX.test(req.init_image)) {
enqueueImageVariationTask(req, img, {
use_upscale: upscaleModelField.value,
init_image: req.init_image,
mask: undefined
})
}
else
{
enqueueImageVariationTask(req, img, {
use_upscale: upscaleModelField.value,
init_image: undefined,
mask: undefined
})
}
}
function onFixFacesClick(req, img) {