Metrics:
Total lines of code: 1117
Total lines skipped (#nosec): 0

blacklist: Consider possible security implications associated with the subprocess module.
Test ID: B404
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 9
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess
5	from torchvision import transforms
6	from torchvision.ops import masks_to_boxes
7	import torchvision.transforms.functional as TF
8	import torch.nn.functional as torchfn
9	import subprocess
10	import sys
11	
12	DELIMITER = '|'
blacklist: Consider possible security implications associated with the subprocess module.
Test ID: B404
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 19
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess
15	
16	package_list = None
17	def update_package_list():
18	    import sys
19	    import subprocess
20	
21	    global package_list
22	    package_list = [r.decode().split('==')[0] for r in subprocess.check_output([sys.executable, '-m', 'pip', 'freeze']).split()]
subprocess_without_shell_equals_true: subprocess call - check for execution of untrusted input.
Test ID: B603
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 22
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html
18	    import sys
19	    import subprocess
20	
21	    global package_list
22	    package_list = [r.decode().split('==')[0] for r in subprocess.check_output([sys.executable, '-m', 'pip', 'freeze']).split()]
23	
24	def ensure_package(package_name, import_path=None):
25	    global package_list
subprocess_without_shell_equals_true: subprocess call - check for execution of untrusted input.
Test ID: B603
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 33
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html
29	        update_package_list()
30	
31	    if package_name not in package_list:
32	        print("(First Run) Installing missing package %s" % package_name)
33	        subprocess.check_call([sys.executable, '-m', 'pip', '-q', 'install', import_path])
34	        update_package_list()
35	
36	def tensor2mask(t: torch.Tensor) -> torch.Tensor:
request_without_timeout: Requests call without timeout
Test ID: B113
Severity: MEDIUM
Confidence: LOW
CWE: CWE-400
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 209
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html
205	        if not os.path.exists(file_name):
206	            print(f'Downloading and caching file: {cache_name}')
207	            with open(file_name, 'wb') as file:
208	                import requests
209	                r = requests.get(url, stream=True)
210	                r.raise_for_status()
211	                for block in r.iter_content(4096):
212	                    file.write(block)
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 727
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
723	        mask = torch.nn.functional.interpolate(mask.unsqueeze(1), size=(H, W), mode='nearest')[:,0,:,:]
724	        MB, _, _ = mask.shape
725	
726	        if MB < B:
727	            assert(B % MB == 0)
728	            mask = mask.repeat(B // MB, 1, 1)
729	
730	        # masks_to_boxes errors if the tensor is all zeros, so we'll add a single pixel and zero it out at the end
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 868
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
864	        MB = mask.shape[0]
865	        PB = image_to_paste.shape[0]
866	        if mask_mapping_optional is None:
867	            if B < PB:
868	                assert(PB % B == 0)
869	                image_base = image_base.repeat(PB // B, 1, 1, 1)
870	            B, H, W, C = image_base.shape
871	            if MB < B:
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 872
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
868	                assert(PB % B == 0)
869	                image_base = image_base.repeat(PB // B, 1, 1, 1)
870	            B, H, W, C = image_base.shape
871	            if MB < B:
872	                assert(B % MB == 0)
873	                mask = mask.repeat(B // MB, 1, 1)
874	            elif B < MB:
875	                assert(MB % B == 0)
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 875
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
871	            if MB < B:
872	                assert(B % MB == 0)
873	                mask = mask.repeat(B // MB, 1, 1)
874	            elif B < MB:
875	                assert(MB % B == 0)
876	                image_base = image_base.repeat(MB // B, 1, 1, 1)
877	            if PB < B:
878	                assert(B % PB == 0)
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 878
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
874	            elif B < MB:
875	                assert(MB % B == 0)
876	                image_base = image_base.repeat(MB // B, 1, 1, 1)
877	            if PB < B:
878	                assert(B % PB == 0)
879	                image_to_paste = image_to_paste.repeat(B // PB, 1, 1, 1)
880	        mask = torch.nn.functional.interpolate(mask.unsqueeze(1), size=(H, W), mode='nearest')[:,0,:,:]
881	        MB, MH, MW = mask.shape
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/masquerade-nodes-comfyui/MaskNodes.py
Line number: 1298
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
1294	            return (hsv,)
1295	        elif out_space == "RGB":
1296	            return (hsv2rgb(hsv),)
1297	        else:
1298	            assert out_space == "HSL"
1299	            return (hsv2hsl(hsv),)
1300	
1301	class MaqueradeIncrementerNode: