fix(api): report accurate size when face correction is run twice
This commit is contained in:
parent
9a7770fe48
commit
c459e96523
|
@ -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
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue