fix(api): handle partial params when formatting output
This commit is contained in:
parent
0557ab9a2e
commit
c19f39f9b4
|
@ -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(),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue