Metrics:
Total lines of code: 1111
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/ComfyI2I/ComfyI2I.py
Line number: 27
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess
23	from torchvision.ops import masks_to_boxes
24	import torchvision.transforms.functional as TF
25	import torch.nn.functional as F
26	from PIL import Image, ImageFilter, ImageOps
27	import subprocess
28	import math
29	
30	# Check for CUDA availability
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/ComfyI2I/ComfyI2I.py
Line number: 632
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
628	    
629	    MB, _, _ = mask.shape
630	
631	    if MB < B:
632	        assert(B % MB == 0)
633	        mask = mask.repeat(B // MB, 1, 1)
634	
635	    # Masks to boxes
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/ComfyI2I/ComfyI2I.py
Line number: 784
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
780	    MB = mask.shape[0]
781	    PB = image_to_paste.shape[0]
782	    if mask_mapping_optional is None:
783	        if B < PB:
784	            assert(PB % B == 0)
785	            image_base = image_base.repeat(PB // B, 1, 1, 1)
786	        B, H, W, C = image_base.shape
787	        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/ComfyI2I/ComfyI2I.py
Line number: 788
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
784	            assert(PB % B == 0)
785	            image_base = image_base.repeat(PB // B, 1, 1, 1)
786	        B, H, W, C = image_base.shape
787	        if MB < B:
788	            assert(B % MB == 0)
789	            mask = mask.repeat(B // MB, 1, 1)
790	        elif B < MB:
791	            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/ComfyI2I/ComfyI2I.py
Line number: 791
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
787	        if MB < B:
788	            assert(B % MB == 0)
789	            mask = mask.repeat(B // MB, 1, 1)
790	        elif B < MB:
791	            assert(MB % B == 0)
792	            image_base = image_base.repeat(MB // B, 1, 1, 1)
793	        if PB < B:
794	            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/ComfyI2I/ComfyI2I.py
Line number: 794
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
790	        elif B < MB:
791	            assert(MB % B == 0)
792	            image_base = image_base.repeat(MB // B, 1, 1, 1)
793	        if PB < B:
794	            assert(B % PB == 0)
795	            image_to_paste = image_to_paste.repeat(B // PB, 1, 1, 1)
796	    mask = F.interpolate(mask.unsqueeze(1), size=(H, W), mode='nearest')[:,0,:,:]
797	    MB, MH, MW = mask.shape
blacklist: Consider possible security implications associated with the subprocess module.
Test ID: B404
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/ComfyI2I/ComfyI2I.py
Line number: 932
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess
928	
929	        # Freeze PIP modules
930	        def packages(versions=False):
931	            import sys
932	            import subprocess
933	            return [( r.decode().split('==')[0] if not versions else r.decode() ) for r in subprocess.check_output([sys.executable, '-s', '-m', 'pip', 'freeze']).split()]
934	
935	        # PIL to Mask
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/ComfyI2I/ComfyI2I.py
Line number: 933
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html
929	        # Freeze PIP modules
930	        def packages(versions=False):
931	            import sys
932	            import subprocess
933	            return [( r.decode().split('==')[0] if not versions else r.decode() ) for r in subprocess.check_output([sys.executable, '-s', '-m', 'pip', 'freeze']).split()]
934	
935	        # PIL to Mask
936	        def pil2mask(image):
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/ComfyI2I/ComfyI2I.py
Line number: 949
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html
945	
946	        # scipy handling
947	        if 'scipy' not in packages():
948	            cstr("Installing `scipy` ...").msg.print()
949	            subprocess.check_call([sys.executable, '-s', '-m', 'pip', 'install', 'scipy'])
950	            try:
951	                import scipy
952	            except ImportError as e: