diff --git a/inoutpaint/main.py b/inoutpaint/main.py index 9bbccaf..152cb96 100644 --- a/inoutpaint/main.py +++ b/inoutpaint/main.py @@ -29,9 +29,9 @@ def run(img, u, d, l, r, mode='fill'): new_img.paste(img.resize((w, d), box=(0, h, w, h)), box=(l, u+h)) if l: - new_img.paste(new_img.resize((l, h_n), box=(l, 0, l, h_n)), box=(0, 0)) + new_img.paste(new_img.resize((l, h_n), box=(l+1, 0, l+1, h_n)), box=(0, 0)) if r: - new_img.paste(new_img.resize((r, h_n), box=(w+l, 0, w+l, h_n)), box=(l+w, 0)) + new_img.paste(new_img.resize((r, h_n), box=(w+l-1, 0, w+l-1, h_n)), box=(l+w, 0)) return new_img, mask, f'{w_n} x {h_n}' @@ -39,7 +39,7 @@ def run(img, u, d, l, r, mode='fill'): if __name__ == '__main__': img = Image.open('./01491-2023-01-21_d7ff2a1d60_KBlueLeaf_KBlueLeaf_856221927-768x512.png') - new, mask = run(np.array(img), 64, 192, 64, 64) + new, mask, _ = run(np.array(img), 64, 192, 64, 64) w, h = new.size diff --git a/scripts/main.py b/scripts/main.py index a70bc5c..209ca85 100644 --- a/scripts/main.py +++ b/scripts/main.py @@ -222,6 +222,7 @@ def add_tab(): # image_out.change(lambda x:f'{x.width} x {x.height}', image_out, res_info) + image_out.change(None, img_out_h_slider, _js=f'get_change_height("haku_out")') #send for btns, btn3, img_src in all_btns: