fix LaMa node causing slow bug

This commit is contained in:
chflame
2024-03-04 15:39:14 +08:00
parent 74a4b0c1e1
commit 8a8c205ab1
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ class ImageShift:
"image": ("IMAGE", ), #
"shift_x": ("INT", {"default": 256, "min": -9999, "max": 9999, "step": 1}),
"shift_y": ("INT", {"default": 256, "min": -9999, "max": 9999, "step": 1}),
"cyclic": ("BOOLEAN", {"default": True}), # 反转mask#
"cyclic": ("BOOLEAN", {"default": True}), # 是否循环重复
"background_color": ("STRING", {"default": "#000000"}),
"border_mask_width": ("INT", {"default": 20, "min": 0, "max": 999, "step": 1}),
"border_mask_blur": ("INT", {"default": 12, "min": 0, "max": 999, "step": 1}),
+2 -2
View File
@@ -1,9 +1,8 @@
import os.path
import shutil
from pathlib import Path
from .imagefunc import *
from iopaint import cli
NODE_NAME = 'LaMa'
@@ -93,6 +92,7 @@ class LaMa:
log(f"Error: {NODE_NAME} skipped, because unable to create temporary file.", message_type='error')
return (image, )
# process
from iopaint import cli
cli.run(model=lama_model, device=device, image=Path(image_dir), mask=Path(mask_dir), output=Path(result_dir))
ret_image = check_image_file(os.path.join(result_dir, file_name), 500)
shutil.rmtree(temp_dir)