Metrics:
Total lines of code: 9879
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_Comfyroll_CustomNodes/nodes/functions_graphics.py
Line number: 423
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
419	
420	
421	def reduce_opacity(img, opacity):
422	    """Returns an image with reduced opacity."""
423	    assert opacity >= 0 and opacity <= 1
424	    if img.mode != 'RGBA':
425	        img = img.convert('RGBA')
426	    else:
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_Comfyroll_CustomNodes/nodes/functions_graphics.py
Line number: 436
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
432	    
433	
434	def random_hex_color():
435	    # Generate three random values for RGB
436	    r = random.randint(0, 255)
437	    g = random.randint(0, 255)
438	    b = random.randint(0, 255)
439	
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_Comfyroll_CustomNodes/nodes/functions_graphics.py
Line number: 437
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
433	
434	def random_hex_color():
435	    # Generate three random values for RGB
436	    r = random.randint(0, 255)
437	    g = random.randint(0, 255)
438	    b = random.randint(0, 255)
439	
440	    # Convert RGB to hex format
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_Comfyroll_CustomNodes/nodes/functions_graphics.py
Line number: 438
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
434	def random_hex_color():
435	    # Generate three random values for RGB
436	    r = random.randint(0, 255)
437	    g = random.randint(0, 255)
438	    b = random.randint(0, 255)
439	
440	    # Convert RGB to hex format
441	    hex_color = "#{:02x}{:02x}{:02x}".format(r, g, b)
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_Comfyroll_CustomNodes/nodes/functions_graphics.py
Line number: 448
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
444	
445	
446	def random_rgb():
447	    # Generate three random values for RGB
448	    r = random.randint(0, 255)
449	    g = random.randint(0, 255)
450	    b = random.randint(0, 255)
451	
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_Comfyroll_CustomNodes/nodes/functions_graphics.py
Line number: 449
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
445	
446	def random_rgb():
447	    # Generate three random values for RGB
448	    r = random.randint(0, 255)
449	    g = random.randint(0, 255)
450	    b = random.randint(0, 255)
451	
452	    # Format RGB as a string in the format "128,128,128"
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_Comfyroll_CustomNodes/nodes/functions_graphics.py
Line number: 450
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
446	def random_rgb():
447	    # Generate three random values for RGB
448	    r = random.randint(0, 255)
449	    g = random.randint(0, 255)
450	    b = random.randint(0, 255)
451	
452	    # Format RGB as a string in the format "128,128,128"
453	    rgb_string = "{},{},{}".format(r, g, b)
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_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py
Line number: 141
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
137	        # Draw grid based on the binary pattern
138	        for row_index, row in enumerate(grid):
139	            for col_index, bit in enumerate(row):
140	                if jitter_distance != 0:
141	                    x_jitter = random.uniform(0, jitter_distance)
142	                    y_jitter = random.uniform(0, jitter_distance)
143	                x1 = col_index * square_width + x_jitter
144	                y1 = row_index * square_height + y_jitter 
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_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py
Line number: 142
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
138	        for row_index, row in enumerate(grid):
139	            for col_index, bit in enumerate(row):
140	                if jitter_distance != 0:
141	                    x_jitter = random.uniform(0, jitter_distance)
142	                    y_jitter = random.uniform(0, jitter_distance)
143	                x1 = col_index * square_width + x_jitter
144	                y1 = row_index * square_height + y_jitter 
145	                x2 = x1 + square_width + x_jitter
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_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py
Line number: 152
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
148	                # Draw black square if bit is 1, else draw white square
149	                #color = color1 if bit == 1 else color0
150	                
151	                # Adjust color based on bias
152	                if random.uniform(0, 1) < abs(bias):
153	                    color = color1
154	                else:
155	                    color = color0
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_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py
Line number: 452
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
448	        ]
449	
450	        for row in range(num_rows):
451	            for col in range(num_cols):
452	                shape_function = random.choice(shape_functions)
453	                color = random.choice([color1, color2])
454	                size = random.uniform(20, min(width, height) / 2)
455	                aspect_ratio = random.uniform(0.5, 2.0)  # For shapes that use 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/ComfyUI_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py
Line number: 453
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
449	
450	        for row in range(num_rows):
451	            for col in range(num_cols):
452	                shape_function = random.choice(shape_functions)
453	                color = random.choice([color1, color2])
454	                size = random.uniform(20, min(width, height) / 2)
455	                aspect_ratio = random.uniform(0.5, 2.0)  # For shapes that use aspect ratio
456	
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_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py
Line number: 454
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
450	        for row in range(num_rows):
451	            for col in range(num_cols):
452	                shape_function = random.choice(shape_functions)
453	                color = random.choice([color1, color2])
454	                size = random.uniform(20, min(width, height) / 2)
455	                aspect_ratio = random.uniform(0.5, 2.0)  # For shapes that use aspect ratio
456	
457	                center_x = col * (width / num_cols) + (width / num_cols) / 2
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_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py
Line number: 455
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
451	            for col in range(num_cols):
452	                shape_function = random.choice(shape_functions)
453	                color = random.choice([color1, color2])
454	                size = random.uniform(20, min(width, height) / 2)
455	                aspect_ratio = random.uniform(0.5, 2.0)  # For shapes that use aspect ratio
456	
457	                center_x = col * (width / num_cols) + (width / num_cols) / 2
458	                center_y = row * (height / num_rows) + (height / num_rows) / 2
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_Comfyroll_CustomNodes/nodes/nodes_lora.py
Line number: 220
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
216	        else:
217	            CR_RandomWeightLoRA.StridesMap[id_hash] = 0
218	
219	        last_weight = CR_RandomWeightLoRA.LastWeightMap.get(id_hash, None)
220	        weight = uniform(weight_min, weight_max)
221	
222	        if last_weight is not None:
223	            while weight == last_weight:
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_Comfyroll_CustomNodes/nodes/nodes_lora.py
Line number: 224
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
220	        weight = uniform(weight_min, weight_max)
221	
222	        if last_weight is not None:
223	            while weight == last_weight:
224	                weight = uniform(weight_min, weight_max)
225	
226	        CR_RandomWeightLoRA.LastWeightMap[id_hash] = weight 
227	
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_Comfyroll_CustomNodes/nodes/nodes_lora.py
Line number: 359
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
355	
356	        def perform_randomization() -> set:    
357	            _lora_set = set()
358	
359	            rand_1 = random()
360	            rand_2 = random()
361	            rand_3 = random()
362	
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_Comfyroll_CustomNodes/nodes/nodes_lora.py
Line number: 360
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
356	        def perform_randomization() -> set:    
357	            _lora_set = set()
358	
359	            rand_1 = random()
360	            rand_2 = random()
361	            rand_3 = random()
362	
363	            apply_1 = True if (rand_1 <= chance_1 and switch_1 == "On") else False
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_Comfyroll_CustomNodes/nodes/nodes_lora.py
Line number: 361
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
357	            _lora_set = set()
358	
359	            rand_1 = random()
360	            rand_2 = random()
361	            rand_3 = random()
362	
363	            apply_1 = True if (rand_1 <= chance_1 and switch_1 == "On") else False
364	            apply_2 = True if (rand_2 <= chance_2 and switch_2 == "On") else False
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 131
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
127	            choice_str = custom_values
128	        else:
129	            pass
130	
131	        multiline_text = '\n'.join([prepend_text + ''.join(random.choice(choice_str) for _ in range(string_length)) for _ in range(rows)]) 
132	                           
133	        return (multiline_text, show_help, )
134	
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 169
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
165	        if value_type == "hex color":
166	            choice_str = '0123456789ABCDEF'
167	
168	        if value_type == "hex color":
169	            multiline_text = '\n'.join(['#' + ''.join(random.choice(choice_str) for _ in range(6)) for _ in range(rows)]) 
170	        elif value_type == "rgb":
171	            multiline_text = '\n'.join([f'{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}' for _ in range(rows)])
172	        elif value_type == "matplotlib xkcd":
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 171
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
167	
168	        if value_type == "hex color":
169	            multiline_text = '\n'.join(['#' + ''.join(random.choice(choice_str) for _ in range(6)) for _ in range(rows)]) 
170	        elif value_type == "rgb":
171	            multiline_text = '\n'.join([f'{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}' for _ in range(rows)])
172	        elif value_type == "matplotlib xkcd":
173	            multiline_text = '\n'.join([random.choice(list(xkcd_colors.keys())).replace('xkcd:', '') for _ in range(rows)])   
174	        else:
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 171
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
167	
168	        if value_type == "hex color":
169	            multiline_text = '\n'.join(['#' + ''.join(random.choice(choice_str) for _ in range(6)) for _ in range(rows)]) 
170	        elif value_type == "rgb":
171	            multiline_text = '\n'.join([f'{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}' for _ in range(rows)])
172	        elif value_type == "matplotlib xkcd":
173	            multiline_text = '\n'.join([random.choice(list(xkcd_colors.keys())).replace('xkcd:', '') for _ in range(rows)])   
174	        else:
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 171
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
167	
168	        if value_type == "hex color":
169	            multiline_text = '\n'.join(['#' + ''.join(random.choice(choice_str) for _ in range(6)) for _ in range(rows)]) 
170	        elif value_type == "rgb":
171	            multiline_text = '\n'.join([f'{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}' for _ in range(rows)])
172	        elif value_type == "matplotlib xkcd":
173	            multiline_text = '\n'.join([random.choice(list(xkcd_colors.keys())).replace('xkcd:', '') for _ in range(rows)])   
174	        else:
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 173
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
169	            multiline_text = '\n'.join(['#' + ''.join(random.choice(choice_str) for _ in range(6)) for _ in range(rows)]) 
170	        elif value_type == "rgb":
171	            multiline_text = '\n'.join([f'{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}' for _ in range(rows)])
172	        elif value_type == "matplotlib xkcd":
173	            multiline_text = '\n'.join([random.choice(list(xkcd_colors.keys())).replace('xkcd:', '') for _ in range(rows)])   
174	        else:
175	            pass
176	                   
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 205
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
201	        
202	        # Set the seed
203	        random.seed(seed)
204	        
205	        start_letter = random.choice('HV')
206	        value_range = random.choice(values)
207	            
208	        codes = []
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 206
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
202	        # Set the seed
203	        random.seed(seed)
204	        
205	        start_letter = random.choice('HV')
206	        value_range = random.choice(values)
207	            
208	        codes = []
209	        for _ in range(rows):
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 211
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
207	            
208	        codes = []
209	        for _ in range(rows):
210	            # Generate a random number within the specified range
211	            number = ''.join(random.choice(values) for _ in range(string_length))
212	            # Append the code to the list
213	            codes.append(f"{start_letter}{number}")
214	            
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 249
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
245	        for i in range(1, rows + 1):
246	            print(temp)
247	            if temp <= 99 - rows + i:
248	                upper_bound = min(99, temp + (99 - temp) // (rows - i + 1))
249	                current_value = random.randint(temp, upper_bound)
250	                multiline_text += f'{current_value}:{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}\n'
251	                
252	                temp = current_value + 1
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 250
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
246	            print(temp)
247	            if temp <= 99 - rows + i:
248	                upper_bound = min(99, temp + (99 - temp) // (rows - i + 1))
249	                current_value = random.randint(temp, upper_bound)
250	                multiline_text += f'{current_value}:{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}\n'
251	                
252	                temp = current_value + 1
253	
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 250
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
246	            print(temp)
247	            if temp <= 99 - rows + i:
248	                upper_bound = min(99, temp + (99 - temp) // (rows - i + 1))
249	                current_value = random.randint(temp, upper_bound)
250	                multiline_text += f'{current_value}:{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}\n'
251	                
252	                temp = current_value + 1
253	
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_Comfyroll_CustomNodes/nodes/nodes_utils_random.py
Line number: 250
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
246	            print(temp)
247	            if temp <= 99 - rows + i:
248	                upper_bound = min(99, temp + (99 - temp) // (rows - i + 1))
249	                current_value = random.randint(temp, upper_bound)
250	                multiline_text += f'{current_value}:{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}\n'
251	                
252	                temp = current_value + 1
253