Merge pull request #875 from Mikubill/lvmin

fix resolution bug
pull/877/head
lllyasviel 2023-04-17 18:58:53 -07:00 committed by GitHub
commit 71d76ae0dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -186,7 +186,7 @@ class Script(scripts.Script):
with gr.Row():
gr.HTML(value='<p>Set the preprocessor to [invert] If your image has white background and black lines.</p>')
webcam_enable = ToolButton(value=camera_symbol)
webcam_mirror = ToolButton(value=reverse_symbol)
send_dimen_button = ToolButton(value=tossup_symbol)
@ -647,7 +647,7 @@ class Script(scripts.Script):
k = min(k0, k1)
borders = np.concatenate([detected_map[0, :, :], detected_map[-1, :, :], detected_map[:, 0, :], detected_map[:, -1, :]], axis=0)
high_quality_border_color = np.median(borders, axis=0).astype(detected_map.dtype)
high_quality_background = np.tile(high_quality_border_color[None, None], [w, h, 1])
high_quality_background = np.tile(high_quality_border_color[None, None], [h, w, 1])
detected_map = high_quality_resize(detected_map, (safeint(old_w * k), safeint(old_h * k)))
new_h, new_w, _ = detected_map.shape
pad_h = max(0, (h - new_h) // 2)