Files
custom-nodes-security-scan/docs/ComfyUI-Advanced-ControlNet-bandit.html
zeekay 6bdea42e64 rebrand: Hanzo AI Inc — full rebrand from ComfyUI/Comfy-Org
- Updated copyright to Hanzo AI, Inc.
- Replaced ComfyUI references with Hanzo Studio
- Updated GitHub org URLs (Comfy-Org → hanzoui)
- Updated domains (comfy.org → hanzo.ai)
- Updated package names and npm scopes
- Updated LICENSE with Hanzo AI copyright header
2026-02-23 10:54:25 -08:00

691 lines
28 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>
Bandit Report
</title>
<style>
html * {
font-family: "Arial", sans-serif;
}
pre {
font-family: "Monaco", monospace;
}
.bordered-box {
border: 1px solid black;
padding-top:.5em;
padding-bottom:.5em;
padding-left:1em;
}
.metrics-box {
font-size: 1.1em;
line-height: 130%;
}
.metrics-title {
font-size: 1.5em;
font-weight: 500;
margin-bottom: .25em;
}
.issue-description {
font-size: 1.3em;
font-weight: 500;
}
.candidate-issues {
margin-left: 2em;
border-left: solid 1px; LightGray;
padding-left: 5%;
margin-top: .2em;
margin-bottom: .2em;
}
.issue-block {
border: 1px solid LightGray;
padding-left: .5em;
padding-top: .5em;
padding-bottom: .5em;
margin-bottom: .5em;
}
.issue-sev-high {
background-color: Pink;
}
.issue-sev-medium {
background-color: NavajoWhite;
}
.issue-sev-low {
background-color: LightCyan;
}
</style>
</head>
<body>
<div id="metrics">
<div class="metrics-box bordered-box">
<div class="metrics-title">
Metrics:<br>
</div>
Total lines of code: <span id="loc">4325</span><br>
Total lines skipped (#nosec): <span id="nosec">0</span>
</div>
</div>
<br>
<div id="results">
<div id="issue-0">
<div class="issue-block issue-sev-low">
<b>try_except_pass: </b> Try, Except, Pass detected.<br>
<b>Test ID:</b> B110<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_lllite.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_lllite.py</a><br>
<b>Line number: </b>112<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b110_try_except_pass.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b110_try_except_pass.html</a><br>
<div class="code">
<pre>
108 if self.patch_type == self.ATTN1:
109 to_return.control.patch_attn1 = to_return
110 elif self.patch_type == self.ATTN2:
111 to_return.control.patch_attn2 = to_return
112 except Exception:
113 pass
114 return to_return
115
116
</pre>
</div>
</div>
</div>
<div id="issue-1">
<div class="issue-block issue-sev-low">
<b>try_except_pass: </b> Try, Except, Pass detected.<br>
<b>Test ID:</b> B110<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_reference.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_reference.py</a><br>
<b>Line number: </b>473<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b110_try_except_pass.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b110_try_except_pass.html</a><br>
<div class="code">
<pre>
469 def clean_module_mem(self):
470 for attn_module in self.attn_modules:
471 try:
472 attn_module.injection_holder.clean()
473 except Exception:
474 pass
475 for gn_module in self.gn_modules:
476 try:
477 gn_module.injection_holder.clean()
</pre>
</div>
</div>
</div>
<div id="issue-2">
<div class="issue-block issue-sev-low">
<b>try_except_pass: </b> Try, Except, Pass detected.<br>
<b>Test ID:</b> B110<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_reference.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_reference.py</a><br>
<b>Line number: </b>478<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b110_try_except_pass.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b110_try_except_pass.html</a><br>
<div class="code">
<pre>
474 pass
475 for gn_module in self.gn_modules:
476 try:
477 gn_module.injection_holder.clean()
478 except Exception:
479 pass
480
481 def cleanup(self):
482 self.clean_module_mem()
</pre>
</div>
</div>
</div>
<div id="issue-3">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_reference.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_reference.py</a><br>
<b>Line number: </b>641<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
637 for i in range(cn_idx, len(ref_controlnets)):
638 if ref_controlnets[i].order == order:
639 cn_idx = i
640 break
641 assert order == ref_controlnets[cn_idx].order
642 if ref_controlnets[cn_idx].any_attn_strength_to_apply():
643 effective_strength = ref_controlnets[cn_idx].get_effective_attn_mask_or_float(x=n, channels=n.shape[2], is_mid=self.injection_holder.is_middle)
644 real_bank[idx] = real_bank[idx] * effective_strength + context_attn1 * (1-effective_strength)
</pre>
</div>
</div>
</div>
<div id="issue-4">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_reference.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_reference.py</a><br>
<b>Line number: </b>679<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
675 for i in range(cn_idx, len(ref_controlnets)):
676 if ref_controlnets[i].order == order:
677 cn_idx = i
678 break
679 assert order == ref_controlnets[cn_idx].order
680 if ref_controlnets[cn_idx].any_attn_strength_to_apply():
681 effective_strength = ref_controlnets[cn_idx].get_effective_attn_mask_or_float(x=n, channels=n.shape[2], is_mid=self.injection_holder.is_middle)
682 real_bank[idx] = real_bank[idx] * effective_strength + context_attn1 * (1-effective_strength)
</pre>
</div>
</div>
</div>
<div id="issue-5">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_reference.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_reference.py</a><br>
<b>Line number: </b>794<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
790 for i in range(cn_idx, len(ref_controlnets)):
791 if ref_controlnets[i].order == order:
792 cn_idx = i
793 break
794 assert order == ref_controlnets[cn_idx].order
795 style_fidelity = bank_styles.style_cfgs[idx]
796 var_acc = bank_styles.var_bank[idx]
797 mean_acc = bank_styles.mean_bank[idx]
</pre>
</div>
</div>
</div>
<div id="issue-6">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_sparsectrl.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_sparsectrl.py</a><br>
<b>Line number: </b>79<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
75 outs = []
76
77 hs = []
78 if self.num_classes is not None:
79 assert y.shape[0] == x.shape[0]
80 emb = emb + self.label_emb(y)
81
82 h = x
</pre>
</div>
</div>
</div>
<div id="issue-7">
<div class="issue-block issue-sev-low">
<b>try_except_pass: </b> Try, Except, Pass detected.<br>
<b>Test ID:</b> B110<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_sparsectrl.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_sparsectrl.py</a><br>
<b>Line number: </b>111<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b110_try_except_pass.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b110_try_except_pass.html</a><br>
<div class="code">
<pre>
107 patched_model = super().patch_model(device_to, patch_weights)
108 try:
109 if self.model.motion_wrapper is not None:
110 self.model.motion_wrapper.to(device=device_to)
111 except Exception:
112 pass
113 return patched_model
114
115 def unpatch_model(self, device_to=None, unpatch_weights=True):
</pre>
</div>
</div>
</div>
<div id="issue-8">
<div class="issue-block issue-sev-low">
<b>try_except_pass: </b> Try, Except, Pass detected.<br>
<b>Test ID:</b> B110<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_sparsectrl.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_sparsectrl.py</a><br>
<b>Line number: </b>119<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b110_try_except_pass.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b110_try_except_pass.html</a><br>
<div class="code">
<pre>
115 def unpatch_model(self, device_to=None, unpatch_weights=True):
116 try:
117 if self.model.motion_wrapper is not None:
118 self.model.motion_wrapper.to(device=device_to)
119 except Exception:
120 pass
121 if unpatch_weights:
122 return super().unpatch_model(device_to)
123 else:
</pre>
</div>
</div>
</div>
<div id="issue-9">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_sparsectrl.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_sparsectrl.py</a><br>
<b>Line number: </b>886<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
882 *args,
883 **kwargs,
884 ):
885 super().__init__(*args, **kwargs)
886 assert attention_mode == &quot;Temporal&quot;
887
888 self.attention_mode = attention_mode
889 self.is_cross_attention = kwargs[&quot;context_dim&quot;] is not None
</pre>
</div>
</div>
</div>
<div id="issue-10">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py</a><br>
<b>Line number: </b>65<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
61 operations=comfy.ops.disable_weight_init,
62 **kwargs,
63 ):
64 super().__init__()
65 assert use_spatial_transformer == True, &quot;use_spatial_transformer has to be true&quot;
66 if use_spatial_transformer:
67 assert context_dim is not None, &#x27;Fool!! You forgot to include the dimension of your cross-attention conditioning...&#x27;
68
</pre>
</div>
</div>
</div>
<div id="issue-11">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py</a><br>
<b>Line number: </b>67<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
63 ):
64 super().__init__()
65 assert use_spatial_transformer == True, &quot;use_spatial_transformer has to be true&quot;
66 if use_spatial_transformer:
67 assert context_dim is not None, &#x27;Fool!! You forgot to include the dimension of your cross-attention conditioning...&#x27;
68
69 if context_dim is not None:
70 assert use_spatial_transformer, &#x27;Fool!! You forgot to use the spatial transformer for your cross-attention conditioning...&#x27;
</pre>
</div>
</div>
</div>
<div id="issue-12">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py</a><br>
<b>Line number: </b>70<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
66 if use_spatial_transformer:
67 assert context_dim is not None, &#x27;Fool!! You forgot to include the dimension of your cross-attention conditioning...&#x27;
68
69 if context_dim is not None:
70 assert use_spatial_transformer, &#x27;Fool!! You forgot to use the spatial transformer for your cross-attention conditioning...&#x27;
71 # from omegaconf.listconfig import ListConfig
72 # if type(context_dim) == ListConfig:
73 # context_dim = list(context_dim)
</pre>
</div>
</div>
</div>
<div id="issue-13">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py</a><br>
<b>Line number: </b>79<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
75 if num_heads_upsample == -1:
76 num_heads_upsample = num_heads
77
78 if num_heads == -1:
79 assert num_head_channels != -1, &#x27;Either num_heads or num_head_channels has to be set&#x27;
80
81 if num_head_channels == -1:
82 assert num_heads != -1, &#x27;Either num_heads or num_head_channels has to be set&#x27;
</pre>
</div>
</div>
</div>
<div id="issue-14">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py</a><br>
<b>Line number: </b>82<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
78 if num_heads == -1:
79 assert num_head_channels != -1, &#x27;Either num_heads or num_head_channels has to be set&#x27;
80
81 if num_head_channels == -1:
82 assert num_heads != -1, &#x27;Either num_heads or num_head_channels has to be set&#x27;
83
84 self.dims = dims
85 self.image_size = image_size
</pre>
</div>
</div>
</div>
<div id="issue-15">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py</a><br>
<b>Line number: </b>99<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
95 self.num_res_blocks = num_res_blocks
96
97 if disable_self_attentions is not None:
98 # should be a list of booleans, indicating whether to disable self-attention in TransformerBlocks or not
99 assert len(disable_self_attentions) == len(channel_mult)
100 if num_attention_blocks is not None:
101 assert len(num_attention_blocks) == len(self.num_res_blocks)
102 assert all(map(lambda i: self.num_res_blocks[i] &gt;= num_attention_blocks[i], range(len(num_attention_blocks))))
</pre>
</div>
</div>
</div>
<div id="issue-16">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py</a><br>
<b>Line number: </b>101<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
97 if disable_self_attentions is not None:
98 # should be a list of booleans, indicating whether to disable self-attention in TransformerBlocks or not
99 assert len(disable_self_attentions) == len(channel_mult)
100 if num_attention_blocks is not None:
101 assert len(num_attention_blocks) == len(self.num_res_blocks)
102 assert all(map(lambda i: self.num_res_blocks[i] &gt;= num_attention_blocks[i], range(len(num_attention_blocks))))
103
104 transformer_depth = transformer_depth[:]
</pre>
</div>
</div>
</div>
<div id="issue-17">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py</a><br>
<b>Line number: </b>102<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
98 # should be a list of booleans, indicating whether to disable self-attention in TransformerBlocks or not
99 assert len(disable_self_attentions) == len(channel_mult)
100 if num_attention_blocks is not None:
101 assert len(num_attention_blocks) == len(self.num_res_blocks)
102 assert all(map(lambda i: self.num_res_blocks[i] &gt;= num_attention_blocks[i], range(len(num_attention_blocks))))
103
104 transformer_depth = transformer_depth[:]
105
</pre>
</div>
</div>
</div>
<div id="issue-18">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py</a><br>
<b>Line number: </b>131<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
127 elif self.num_classes == &quot;continuous&quot;:
128 print(&quot;setting up linear c_adm embedding layer&quot;)
129 self.label_emb = nn.Linear(1, time_embed_dim)
130 elif self.num_classes == &quot;sequential&quot;:
131 assert adm_in_channels is not None
132 self.label_emb = nn.Sequential(
133 nn.Sequential(
134 operations.Linear(adm_in_channels, time_embed_dim, dtype=self.dtype, device=device),
</pre>
</div>
</div>
</div>
<div id="issue-19">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/control_svd.py</a><br>
<b>Line number: </b>318<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
314 outs = []
315
316 hs = []
317 if self.num_classes is not None:
318 assert y.shape[0] == x.shape[0]
319 emb = emb + self.label_emb(y)
320
321 h = x
</pre>
</div>
</div>
</div>
<div id="issue-20">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/utils.py" target="_blank">/custom_nodes/Hanzo Studio-Advanced-ControlNet/adv_control/utils.py</a><br>
<b>Line number: </b>355<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
351 should be shared between the original and its copy.
352 memo is the dictionary passed into __deepcopy__. Ignore this argument if
353 not calling from within __deepcopy__.
354 &#x27;&#x27;&#x27;
355 assert isinstance(shared_attribute_names, (list, tuple))
356
357 shared_attributes = {k: getattr(obj, k) for k in shared_attribute_names}
358
</pre>
</div>
</div>
</div>
</div>
</body>
</html>