1
0
Fork 0

fix(api): report accurate size when face correction is run twice

This commit is contained in:
Sean Sube 2023-02-19 10:27:05 -06:00
parent 9a7770fe48
commit c459e96523
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 5 additions and 8 deletions

View File

@ -44,17 +44,14 @@ def json_params(
json["params"]["model"] = path.basename(params.model) json["params"]["model"] = path.basename(params.model)
json["params"]["scheduler"] = get_scheduler_name(params.scheduler) json["params"]["scheduler"] = get_scheduler_name(params.scheduler)
if upscale is not None and border is not None: if border is not None:
size = upscale.resize(size.add_border(border)) json["border"] = border.tojson()
size = size.add_border(border)
if upscale is not None: if upscale is not None:
json["upscale"] = upscale.tojson() json["upscale"] = upscale.tojson()
size = upscale.resize(size) size = upscale.resize(size)
if border is not None:
json["border"] = border.tojson()
size = size.add_border(border)
json["size"] = size.tojson() json["size"] = size.tojson()
return json return json

View File

@ -265,8 +265,8 @@ class UpscaleParams:
face_outscale *= self.face_outscale face_outscale *= self.face_outscale
return Size( return Size(
size.width * self.outscale * self.face_outscale, size.width * self.outscale * face_outscale,
size.height * self.outscale * self.face_outscale, size.height * self.outscale * face_outscale,
) )
def tojson(self): def tojson(self):