Metrics:
Total lines of code: 2034
Total lines skipped (#nosec): 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/ComfyUI_essentials/carve.py
Line number: 53
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
49	
50	
51	def _get_energy(gray: np.ndarray) -> np.ndarray:
52	    """Get backward energy map from the source image"""
53	    assert gray.ndim == 2
54	
55	    gray = gray.astype(np.float32)
56	    grad_x = sobel(gray, axis=1)
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/ComfyUI_essentials/carve.py
Line number: 219
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
215	    energy_mode: str,
216	    aux_energy: Optional[np.ndarray],
217	) -> Tuple[np.ndarray, Optional[np.ndarray]]:
218	    """Reduce the width of image by delta_width pixels"""
219	    assert src.ndim in (2, 3) and delta_width >= 0
220	    if src.ndim == 2:
221	        gray = src
222	        src_h, src_w = src.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/ComfyUI_essentials/carve.py
Line number: 277
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
273	    aux_energy: Optional[np.ndarray],
274	    step_ratio: float,
275	) -> Tuple[np.ndarray, Optional[np.ndarray]]:
276	    """Expand the width of image by delta_width pixels"""
277	    assert src.ndim in (2, 3) and delta_width >= 0
278	    if not 0 < step_ratio <= 1:
279	        raise ValueError(f"expect `step_ratio` to be between (0,1], got {step_ratio}")
280	
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/ComfyUI_essentials/carve.py
Line number: 303
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
299	    aux_energy: Optional[np.ndarray],
300	    step_ratio: float,
301	) -> Tuple[np.ndarray, Optional[np.ndarray]]:
302	    """Resize the width of image by removing vertical seams"""
303	    assert src.size > 0 and src.ndim in (2, 3)
304	    assert width > 0
305	
306	    src_w = src.shape[1]
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/ComfyUI_essentials/carve.py
Line number: 304
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
300	    step_ratio: float,
301	) -> Tuple[np.ndarray, Optional[np.ndarray]]:
302	    """Resize the width of image by removing vertical seams"""
303	    assert src.size > 0 and src.ndim in (2, 3)
304	    assert width > 0
305	
306	    src_w = src.shape[1]
307	    if src_w < width:
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/ComfyUI_essentials/carve.py
Line number: 333
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
329	    aux_energy: Optional[np.ndarray],
330	    step_ratio: float,
331	) -> Tuple[np.ndarray, Optional[np.ndarray]]:
332	    """Resize the height of image by removing horizontal seams"""
333	    assert src.ndim in (2, 3) and height > 0
334	    if aux_energy is not None:
335	        aux_energy = aux_energy.T
336	    src = _transpose_image(src)
blacklist: Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Test ID: B311
Severity: LOW
Confidence: HIGH
CWE: CWE-330
File: /custom_nodes/ComfyUI_essentials/essentials.py
Line number: 435
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
431	class MaskPreview(SaveImage):
432	    def __init__(self):
433	        self.output_dir = folder_paths.get_temp_directory()
434	        self.type = "temp"
435	        self.prefix_append = "_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for x in range(5))
436	        self.compress_level = 4
437	
438	    @classmethod