fix save_original flag saving to the same filename (#360)

* Update README.md with new Anaconda install steps (#347)

pip3 version did not work for me and this is the recommended way to install Anaconda now it seems

* fix save_original flag saving to the same filename

Before this, the `--save_orig` flag was not working. The upscaled/GFPGAN would overwrite the original output image.

Co-authored-by: greentext2 <112735219+greentext2@users.noreply.github.com>
This commit is contained in:
Justin Wong 2022-09-04 07:17:58 -04:00 committed by GitHub
parent 6266d9e8d6
commit 5116c8178c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -422,10 +422,7 @@ class T2I:
f'>> Error running RealESRGAN - Your image was not upscaled.\n{e}'
)
if image_callback is not None:
if save_original:
image_callback(image, seed)
else:
image_callback(image, seed, upscaled=True)
image_callback(image, seed, upscaled=True)
else: # no callback passed, so we simply replace old image with rescaled one
result[0] = image