Skip to content

Commit

Permalink
fix(api): limit outpainting using image size params
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 14, 2023
1 parent 26a8ce7 commit 34fa3f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/onnx_web/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@ def inpaint():
(model, provider, scheduler, prompt, negative_prompt, cfg, steps, height,
width, seed) = pipeline_from_request()

left = get_and_clamp_int(request.args, 'left', 0, source_file.width)
right = get_and_clamp_int(request.args, 'right', 0, source_file.width)
top = get_and_clamp_int(request.args, 'top', 0, source_file.height)
bottom = get_and_clamp_int(request.args, 'bottom', 0, source_file.height)
left = get_and_clamp_int(request.args, 'left', 0, config_params.get('width').get('max'))
right = get_and_clamp_int(request.args, 'right', 0, config_params.get('width').get('max'))
top = get_and_clamp_int(request.args, 'top', 0, config_params.get('height').get('max'))
bottom = get_and_clamp_int(request.args, 'bottom', 0, config_params.get('height').get('max'))

(output_file, output_full) = make_output_path(
'inpaint', seed, (prompt, cfg, steps, height, width, seed, left, right, top, bottom))
Expand Down

0 comments on commit 34fa3f6

Please sign in to comment.