[Apply Mask][Added] Option to process images one by one
This commit is contained in:
@@ -144,6 +144,7 @@ Currently we just have a few nodes used by other nodes I maintain.
|
||||
- `blur_size_two` (`INT`): Diameter for the fine gaussian blur
|
||||
- `fill_color` (`BOOLEAN`): When enabled the removed image is replaced by a color, the output is an RGB image. Otherwise the removed part becomes transparent and the output is an RGBA image.
|
||||
- `color` (`STRING`): A string representing a color to be used when `fill_color` is enabled. Can be an hexadecimal RGB (i.e. `#AABBCC`) or comma separated RGB components. The components can be in the [0-255] or [0-1.0] range.
|
||||
- `batched` (`BOOLEAN`): Process all the images at once. Otherwise do it one at a time.
|
||||
- **Output:**
|
||||
- `image` (`IMAGE`): The image after applying the mask.
|
||||
- `mask` (`MASK`): The input mask
|
||||
|
||||
+12
-3
@@ -412,8 +412,17 @@ class ApplyMaskAFFCE:
|
||||
"masks": ("MASK",),
|
||||
"blur_size": BLUR_SIZE_OPT,
|
||||
"blur_size_two": BLUR_SIZE_TWO_OPT,
|
||||
"fill_color": ("BOOLEAN", {"default": False}),
|
||||
"fill_color": ("BOOLEAN", {
|
||||
"default": False,
|
||||
"tooltip": ("Fill the background using a color.\n"
|
||||
"Returns an RGB image, otherwise an RGBA.")
|
||||
}),
|
||||
"color": COLOR_OPT,
|
||||
"batched": ("BOOLEAN", {
|
||||
"default": True,
|
||||
"tooltip": ("Process the images at once.\n"
|
||||
"Faster, needs more memory")
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +436,7 @@ class ApplyMaskAFFCE:
|
||||
UNIQUE_NAME = "SET_ApplyMaskAFFCE"
|
||||
DISPLAY_NAME = "Apply Mask using AFFCE"
|
||||
|
||||
def get_foreground(self, images, masks, blur_size=91, blur_size_two=7, fill_color=False, color=None):
|
||||
def get_foreground(self, images, masks, blur_size=91, blur_size_two=7, fill_color=False, color=None, batched=True):
|
||||
out_images = apply_mask(logger, images, masks, model_management.get_torch_device(), blur_size, blur_size_two,
|
||||
fill_color, color)
|
||||
fill_color, color, batched)
|
||||
return out_images.cpu(), masks.cpu()
|
||||
|
||||
Reference in New Issue
Block a user