1
0
Fork 0

fix(api): handle partial params when formatting output

This commit is contained in:
Sean Sube 2023-02-01 22:25:53 -06:00
parent 0557ab9a2e
commit c19f39f9b4
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 10 additions and 1 deletions

View File

@ -21,11 +21,20 @@ def json_params(
upscale: Optional[UpscaleParams] = None,
border: Optional[Border] = None,
) -> Any:
if upscale is not None and border is not None:
size = upscale.resize(size.add_border(border))
if upscale is not None:
size = upscale.resize(size)
if border is not None:
size = size.add_border(border)
return {
'border': border.tojson(),
'output': output,
'params': params.tojson(),
'size': upscale.resize(size.add_border(border)).tojson(),
'size': size.tojson(),
'upscale': upscale.tojson(),
}