Metrics:
Total lines of code: 2488
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/eden_comfy_pipelines/clip_utils/clip_interrogator.py
Line number: 193
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
189	
190	        return best_prompt
191	
192	    def generate_caption(self, pil_image: Image, input_txt = "") -> str:
193	        assert self.caption_model is not None, "No caption model loaded."
194	        self._prepare_caption()
195	
196	        if input_txt:
request_without_timeout: Requests call without timeout
Test ID: B113
Severity: MEDIUM
Confidence: LOW
CWE: CWE-400
File: /custom_nodes/eden_comfy_pipelines/clip_utils/clip_interrogator.py
Line number: 420
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html
416	        return [top_labels[i] for i in tops]
417	
418	
419	def _download_file(url: str, filepath: str, chunk_size: int = 4*1024*1024, quiet: bool = False):
420	    r = requests.get(url, stream=True)
421	    if r.status_code != 200:
422	        return
423	
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/eden_comfy_pipelines/img_utils/img_nodes.py
Line number: 409
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
405	        - rescale these crops to have ~target_n_pixels
406	        - return resized images
407	    """
408	
409	    assert len(imgs) > 1
410	    imgs = [np.array(img) for img in imgs]
411	    
412	    # Get center crops at same aspect ratio
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/eden_comfy_pipelines/img_utils/img_nodes.py
Line number: 571
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
567	        files = [os.path.join(folder, f) for f in os.listdir(folder)]
568	        files = [f for f in files if os.path.isfile(f)]
569	
570	        random.seed(seed)
571	        path = random.choice(files)
572	        return (path,)
573	
574	
blacklist: Use of possibly insecure function - consider using safer ast.literal_eval.
Test ID: B307
Severity: MEDIUM
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/eden_comfy_pipelines/img_utils/img_nodes.py
Line number: 854
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b307-eval
850	
851	        # Define the mathematical function securely
852	        def safe_eval(expr, x):
853	            allowed_functions = {"sin": np.sin, "cos": np.cos, "exp": np.exp}  # Extend this as needed
854	            return eval(expr, {"__builtins__": None}, allowed_functions)
855	
856	        # Create a vectorized version of the safe_eval function
857	        vectorized_func = np.vectorize(lambda x: safe_eval(math_string, x))
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/eden_comfy_pipelines/ip_adapter_utils/moodmix_utils.py
Line number: 166
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
162	        pos_embed,
163	        cache_dir: str,
164	        non_embedded_image_filenames: str,
165	    ):
166	        assert pos_embed.ndim == 3, f"Expected batch to have 3 dims but got: {pos_embed.ndim} dims"
167	        assert len(non_embedded_image_filenames) == pos_embed.shape[0], f"Expected the batch size of pos_embed ({pos_embed.shape[0]}) to be the same as the number of images found in non_embedded_images_folder: {len(non_embedded_image_filenames)}. non_embedded_image_filenames: {non_embedded_image_filenames}"
168	
169	        all_image_ids = [
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/eden_comfy_pipelines/ip_adapter_utils/moodmix_utils.py
Line number: 167
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
163	        cache_dir: str,
164	        non_embedded_image_filenames: str,
165	    ):
166	        assert pos_embed.ndim == 3, f"Expected batch to have 3 dims but got: {pos_embed.ndim} dims"
167	        assert len(non_embedded_image_filenames) == pos_embed.shape[0], f"Expected the batch size of pos_embed ({pos_embed.shape[0]}) to be the same as the number of images found in non_embedded_images_folder: {len(non_embedded_image_filenames)}. non_embedded_image_filenames: {non_embedded_image_filenames}"
168	
169	        all_image_ids = [
170	            get_id_from_filename(filename = f)
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/eden_comfy_pipelines/ip_adapter_utils/moodmix_utils.py
Line number: 220
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
216	            delete {id}.pth
217	
218	        run this scan every time the node is run
219	        """
220	        assert os.path.exists(cache_dir), f"Invalid cache_dir: {cache_dir}"
221	
222	        filenames = get_filenames_in_a_folder(folder = cache_dir)
223	        all_image_filenames = find_all_filenames_with_extension(
start_process_with_a_shell: Starting a process with a shell, possible injection detected, security issue.
Test ID: B605
Severity: HIGH
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/eden_comfy_pipelines/ip_adapter_utils/moodmix_utils.py
Line number: 256
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html
252	                )
253	
254	        for embedding_filename in embedding_filenames_to_be_deleted:
255	            print(f"[FolderScanner] Deleting: {embedding_filename}")
256	            os.system(
257	                f"rm {embedding_filename}"
258	            )
259	
260	        return (image_filenames_without_embeddings,)
261	
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/eden_comfy_pipelines/ip_adapter_utils/moodmix_utils.py
Line number: 363
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
359	
360	        style_directions = []
361	
362	        # Ensure that num_style_components is not greater than the size of the first dimension
363	        assert num_style_components <= style_embeddings.size(0), "num_style_components is greater than the number of style images!"
364	
365	        for i in range(num_samples):
366	            # Sample the style images to use: