Metrics:
Total lines of code: 1695
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-prompt-control/prompt_control/node_clip.py
Line number: 97
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
93	    return all_res
94	
95	
96	def get_control_points(schedule, steps, encoder):
97	    assert len(steps) > 1
98	    new_steps = set(steps)
99	
100	    for step in (s[0] for s in schedule if s[0] >= steps[0] and s[0] <= steps[-1]):
hardcoded_password_default: Possible hardcoded password: 'none'
Test ID: B107
Severity: LOW
Confidence: MEDIUM
CWE: CWE-259
File: /custom_nodes/comfyui-prompt-control/prompt_control/node_clip.py
Line number: 205
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b107_hardcoded_password_default.html
201	
202	    return style, normalization, text
203	
204	
205	def encode_regions(clip, tokens, regions, weight_interpretation="comfy", token_normalization="none"):
206	    from custom_nodes.ComfyUI_Cutoff.cutoff import CLIPSetRegion, finalize_clip_regions
207	
208	    clip_regions = {
209	        "clip": clip,
210	        "base_tokens": tokens,
211	        "regions": [],
212	        "targets": [],
213	        "weights": [],
214	    }
215	
216	    strict_mask = 1.0
217	    start_from_masked = 1.0
218	    mask_token = ""
219	
220	    for region in regions:
221	        region_text, target_text, w, sm, sfm, mt = region
222	        if w is not None:
223	            w = safe_float(w, 0)
224	        else:
225	            w = 1.0
226	        if sm is not None:
227	            strict_mask = safe_float(sm, 1.0)
228	        if sfm is not None:
229	            start_from_masked = safe_float(sfm, 1.0)
230	        if mt is not None:
231	            mask_token = mt
232	        log.info("Region: text %s, target %s, weight %s", region_text.strip(), target_text.strip(), w)
233	        (clip_regions,) = CLIPSetRegion.add_clip_region(None, clip_regions, region_text, target_text, w)
234	    log.info("Regions: mask_token=%s strict_mask=%s start_from_masked=%s", mask_token, strict_mask, start_from_masked)
235	
236	    (r,) = finalize_clip_regions(
237	        clip_regions, mask_token, strict_mask, start_from_masked, token_normalization, weight_interpretation
238	    )
239	    cond, pooled = r[0][0], r[0][1].get("pooled_output")
240	    return cond, pooled
241	
242	
243	SHUFFLE_GEN = torch.Generator(device="cpu")
hardcoded_password_string: Possible hardcoded password: ''
Test ID: B105
Severity: LOW
Confidence: MEDIUM
CWE: CWE-259
File: /custom_nodes/comfyui-prompt-control/prompt_control/node_clip.py
Line number: 218
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b105_hardcoded_password_string.html
214	    }
215	
216	    strict_mask = 1.0
217	    start_from_masked = 1.0
218	    mask_token = ""
219	
220	    for region in regions:
221	        region_text, target_text, w, sm, sfm, mt = region