Add SrlFilterImageList
This commit is contained in:
@@ -42,6 +42,13 @@ ComfyUI itself isn't remotely secure, but I will probably try to
|
||||
improve isolation at some point in the future to prevent unintended
|
||||
problems. PRs gladly accepted if you have need for this.
|
||||
|
||||
## SRL Filter Image List
|
||||
|
||||

|
||||
|
||||
Takes a list of images and a list of bools as input and outputs a list
|
||||
of the input images where the bool is true.
|
||||
|
||||
# License
|
||||
|
||||
All code in this repository is copyright Sean Richard Lynch and any
|
||||
|
||||
+23
@@ -132,12 +132,34 @@ class SrlEval:
|
||||
return (ret,)
|
||||
|
||||
|
||||
class SrlFilterImageList:
|
||||
"""Filter an image list based on a list of bools"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"images": ("IMAGE",),
|
||||
"keep": ("BOOLEAN", {"forceInput": True}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
INPUT_IS_LIST = True
|
||||
OUTPUT_IS_LIST = (True,)
|
||||
FUNCTION = "doit"
|
||||
|
||||
def doit(self, images, keep):
|
||||
return ([im for im, k in zip(images, keep) if k],)
|
||||
|
||||
|
||||
# A dictionary that contains all nodes you want to export with their names
|
||||
# NOTE: names should be globally unique
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"SRL Conditional Interrrupt": SrlConditionalInterrupt,
|
||||
"SRL Format String": SrlFormatString,
|
||||
"SRL Eval": SrlEval,
|
||||
"SRL Filter Image List": SrlFilterImageList,
|
||||
}
|
||||
|
||||
|
||||
@@ -146,4 +168,5 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"SrlConditionalInterrupt": "SRL Conditional Interrupt",
|
||||
"SrlFormatString": "SRL Format String",
|
||||
"SrlEval": "SRL Eval",
|
||||
"SrlFilterImageList": "SRL Filter Image List",
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
Reference in New Issue
Block a user