Files

5968 lines
253 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">14599</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>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>9<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
5 # push (backup): cog push r8.im/xinntao/gfpgan
6
7 import os
8
9 os.system(&#x27;python setup.py develop&#x27;)
10 os.system(&#x27;pip install realesrgan&#x27;)
11
12 import cv2
</pre>
</div>
</div>
</div>
<div id="issue-1">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>9<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
5 # push (backup): cog push r8.im/xinntao/gfpgan
6
7 import os
8
9 os.system(&#x27;python setup.py develop&#x27;)
10 os.system(&#x27;pip install realesrgan&#x27;)
11
12 import cv2
</pre>
</div>
</div>
</div>
<div id="issue-2">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>10<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
6
7 import os
8
9 os.system(&#x27;python setup.py develop&#x27;)
10 os.system(&#x27;pip install realesrgan&#x27;)
11
12 import cv2
13 import shutil
</pre>
</div>
</div>
</div>
<div id="issue-3">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>10<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
6
7 import os
8
9 os.system(&#x27;python setup.py develop&#x27;)
10 os.system(&#x27;pip install realesrgan&#x27;)
11
12 import cv2
13 import shutil
</pre>
</div>
</div>
</div>
<div id="issue-4">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>33<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
29 def setup(self):
30 os.makedirs(&#x27;output&#x27;, exist_ok=True)
31 # download weights
32 if not os.path.exists(&#x27;gfpgan/weights/realesr-general-x4v3.pth&#x27;):
33 os.system(
34 &#x27;wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P ./gfpgan/weights&#x27;
35 )
36 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.2.pth&#x27;):
37 os.system(
38 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P ./gfpgan/weights&#x27;)
</pre>
</div>
</div>
</div>
<div id="issue-5">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>33<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
29 def setup(self):
30 os.makedirs(&#x27;output&#x27;, exist_ok=True)
31 # download weights
32 if not os.path.exists(&#x27;gfpgan/weights/realesr-general-x4v3.pth&#x27;):
33 os.system(
34 &#x27;wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P ./gfpgan/weights&#x27;
35 )
36 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.2.pth&#x27;):
37 os.system(
38 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P ./gfpgan/weights&#x27;)
</pre>
</div>
</div>
</div>
<div id="issue-6">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>37<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
33 os.system(
34 &#x27;wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P ./gfpgan/weights&#x27;
35 )
36 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.2.pth&#x27;):
37 os.system(
38 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P ./gfpgan/weights&#x27;)
39 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.3.pth&#x27;):
40 os.system(
41 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P ./gfpgan/weights&#x27;)
</pre>
</div>
</div>
</div>
<div id="issue-7">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>37<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
33 os.system(
34 &#x27;wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P ./gfpgan/weights&#x27;
35 )
36 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.2.pth&#x27;):
37 os.system(
38 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P ./gfpgan/weights&#x27;)
39 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.3.pth&#x27;):
40 os.system(
41 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P ./gfpgan/weights&#x27;)
</pre>
</div>
</div>
</div>
<div id="issue-8">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>40<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
36 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.2.pth&#x27;):
37 os.system(
38 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P ./gfpgan/weights&#x27;)
39 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.3.pth&#x27;):
40 os.system(
41 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P ./gfpgan/weights&#x27;)
42 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.4.pth&#x27;):
43 os.system(
44 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P ./gfpgan/weights&#x27;)
</pre>
</div>
</div>
</div>
<div id="issue-9">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>40<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
36 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.2.pth&#x27;):
37 os.system(
38 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth -P ./gfpgan/weights&#x27;)
39 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.3.pth&#x27;):
40 os.system(
41 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P ./gfpgan/weights&#x27;)
42 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.4.pth&#x27;):
43 os.system(
44 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P ./gfpgan/weights&#x27;)
</pre>
</div>
</div>
</div>
<div id="issue-10">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>43<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
39 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.3.pth&#x27;):
40 os.system(
41 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P ./gfpgan/weights&#x27;)
42 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.4.pth&#x27;):
43 os.system(
44 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P ./gfpgan/weights&#x27;)
45 if not os.path.exists(&#x27;gfpgan/weights/RestoreFormer.pth&#x27;):
46 os.system(
47 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/RestoreFormer.pth -P ./gfpgan/weights&#x27;
</pre>
</div>
</div>
</div>
<div id="issue-11">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>43<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
39 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.3.pth&#x27;):
40 os.system(
41 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P ./gfpgan/weights&#x27;)
42 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.4.pth&#x27;):
43 os.system(
44 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P ./gfpgan/weights&#x27;)
45 if not os.path.exists(&#x27;gfpgan/weights/RestoreFormer.pth&#x27;):
46 os.system(
47 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/RestoreFormer.pth -P ./gfpgan/weights&#x27;
</pre>
</div>
</div>
</div>
<div id="issue-12">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>46<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
42 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.4.pth&#x27;):
43 os.system(
44 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P ./gfpgan/weights&#x27;)
45 if not os.path.exists(&#x27;gfpgan/weights/RestoreFormer.pth&#x27;):
46 os.system(
47 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/RestoreFormer.pth -P ./gfpgan/weights&#x27;
48 )
49
50 # background enhancer with RealESRGAN
51 model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=32, upscale=4, act_type=&#x27;prelu&#x27;)
</pre>
</div>
</div>
</div>
<div id="issue-13">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/cog_predict.py</a><br>
<b>Line number: </b>46<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
42 if not os.path.exists(&#x27;gfpgan/weights/GFPGANv1.4.pth&#x27;):
43 os.system(
44 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth -P ./gfpgan/weights&#x27;)
45 if not os.path.exists(&#x27;gfpgan/weights/RestoreFormer.pth&#x27;):
46 os.system(
47 &#x27;wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/RestoreFormer.pth -P ./gfpgan/weights&#x27;
48 )
49
50 # background enhancer with RealESRGAN
51 model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=32, upscale=4, act_type=&#x27;prelu&#x27;)
</pre>
</div>
</div>
</div>
<div id="issue-14">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Standard pseudo-random generators are not suitable for security/cryptographic purposes.<br>
<b>Test ID:</b> B311<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/330.html" target="_blank">CWE-330</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/gfpgan_bilinear_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/gfpgan_bilinear_arch.py</a><br>
<b>Line number: </b>94<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random</a><br>
<div class="code">
<pre>
90 else: # used for encoder with different latent code for each layer
91 latent = styles[0]
92 elif len(styles) == 2: # mixing noises
93 if inject_index is None:
94 inject_index = random.randint(1, self.num_latent - 1)
95 latent1 = styles[0].unsqueeze(1).repeat(1, inject_index, 1)
96 latent2 = styles[1].unsqueeze(1).repeat(1, self.num_latent - inject_index, 1)
97 latent = torch.cat([latent1, latent2], 1)
</pre>
</div>
</div>
</div>
<div id="issue-15">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Standard pseudo-random generators are not suitable for security/cryptographic purposes.<br>
<b>Test ID:</b> B311<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/330.html" target="_blank">CWE-330</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/gfpganv1_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/gfpganv1_arch.py</a><br>
<b>Line number: </b>95<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random</a><br>
<div class="code">
<pre>
91 else: # used for encoder with different latent code for each layer
92 latent = styles[0]
93 elif len(styles) == 2: # mixing noises
94 if inject_index is None:
95 inject_index = random.randint(1, self.num_latent - 1)
96 latent1 = styles[0].unsqueeze(1).repeat(1, inject_index, 1)
97 latent2 = styles[1].unsqueeze(1).repeat(1, self.num_latent - inject_index, 1)
98 latent = torch.cat([latent1, latent2], 1)
</pre>
</div>
</div>
</div>
<div id="issue-16">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Standard pseudo-random generators are not suitable for security/cryptographic purposes.<br>
<b>Test ID:</b> B311<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/330.html" target="_blank">CWE-330</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/gfpganv1_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/gfpganv1_clean_arch.py</a><br>
<b>Line number: </b>83<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random</a><br>
<div class="code">
<pre>
79 else: # used for encoder with different latent code for each layer
80 latent = styles[0]
81 elif len(styles) == 2: # mixing noises
82 if inject_index is None:
83 inject_index = random.randint(1, self.num_latent - 1)
84 latent1 = styles[0].unsqueeze(1).repeat(1, inject_index, 1)
85 latent2 = styles[1].unsqueeze(1).repeat(1, self.num_latent - inject_index, 1)
86 latent = torch.cat([latent1, latent2], 1)
</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/comfy_mtb/extern/GFPGAN/gfpgan/archs/restoreformer_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/restoreformer_arch.py</a><br>
<b>Line number: </b>204<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>
200 super().__init__()
201 self.in_channels = in_channels
202 self.head_size = head_size
203 self.att_size = in_channels // head_size
204 assert (in_channels % head_size == 0), &#x27;The size of head should be divided by the number of channels.&#x27;
205
206 self.norm1 = Normalize(in_channels)
207 self.norm2 = Normalize(in_channels)
</pre>
</div>
</div>
</div>
<div id="issue-18">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Standard pseudo-random generators are not suitable for security/cryptographic purposes.<br>
<b>Test ID:</b> B311<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/330.html" target="_blank">CWE-330</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/stylegan2_bilinear_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/stylegan2_bilinear_arch.py</a><br>
<b>Line number: </b>439<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random</a><br>
<div class="code">
<pre>
435 else: # used for encoder with different latent code for each layer
436 latent = styles[0]
437 elif len(styles) == 2: # mixing noises
438 if inject_index is None:
439 inject_index = random.randint(1, self.num_latent - 1)
440 latent1 = styles[0].unsqueeze(1).repeat(1, inject_index, 1)
441 latent2 = styles[1].unsqueeze(1).repeat(1, self.num_latent - inject_index, 1)
442 latent = torch.cat([latent1, latent2], 1)
</pre>
</div>
</div>
</div>
<div id="issue-19">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Standard pseudo-random generators are not suitable for security/cryptographic purposes.<br>
<b>Test ID:</b> B311<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/330.html" target="_blank">CWE-330</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/gfpgan/archs/stylegan2_clean_arch.py</a><br>
<b>Line number: </b>345<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random</a><br>
<div class="code">
<pre>
341 else: # used for encoder with different latent code for each layer
342 latent = styles[0]
343 elif len(styles) == 2: # mixing noises
344 if inject_index is None:
345 inject_index = random.randint(1, self.num_latent - 1)
346 latent1 = styles[0].unsqueeze(1).repeat(1, inject_index, 1)
347 latent2 = styles[1].unsqueeze(1).repeat(1, self.num_latent - inject_index, 1)
348 latent = torch.cat([latent1, latent2], 1)
</pre>
</div>
</div>
</div>
<div id="issue-20">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Consider possible security implications associated with the subprocess module.<br>
<b>Test ID:</b> B404<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/setup.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/setup.py</a><br>
<b>Line number: </b>6<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess</a><br>
<div class="code">
<pre>
2
3 from setuptools import find_packages, setup
4
5 import os
6 import subprocess
7 import time
8
9 version_file = &#x27;gfpgan/version.py&#x27;
</pre>
</div>
</div>
</div>
<div id="issue-21">
<div class="issue-block issue-sev-low">
<b>subprocess_without_shell_equals_true: </b> subprocess call - check for execution of untrusted input.<br>
<b>Test ID:</b> B603<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/setup.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/setup.py</a><br>
<b>Line number: </b>31<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html</a><br>
<div class="code">
<pre>
27 # LANGUAGE is used on win32
28 env[&#x27;LANGUAGE&#x27;] = &#x27;C&#x27;
29 env[&#x27;LANG&#x27;] = &#x27;C&#x27;
30 env[&#x27;LC_ALL&#x27;] = &#x27;C&#x27;
31 out = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env).communicate()[0]
32 return out
33
34 try:
</pre>
</div>
</div>
</div>
<div id="issue-22">
<div class="issue-block issue-sev-medium">
<b>exec_used: </b> Use of exec detected.<br>
<b>Test ID:</b> B102<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/setup.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/setup.py</a><br>
<b>Line number: </b>71<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b102_exec_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b102_exec_used.html</a><br>
<div class="code">
<pre>
67
68
69 def get_version():
70 with open(version_file, &#x27;r&#x27;) as f:
71 exec(compile(f.read(), version_file, &#x27;exec&#x27;))
72 return locals()[&#x27;__version__&#x27;]
73
74
</pre>
</div>
</div>
</div>
<div id="issue-23">
<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/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py</a><br>
<b>Line number: </b>14<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>
10 if torch.cuda.is_available():
11 net = ResNetArcFace(block=&#x27;IRBlock&#x27;, layers=(2, 2, 2, 2), use_se=True).cuda().eval()
12 img = torch.rand((1, 1, 128, 128), dtype=torch.float32).cuda()
13 output = net(img)
14 assert output.shape == (1, 512)
15
16 # -------------------- without SE block ----------------------- #
17 net = ResNetArcFace(block=&#x27;IRBlock&#x27;, layers=(2, 2, 2, 2), use_se=False).cuda().eval()
</pre>
</div>
</div>
</div>
<div id="issue-24">
<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/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py</a><br>
<b>Line number: </b>19<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>
15
16 # -------------------- without SE block ----------------------- #
17 net = ResNetArcFace(block=&#x27;IRBlock&#x27;, layers=(2, 2, 2, 2), use_se=False).cuda().eval()
18 output = net(img)
19 assert output.shape == (1, 512)
20
21
22 def test_basicblock():
</pre>
</div>
</div>
</div>
<div id="issue-25">
<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/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py</a><br>
<b>Line number: </b>27<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>
23 &quot;&quot;&quot;Test the BasicBlock in arcface_arch&quot;&quot;&quot;
24 block = BasicBlock(1, 3, stride=1, downsample=None).cuda()
25 img = torch.rand((1, 1, 12, 12), dtype=torch.float32).cuda()
26 output = block(img)
27 assert output.shape == (1, 3, 12, 12)
28
29 # ----------------- use the downsmaple module--------------- #
30 downsample = torch.nn.UpsamplingNearest2d(scale_factor=0.5).cuda()
</pre>
</div>
</div>
</div>
<div id="issue-26">
<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/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py</a><br>
<b>Line number: </b>34<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>
30 downsample = torch.nn.UpsamplingNearest2d(scale_factor=0.5).cuda()
31 block = BasicBlock(1, 3, stride=2, downsample=downsample).cuda()
32 img = torch.rand((1, 1, 12, 12), dtype=torch.float32).cuda()
33 output = block(img)
34 assert output.shape == (1, 3, 6, 6)
35
36
37 def test_bottleneck():
</pre>
</div>
</div>
</div>
<div id="issue-27">
<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/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py</a><br>
<b>Line number: </b>42<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>
38 &quot;&quot;&quot;Test the Bottleneck in arcface_arch&quot;&quot;&quot;
39 block = Bottleneck(1, 1, stride=1, downsample=None).cuda()
40 img = torch.rand((1, 1, 12, 12), dtype=torch.float32).cuda()
41 output = block(img)
42 assert output.shape == (1, 4, 12, 12)
43
44 # ----------------- use the downsmaple module--------------- #
45 downsample = torch.nn.UpsamplingNearest2d(scale_factor=0.5).cuda()
</pre>
</div>
</div>
</div>
<div id="issue-28">
<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/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_arcface_arch.py</a><br>
<b>Line number: </b>49<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>
45 downsample = torch.nn.UpsamplingNearest2d(scale_factor=0.5).cuda()
46 block = Bottleneck(1, 1, stride=2, downsample=downsample).cuda()
47 img = torch.rand((1, 1, 12, 12), dtype=torch.float32).cuda()
48 output = block(img)
49 assert output.shape == (1, 4, 6, 6)
</pre>
</div>
</div>
</div>
<div id="issue-29">
<div class="issue-block issue-sev-medium">
<b>yaml_load: </b> Use of unsafe yaml load. Allows instantiation of arbitrary objects. Consider yaml.safe_load().<br>
<b>Test ID:</b> B506<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/20.html" target="_blank">CWE-20</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>10<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b506_yaml_load.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b506_yaml_load.html</a><br>
<div class="code">
<pre>
6
7 def test_ffhq_degradation_dataset():
8
9 with open(&#x27;tests/data/test_ffhq_degradation_dataset.yml&#x27;, mode=&#x27;r&#x27;) as f:
10 opt = yaml.load(f, Loader=yaml.FullLoader)
11
12 dataset = FFHQDegradationDataset(opt)
13 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;disk&#x27; # io backend
</pre>
</div>
</div>
</div>
<div id="issue-30">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>13<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>
9 with open(&#x27;tests/data/test_ffhq_degradation_dataset.yml&#x27;, mode=&#x27;r&#x27;) as f:
10 opt = yaml.load(f, Loader=yaml.FullLoader)
11
12 dataset = FFHQDegradationDataset(opt)
13 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;disk&#x27; # io backend
14 assert len(dataset) == 1 # whether to read correct meta info
15 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
16 assert dataset.color_jitter_prob == 1
</pre>
</div>
</div>
</div>
<div id="issue-31">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>14<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>
10 opt = yaml.load(f, Loader=yaml.FullLoader)
11
12 dataset = FFHQDegradationDataset(opt)
13 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;disk&#x27; # io backend
14 assert len(dataset) == 1 # whether to read correct meta info
15 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
16 assert dataset.color_jitter_prob == 1
17
</pre>
</div>
</div>
</div>
<div id="issue-32">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>15<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>
11
12 dataset = FFHQDegradationDataset(opt)
13 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;disk&#x27; # io backend
14 assert len(dataset) == 1 # whether to read correct meta info
15 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
16 assert dataset.color_jitter_prob == 1
17
18 # test __getitem__
</pre>
</div>
</div>
</div>
<div id="issue-33">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>16<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>
12 dataset = FFHQDegradationDataset(opt)
13 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;disk&#x27; # io backend
14 assert len(dataset) == 1 # whether to read correct meta info
15 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
16 assert dataset.color_jitter_prob == 1
17
18 # test __getitem__
19 result = dataset.__getitem__(0)
</pre>
</div>
</div>
</div>
<div id="issue-34">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>22<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>
18 # test __getitem__
19 result = dataset.__getitem__(0)
20 # check returned keys
21 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;]
22 assert set(expected_keys).issubset(set(result.keys()))
23 # check shape and contents
24 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
25 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
</pre>
</div>
</div>
</div>
<div id="issue-35">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>24<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>
20 # check returned keys
21 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;]
22 assert set(expected_keys).issubset(set(result.keys()))
23 # check shape and contents
24 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
25 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
26 assert result[&#x27;gt_path&#x27;] == &#x27;tests/data/gt/00000000.png&#x27;
27
</pre>
</div>
</div>
</div>
<div id="issue-36">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>25<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>
21 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;]
22 assert set(expected_keys).issubset(set(result.keys()))
23 # check shape and contents
24 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
25 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
26 assert result[&#x27;gt_path&#x27;] == &#x27;tests/data/gt/00000000.png&#x27;
27
28 # ------------------ test with probability = 0 -------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-37">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>26<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>
22 assert set(expected_keys).issubset(set(result.keys()))
23 # check shape and contents
24 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
25 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
26 assert result[&#x27;gt_path&#x27;] == &#x27;tests/data/gt/00000000.png&#x27;
27
28 # ------------------ test with probability = 0 -------------------- #
29 opt[&#x27;color_jitter_prob&#x27;] = 0
</pre>
</div>
</div>
</div>
<div id="issue-38">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>34<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>
30 opt[&#x27;color_jitter_pt_prob&#x27;] = 0
31 opt[&#x27;gray_prob&#x27;] = 0
32 opt[&#x27;io_backend&#x27;] = dict(type=&#x27;disk&#x27;)
33 dataset = FFHQDegradationDataset(opt)
34 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;disk&#x27; # io backend
35 assert len(dataset) == 1 # whether to read correct meta info
36 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
37 assert dataset.color_jitter_prob == 0
</pre>
</div>
</div>
</div>
<div id="issue-39">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>35<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>
31 opt[&#x27;gray_prob&#x27;] = 0
32 opt[&#x27;io_backend&#x27;] = dict(type=&#x27;disk&#x27;)
33 dataset = FFHQDegradationDataset(opt)
34 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;disk&#x27; # io backend
35 assert len(dataset) == 1 # whether to read correct meta info
36 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
37 assert dataset.color_jitter_prob == 0
38
</pre>
</div>
</div>
</div>
<div id="issue-40">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>36<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>
32 opt[&#x27;io_backend&#x27;] = dict(type=&#x27;disk&#x27;)
33 dataset = FFHQDegradationDataset(opt)
34 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;disk&#x27; # io backend
35 assert len(dataset) == 1 # whether to read correct meta info
36 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
37 assert dataset.color_jitter_prob == 0
38
39 # test __getitem__
</pre>
</div>
</div>
</div>
<div id="issue-41">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>37<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>
33 dataset = FFHQDegradationDataset(opt)
34 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;disk&#x27; # io backend
35 assert len(dataset) == 1 # whether to read correct meta info
36 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
37 assert dataset.color_jitter_prob == 0
38
39 # test __getitem__
40 result = dataset.__getitem__(0)
</pre>
</div>
</div>
</div>
<div id="issue-42">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>43<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>
39 # test __getitem__
40 result = dataset.__getitem__(0)
41 # check returned keys
42 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;]
43 assert set(expected_keys).issubset(set(result.keys()))
44 # check shape and contents
45 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
46 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
</pre>
</div>
</div>
</div>
<div id="issue-43">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>45<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>
41 # check returned keys
42 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;]
43 assert set(expected_keys).issubset(set(result.keys()))
44 # check shape and contents
45 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
46 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
47 assert result[&#x27;gt_path&#x27;] == &#x27;tests/data/gt/00000000.png&#x27;
48
</pre>
</div>
</div>
</div>
<div id="issue-44">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>46<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>
42 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;]
43 assert set(expected_keys).issubset(set(result.keys()))
44 # check shape and contents
45 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
46 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
47 assert result[&#x27;gt_path&#x27;] == &#x27;tests/data/gt/00000000.png&#x27;
48
49 # ------------------ test lmdb backend -------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-45">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>47<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>
43 assert set(expected_keys).issubset(set(result.keys()))
44 # check shape and contents
45 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
46 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
47 assert result[&#x27;gt_path&#x27;] == &#x27;tests/data/gt/00000000.png&#x27;
48
49 # ------------------ test lmdb backend -------------------- #
50 opt[&#x27;dataroot_gt&#x27;] = &#x27;tests/data/ffhq_gt.lmdb&#x27;
</pre>
</div>
</div>
</div>
<div id="issue-46">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>54<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>
50 opt[&#x27;dataroot_gt&#x27;] = &#x27;tests/data/ffhq_gt.lmdb&#x27;
51 opt[&#x27;io_backend&#x27;] = dict(type=&#x27;lmdb&#x27;)
52
53 dataset = FFHQDegradationDataset(opt)
54 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;lmdb&#x27; # io backend
55 assert len(dataset) == 1 # whether to read correct meta info
56 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
57 assert dataset.color_jitter_prob == 0
</pre>
</div>
</div>
</div>
<div id="issue-47">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>55<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>
51 opt[&#x27;io_backend&#x27;] = dict(type=&#x27;lmdb&#x27;)
52
53 dataset = FFHQDegradationDataset(opt)
54 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;lmdb&#x27; # io backend
55 assert len(dataset) == 1 # whether to read correct meta info
56 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
57 assert dataset.color_jitter_prob == 0
58
</pre>
</div>
</div>
</div>
<div id="issue-48">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>56<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>
52
53 dataset = FFHQDegradationDataset(opt)
54 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;lmdb&#x27; # io backend
55 assert len(dataset) == 1 # whether to read correct meta info
56 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
57 assert dataset.color_jitter_prob == 0
58
59 # test __getitem__
</pre>
</div>
</div>
</div>
<div id="issue-49">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>57<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>
53 dataset = FFHQDegradationDataset(opt)
54 assert dataset.io_backend_opt[&#x27;type&#x27;] == &#x27;lmdb&#x27; # io backend
55 assert len(dataset) == 1 # whether to read correct meta info
56 assert dataset.kernel_list == [&#x27;iso&#x27;, &#x27;aniso&#x27;] # correct initialization the degradation configurations
57 assert dataset.color_jitter_prob == 0
58
59 # test __getitem__
60 result = dataset.__getitem__(0)
</pre>
</div>
</div>
</div>
<div id="issue-50">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>63<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>
59 # test __getitem__
60 result = dataset.__getitem__(0)
61 # check returned keys
62 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;]
63 assert set(expected_keys).issubset(set(result.keys()))
64 # check shape and contents
65 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
66 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
</pre>
</div>
</div>
</div>
<div id="issue-51">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.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 # check returned keys
62 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;]
63 assert set(expected_keys).issubset(set(result.keys()))
64 # check shape and contents
65 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
66 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
67 assert result[&#x27;gt_path&#x27;] == &#x27;00000000&#x27;
68
</pre>
</div>
</div>
</div>
<div id="issue-52">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>66<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>
62 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;]
63 assert set(expected_keys).issubset(set(result.keys()))
64 # check shape and contents
65 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
66 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
67 assert result[&#x27;gt_path&#x27;] == &#x27;00000000&#x27;
68
69 # ------------------ test with crop_components -------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-53">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.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 assert set(expected_keys).issubset(set(result.keys()))
64 # check shape and contents
65 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
66 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
67 assert result[&#x27;gt_path&#x27;] == &#x27;00000000&#x27;
68
69 # ------------------ test with crop_components -------------------- #
70 opt[&#x27;crop_components&#x27;] = True
</pre>
</div>
</div>
</div>
<div id="issue-54">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>77<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>
73 opt[&#x27;gt_gray&#x27;] = True
74 opt[&#x27;io_backend&#x27;] = dict(type=&#x27;lmdb&#x27;)
75
76 dataset = FFHQDegradationDataset(opt)
77 assert dataset.crop_components is True
78
79 # test __getitem__
80 result = dataset.__getitem__(0)
</pre>
</div>
</div>
</div>
<div id="issue-55">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>83<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>
79 # test __getitem__
80 result = dataset.__getitem__(0)
81 # check returned keys
82 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;, &#x27;loc_left_eye&#x27;, &#x27;loc_right_eye&#x27;, &#x27;loc_mouth&#x27;]
83 assert set(expected_keys).issubset(set(result.keys()))
84 # check shape and contents
85 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
86 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
</pre>
</div>
</div>
</div>
<div id="issue-56">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>85<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>
81 # check returned keys
82 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;, &#x27;loc_left_eye&#x27;, &#x27;loc_right_eye&#x27;, &#x27;loc_mouth&#x27;]
83 assert set(expected_keys).issubset(set(result.keys()))
84 # check shape and contents
85 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
86 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
87 assert result[&#x27;gt_path&#x27;] == &#x27;00000000&#x27;
88 assert result[&#x27;loc_left_eye&#x27;].shape == (4, )
</pre>
</div>
</div>
</div>
<div id="issue-57">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>86<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>
82 expected_keys = [&#x27;gt&#x27;, &#x27;lq&#x27;, &#x27;gt_path&#x27;, &#x27;loc_left_eye&#x27;, &#x27;loc_right_eye&#x27;, &#x27;loc_mouth&#x27;]
83 assert set(expected_keys).issubset(set(result.keys()))
84 # check shape and contents
85 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
86 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
87 assert result[&#x27;gt_path&#x27;] == &#x27;00000000&#x27;
88 assert result[&#x27;loc_left_eye&#x27;].shape == (4, )
89 assert result[&#x27;loc_right_eye&#x27;].shape == (4, )
</pre>
</div>
</div>
</div>
<div id="issue-58">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>87<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>
83 assert set(expected_keys).issubset(set(result.keys()))
84 # check shape and contents
85 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
86 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
87 assert result[&#x27;gt_path&#x27;] == &#x27;00000000&#x27;
88 assert result[&#x27;loc_left_eye&#x27;].shape == (4, )
89 assert result[&#x27;loc_right_eye&#x27;].shape == (4, )
90 assert result[&#x27;loc_mouth&#x27;].shape == (4, )
</pre>
</div>
</div>
</div>
<div id="issue-59">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>88<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>
84 # check shape and contents
85 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
86 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
87 assert result[&#x27;gt_path&#x27;] == &#x27;00000000&#x27;
88 assert result[&#x27;loc_left_eye&#x27;].shape == (4, )
89 assert result[&#x27;loc_right_eye&#x27;].shape == (4, )
90 assert result[&#x27;loc_mouth&#x27;].shape == (4, )
91
</pre>
</div>
</div>
</div>
<div id="issue-60">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>89<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>
85 assert result[&#x27;gt&#x27;].shape == (3, 512, 512)
86 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
87 assert result[&#x27;gt_path&#x27;] == &#x27;00000000&#x27;
88 assert result[&#x27;loc_left_eye&#x27;].shape == (4, )
89 assert result[&#x27;loc_right_eye&#x27;].shape == (4, )
90 assert result[&#x27;loc_mouth&#x27;].shape == (4, )
91
92 # ------------------ lmdb backend should have paths ends with lmdb -------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-61">
<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/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_ffhq_degradation_dataset.py</a><br>
<b>Line number: </b>90<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>
86 assert result[&#x27;lq&#x27;].shape == (3, 512, 512)
87 assert result[&#x27;gt_path&#x27;] == &#x27;00000000&#x27;
88 assert result[&#x27;loc_left_eye&#x27;].shape == (4, )
89 assert result[&#x27;loc_right_eye&#x27;].shape == (4, )
90 assert result[&#x27;loc_mouth&#x27;].shape == (4, )
91
92 # ------------------ lmdb backend should have paths ends with lmdb -------------------- #
93 with pytest.raises(ValueError):
</pre>
</div>
</div>
</div>
<div id="issue-62">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>27<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>
23 condition2 = torch.rand((1, 512, 16, 16), dtype=torch.float32).cuda()
24 condition3 = torch.rand((1, 512, 32, 32), dtype=torch.float32).cuda()
25 conditions = [condition1, condition1, condition2, condition2, condition3, condition3]
26 output = net([style], conditions)
27 assert output[0].shape == (1, 3, 32, 32)
28 assert output[1] is None
29
30 # -------------------- with return_latents ----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-63">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>28<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>
24 condition3 = torch.rand((1, 512, 32, 32), dtype=torch.float32).cuda()
25 conditions = [condition1, condition1, condition2, condition2, condition3, condition3]
26 output = net([style], conditions)
27 assert output[0].shape == (1, 3, 32, 32)
28 assert output[1] is None
29
30 # -------------------- with return_latents ----------------------- #
31 output = net([style], conditions, return_latents=True)
</pre>
</div>
</div>
</div>
<div id="issue-64">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>32<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>
28 assert output[1] is None
29
30 # -------------------- with return_latents ----------------------- #
31 output = net([style], conditions, return_latents=True)
32 assert output[0].shape == (1, 3, 32, 32)
33 assert len(output[1]) == 1
34 # check latent
35 assert output[1][0].shape == (8, 512)
</pre>
</div>
</div>
</div>
<div id="issue-65">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>33<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>
29
30 # -------------------- with return_latents ----------------------- #
31 output = net([style], conditions, return_latents=True)
32 assert output[0].shape == (1, 3, 32, 32)
33 assert len(output[1]) == 1
34 # check latent
35 assert output[1][0].shape == (8, 512)
36
</pre>
</div>
</div>
</div>
<div id="issue-66">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>35<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>
31 output = net([style], conditions, return_latents=True)
32 assert output[0].shape == (1, 3, 32, 32)
33 assert len(output[1]) == 1
34 # check latent
35 assert output[1][0].shape == (8, 512)
36
37 # -------------------- with randomize_noise = False ----------------------- #
38 output = net([style], conditions, randomize_noise=False)
</pre>
</div>
</div>
</div>
<div id="issue-67">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>39<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>
35 assert output[1][0].shape == (8, 512)
36
37 # -------------------- with randomize_noise = False ----------------------- #
38 output = net([style], conditions, randomize_noise=False)
39 assert output[0].shape == (1, 3, 32, 32)
40 assert output[1] is None
41
42 # -------------------- with truncation = 0.5 and mixing----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-68">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>40<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>
36
37 # -------------------- with randomize_noise = False ----------------------- #
38 output = net([style], conditions, randomize_noise=False)
39 assert output[0].shape == (1, 3, 32, 32)
40 assert output[1] is None
41
42 # -------------------- with truncation = 0.5 and mixing----------------------- #
43 output = net([style, style], conditions, truncation=0.5, truncation_latent=style)
</pre>
</div>
</div>
</div>
<div id="issue-69">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>44<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>
40 assert output[1] is None
41
42 # -------------------- with truncation = 0.5 and mixing----------------------- #
43 output = net([style, style], conditions, truncation=0.5, truncation_latent=style)
44 assert output[0].shape == (1, 3, 32, 32)
45 assert output[1] is None
46
47
</pre>
</div>
</div>
</div>
<div id="issue-70">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>45<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>
41
42 # -------------------- with truncation = 0.5 and mixing----------------------- #
43 output = net([style, style], conditions, truncation=0.5, truncation_latent=style)
44 assert output[0].shape == (1, 3, 32, 32)
45 assert output[1] is None
46
47
48 def test_gfpganv1():
</pre>
</div>
</div>
</div>
<div id="issue-71">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>69<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>
65 narrow=1,
66 sft_half=True).cuda().eval()
67 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
68 output = net(img)
69 assert output[0].shape == (1, 3, 32, 32)
70 assert len(output[1]) == 3
71 # check out_rgbs for intermediate loss
72 assert output[1][0].shape == (1, 3, 8, 8)
</pre>
</div>
</div>
</div>
<div id="issue-72">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.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 sft_half=True).cuda().eval()
67 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
68 output = net(img)
69 assert output[0].shape == (1, 3, 32, 32)
70 assert len(output[1]) == 3
71 # check out_rgbs for intermediate loss
72 assert output[1][0].shape == (1, 3, 8, 8)
73 assert output[1][1].shape == (1, 3, 16, 16)
</pre>
</div>
</div>
</div>
<div id="issue-73">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>72<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>
68 output = net(img)
69 assert output[0].shape == (1, 3, 32, 32)
70 assert len(output[1]) == 3
71 # check out_rgbs for intermediate loss
72 assert output[1][0].shape == (1, 3, 8, 8)
73 assert output[1][1].shape == (1, 3, 16, 16)
74 assert output[1][2].shape == (1, 3, 32, 32)
75
</pre>
</div>
</div>
</div>
<div id="issue-74">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>73<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>
69 assert output[0].shape == (1, 3, 32, 32)
70 assert len(output[1]) == 3
71 # check out_rgbs for intermediate loss
72 assert output[1][0].shape == (1, 3, 8, 8)
73 assert output[1][1].shape == (1, 3, 16, 16)
74 assert output[1][2].shape == (1, 3, 32, 32)
75
76 # -------------------- with different_w = True ----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-75">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>74<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>
70 assert len(output[1]) == 3
71 # check out_rgbs for intermediate loss
72 assert output[1][0].shape == (1, 3, 8, 8)
73 assert output[1][1].shape == (1, 3, 16, 16)
74 assert output[1][2].shape == (1, 3, 32, 32)
75
76 # -------------------- with different_w = True ----------------------- #
77 net = GFPGANv1(
</pre>
</div>
</div>
</div>
<div id="issue-76">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>93<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>
89 narrow=1,
90 sft_half=True).cuda().eval()
91 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
92 output = net(img)
93 assert output[0].shape == (1, 3, 32, 32)
94 assert len(output[1]) == 3
95 # check out_rgbs for intermediate loss
96 assert output[1][0].shape == (1, 3, 8, 8)
</pre>
</div>
</div>
</div>
<div id="issue-77">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>94<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>
90 sft_half=True).cuda().eval()
91 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
92 output = net(img)
93 assert output[0].shape == (1, 3, 32, 32)
94 assert len(output[1]) == 3
95 # check out_rgbs for intermediate loss
96 assert output[1][0].shape == (1, 3, 8, 8)
97 assert output[1][1].shape == (1, 3, 16, 16)
</pre>
</div>
</div>
</div>
<div id="issue-78">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>96<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>
92 output = net(img)
93 assert output[0].shape == (1, 3, 32, 32)
94 assert len(output[1]) == 3
95 # check out_rgbs for intermediate loss
96 assert output[1][0].shape == (1, 3, 8, 8)
97 assert output[1][1].shape == (1, 3, 16, 16)
98 assert output[1][2].shape == (1, 3, 32, 32)
99
</pre>
</div>
</div>
</div>
<div id="issue-79">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>97<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>
93 assert output[0].shape == (1, 3, 32, 32)
94 assert len(output[1]) == 3
95 # check out_rgbs for intermediate loss
96 assert output[1][0].shape == (1, 3, 8, 8)
97 assert output[1][1].shape == (1, 3, 16, 16)
98 assert output[1][2].shape == (1, 3, 32, 32)
99
100
</pre>
</div>
</div>
</div>
<div id="issue-80">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>98<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>
94 assert len(output[1]) == 3
95 # check out_rgbs for intermediate loss
96 assert output[1][0].shape == (1, 3, 8, 8)
97 assert output[1][1].shape == (1, 3, 16, 16)
98 assert output[1][2].shape == (1, 3, 32, 32)
99
100
101 def test_facialcomponentdiscriminator():
</pre>
</div>
</div>
</div>
<div id="issue-81">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>109<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>
105 if torch.cuda.is_available():
106 net = FacialComponentDiscriminator().cuda().eval()
107 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
108 output = net(img)
109 assert len(output) == 2
110 assert output[0].shape == (1, 1, 8, 8)
111 assert output[1] is None
112
</pre>
</div>
</div>
</div>
<div id="issue-82">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>110<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>
106 net = FacialComponentDiscriminator().cuda().eval()
107 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
108 output = net(img)
109 assert len(output) == 2
110 assert output[0].shape == (1, 1, 8, 8)
111 assert output[1] is None
112
113 # -------------------- return intermediate features ----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-83">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>111<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>
107 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
108 output = net(img)
109 assert len(output) == 2
110 assert output[0].shape == (1, 1, 8, 8)
111 assert output[1] is None
112
113 # -------------------- return intermediate features ----------------------- #
114 output = net(img, return_feats=True)
</pre>
</div>
</div>
</div>
<div id="issue-84">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>115<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>
111 assert output[1] is None
112
113 # -------------------- return intermediate features ----------------------- #
114 output = net(img, return_feats=True)
115 assert len(output) == 2
116 assert output[0].shape == (1, 1, 8, 8)
117 assert len(output[1]) == 2
118 assert output[1][0].shape == (1, 128, 16, 16)
</pre>
</div>
</div>
</div>
<div id="issue-85">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>116<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>
112
113 # -------------------- return intermediate features ----------------------- #
114 output = net(img, return_feats=True)
115 assert len(output) == 2
116 assert output[0].shape == (1, 1, 8, 8)
117 assert len(output[1]) == 2
118 assert output[1][0].shape == (1, 128, 16, 16)
119 assert output[1][1].shape == (1, 256, 8, 8)
</pre>
</div>
</div>
</div>
<div id="issue-86">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>117<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>
113 # -------------------- return intermediate features ----------------------- #
114 output = net(img, return_feats=True)
115 assert len(output) == 2
116 assert output[0].shape == (1, 1, 8, 8)
117 assert len(output[1]) == 2
118 assert output[1][0].shape == (1, 128, 16, 16)
119 assert output[1][1].shape == (1, 256, 8, 8)
120
</pre>
</div>
</div>
</div>
<div id="issue-87">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>118<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>
114 output = net(img, return_feats=True)
115 assert len(output) == 2
116 assert output[0].shape == (1, 1, 8, 8)
117 assert len(output[1]) == 2
118 assert output[1][0].shape == (1, 128, 16, 16)
119 assert output[1][1].shape == (1, 256, 8, 8)
120
121
</pre>
</div>
</div>
</div>
<div id="issue-88">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>119<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>
115 assert len(output) == 2
116 assert output[0].shape == (1, 1, 8, 8)
117 assert len(output[1]) == 2
118 assert output[1][0].shape == (1, 128, 16, 16)
119 assert output[1][1].shape == (1, 256, 8, 8)
120
121
122 def test_stylegan2generatorcsft():
</pre>
</div>
</div>
</div>
<div id="issue-89">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>135<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>
131 condition2 = torch.rand((1, 512, 16, 16), dtype=torch.float32).cuda()
132 condition3 = torch.rand((1, 512, 32, 32), dtype=torch.float32).cuda()
133 conditions = [condition1, condition1, condition2, condition2, condition3, condition3]
134 output = net([style], conditions)
135 assert output[0].shape == (1, 3, 32, 32)
136 assert output[1] is None
137
138 # -------------------- with return_latents ----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-90">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>136<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>
132 condition3 = torch.rand((1, 512, 32, 32), dtype=torch.float32).cuda()
133 conditions = [condition1, condition1, condition2, condition2, condition3, condition3]
134 output = net([style], conditions)
135 assert output[0].shape == (1, 3, 32, 32)
136 assert output[1] is None
137
138 # -------------------- with return_latents ----------------------- #
139 output = net([style], conditions, return_latents=True)
</pre>
</div>
</div>
</div>
<div id="issue-91">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>140<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>
136 assert output[1] is None
137
138 # -------------------- with return_latents ----------------------- #
139 output = net([style], conditions, return_latents=True)
140 assert output[0].shape == (1, 3, 32, 32)
141 assert len(output[1]) == 1
142 # check latent
143 assert output[1][0].shape == (8, 512)
</pre>
</div>
</div>
</div>
<div id="issue-92">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>141<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>
137
138 # -------------------- with return_latents ----------------------- #
139 output = net([style], conditions, return_latents=True)
140 assert output[0].shape == (1, 3, 32, 32)
141 assert len(output[1]) == 1
142 # check latent
143 assert output[1][0].shape == (8, 512)
144
</pre>
</div>
</div>
</div>
<div id="issue-93">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>143<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>
139 output = net([style], conditions, return_latents=True)
140 assert output[0].shape == (1, 3, 32, 32)
141 assert len(output[1]) == 1
142 # check latent
143 assert output[1][0].shape == (8, 512)
144
145 # -------------------- with randomize_noise = False ----------------------- #
146 output = net([style], conditions, randomize_noise=False)
</pre>
</div>
</div>
</div>
<div id="issue-94">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>147<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>
143 assert output[1][0].shape == (8, 512)
144
145 # -------------------- with randomize_noise = False ----------------------- #
146 output = net([style], conditions, randomize_noise=False)
147 assert output[0].shape == (1, 3, 32, 32)
148 assert output[1] is None
149
150 # -------------------- with truncation = 0.5 and mixing----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-95">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>148<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>
144
145 # -------------------- with randomize_noise = False ----------------------- #
146 output = net([style], conditions, randomize_noise=False)
147 assert output[0].shape == (1, 3, 32, 32)
148 assert output[1] is None
149
150 # -------------------- with truncation = 0.5 and mixing----------------------- #
151 output = net([style, style], conditions, truncation=0.5, truncation_latent=style)
</pre>
</div>
</div>
</div>
<div id="issue-96">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>152<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>
148 assert output[1] is None
149
150 # -------------------- with truncation = 0.5 and mixing----------------------- #
151 output = net([style, style], conditions, truncation=0.5, truncation_latent=style)
152 assert output[0].shape == (1, 3, 32, 32)
153 assert output[1] is None
154
155
</pre>
</div>
</div>
</div>
<div id="issue-97">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>153<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>
149
150 # -------------------- with truncation = 0.5 and mixing----------------------- #
151 output = net([style, style], conditions, truncation=0.5, truncation_latent=style)
152 assert output[0].shape == (1, 3, 32, 32)
153 assert output[1] is None
154
155
156 def test_gfpganv1clean():
</pre>
</div>
</div>
</div>
<div id="issue-98">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>176<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>
172 sft_half=True).cuda().eval()
173
174 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
175 output = net(img)
176 assert output[0].shape == (1, 3, 32, 32)
177 assert len(output[1]) == 3
178 # check out_rgbs for intermediate loss
179 assert output[1][0].shape == (1, 3, 8, 8)
</pre>
</div>
</div>
</div>
<div id="issue-99">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>177<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>
173
174 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
175 output = net(img)
176 assert output[0].shape == (1, 3, 32, 32)
177 assert len(output[1]) == 3
178 # check out_rgbs for intermediate loss
179 assert output[1][0].shape == (1, 3, 8, 8)
180 assert output[1][1].shape == (1, 3, 16, 16)
</pre>
</div>
</div>
</div>
<div id="issue-100">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>179<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>
175 output = net(img)
176 assert output[0].shape == (1, 3, 32, 32)
177 assert len(output[1]) == 3
178 # check out_rgbs for intermediate loss
179 assert output[1][0].shape == (1, 3, 8, 8)
180 assert output[1][1].shape == (1, 3, 16, 16)
181 assert output[1][2].shape == (1, 3, 32, 32)
182
</pre>
</div>
</div>
</div>
<div id="issue-101">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>180<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>
176 assert output[0].shape == (1, 3, 32, 32)
177 assert len(output[1]) == 3
178 # check out_rgbs for intermediate loss
179 assert output[1][0].shape == (1, 3, 8, 8)
180 assert output[1][1].shape == (1, 3, 16, 16)
181 assert output[1][2].shape == (1, 3, 32, 32)
182
183 # -------------------- with different_w = True ----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-102">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>181<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>
177 assert len(output[1]) == 3
178 # check out_rgbs for intermediate loss
179 assert output[1][0].shape == (1, 3, 8, 8)
180 assert output[1][1].shape == (1, 3, 16, 16)
181 assert output[1][2].shape == (1, 3, 32, 32)
182
183 # -------------------- with different_w = True ----------------------- #
184 net = GFPGANv1Clean(
</pre>
</div>
</div>
</div>
<div id="issue-103">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>198<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>
194 narrow=1,
195 sft_half=True).cuda().eval()
196 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
197 output = net(img)
198 assert output[0].shape == (1, 3, 32, 32)
199 assert len(output[1]) == 3
200 # check out_rgbs for intermediate loss
201 assert output[1][0].shape == (1, 3, 8, 8)
</pre>
</div>
</div>
</div>
<div id="issue-104">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>199<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>
195 sft_half=True).cuda().eval()
196 img = torch.rand((1, 3, 32, 32), dtype=torch.float32).cuda()
197 output = net(img)
198 assert output[0].shape == (1, 3, 32, 32)
199 assert len(output[1]) == 3
200 # check out_rgbs for intermediate loss
201 assert output[1][0].shape == (1, 3, 8, 8)
202 assert output[1][1].shape == (1, 3, 16, 16)
</pre>
</div>
</div>
</div>
<div id="issue-105">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>201<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>
197 output = net(img)
198 assert output[0].shape == (1, 3, 32, 32)
199 assert len(output[1]) == 3
200 # check out_rgbs for intermediate loss
201 assert output[1][0].shape == (1, 3, 8, 8)
202 assert output[1][1].shape == (1, 3, 16, 16)
203 assert output[1][2].shape == (1, 3, 32, 32)
</pre>
</div>
</div>
</div>
<div id="issue-106">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>202<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>
198 assert output[0].shape == (1, 3, 32, 32)
199 assert len(output[1]) == 3
200 # check out_rgbs for intermediate loss
201 assert output[1][0].shape == (1, 3, 8, 8)
202 assert output[1][1].shape == (1, 3, 16, 16)
203 assert output[1][2].shape == (1, 3, 32, 32)
</pre>
</div>
</div>
</div>
<div id="issue-107">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_arch.py</a><br>
<b>Line number: </b>203<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>
199 assert len(output[1]) == 3
200 # check out_rgbs for intermediate loss
201 assert output[1][0].shape == (1, 3, 8, 8)
202 assert output[1][1].shape == (1, 3, 16, 16)
203 assert output[1][2].shape == (1, 3, 32, 32)
</pre>
</div>
</div>
</div>
<div id="issue-108">
<div class="issue-block issue-sev-medium">
<b>yaml_load: </b> Use of unsafe yaml load. Allows instantiation of arbitrary objects. Consider yaml.safe_load().<br>
<b>Test ID:</b> B506<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/20.html" target="_blank">CWE-20</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>15<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b506_yaml_load.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b506_yaml_load.html</a><br>
<div class="code">
<pre>
11
12
13 def test_gfpgan_model():
14 with open(&#x27;tests/data/test_gfpgan_model.yml&#x27;, mode=&#x27;r&#x27;) as f:
15 opt = yaml.load(f, Loader=yaml.FullLoader)
16
17 # build model
18 model = GFPGANModel(opt)
</pre>
</div>
</div>
</div>
<div id="issue-109">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>20<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>
16
17 # build model
18 model = GFPGANModel(opt)
19 # test attributes
20 assert model.__class__.__name__ == &#x27;GFPGANModel&#x27;
21 assert isinstance(model.net_g, GFPGANv1) # generator
22 assert isinstance(model.net_d, StyleGAN2Discriminator) # discriminator
23 # facial component discriminators
</pre>
</div>
</div>
</div>
<div id="issue-110">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>21<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>
17 # build model
18 model = GFPGANModel(opt)
19 # test attributes
20 assert model.__class__.__name__ == &#x27;GFPGANModel&#x27;
21 assert isinstance(model.net_g, GFPGANv1) # generator
22 assert isinstance(model.net_d, StyleGAN2Discriminator) # discriminator
23 # facial component discriminators
24 assert isinstance(model.net_d_left_eye, FacialComponentDiscriminator)
</pre>
</div>
</div>
</div>
<div id="issue-111">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>22<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>
18 model = GFPGANModel(opt)
19 # test attributes
20 assert model.__class__.__name__ == &#x27;GFPGANModel&#x27;
21 assert isinstance(model.net_g, GFPGANv1) # generator
22 assert isinstance(model.net_d, StyleGAN2Discriminator) # discriminator
23 # facial component discriminators
24 assert isinstance(model.net_d_left_eye, FacialComponentDiscriminator)
25 assert isinstance(model.net_d_right_eye, FacialComponentDiscriminator)
</pre>
</div>
</div>
</div>
<div id="issue-112">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>24<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>
20 assert model.__class__.__name__ == &#x27;GFPGANModel&#x27;
21 assert isinstance(model.net_g, GFPGANv1) # generator
22 assert isinstance(model.net_d, StyleGAN2Discriminator) # discriminator
23 # facial component discriminators
24 assert isinstance(model.net_d_left_eye, FacialComponentDiscriminator)
25 assert isinstance(model.net_d_right_eye, FacialComponentDiscriminator)
26 assert isinstance(model.net_d_mouth, FacialComponentDiscriminator)
27 # identity network
</pre>
</div>
</div>
</div>
<div id="issue-113">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>25<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>
21 assert isinstance(model.net_g, GFPGANv1) # generator
22 assert isinstance(model.net_d, StyleGAN2Discriminator) # discriminator
23 # facial component discriminators
24 assert isinstance(model.net_d_left_eye, FacialComponentDiscriminator)
25 assert isinstance(model.net_d_right_eye, FacialComponentDiscriminator)
26 assert isinstance(model.net_d_mouth, FacialComponentDiscriminator)
27 # identity network
28 assert isinstance(model.network_identity, ResNetArcFace)
</pre>
</div>
</div>
</div>
<div id="issue-114">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>26<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>
22 assert isinstance(model.net_d, StyleGAN2Discriminator) # discriminator
23 # facial component discriminators
24 assert isinstance(model.net_d_left_eye, FacialComponentDiscriminator)
25 assert isinstance(model.net_d_right_eye, FacialComponentDiscriminator)
26 assert isinstance(model.net_d_mouth, FacialComponentDiscriminator)
27 # identity network
28 assert isinstance(model.network_identity, ResNetArcFace)
29 # losses
</pre>
</div>
</div>
</div>
<div id="issue-115">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>28<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>
24 assert isinstance(model.net_d_left_eye, FacialComponentDiscriminator)
25 assert isinstance(model.net_d_right_eye, FacialComponentDiscriminator)
26 assert isinstance(model.net_d_mouth, FacialComponentDiscriminator)
27 # identity network
28 assert isinstance(model.network_identity, ResNetArcFace)
29 # losses
30 assert isinstance(model.cri_pix, L1Loss)
31 assert isinstance(model.cri_perceptual, PerceptualLoss)
</pre>
</div>
</div>
</div>
<div id="issue-116">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>30<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>
26 assert isinstance(model.net_d_mouth, FacialComponentDiscriminator)
27 # identity network
28 assert isinstance(model.network_identity, ResNetArcFace)
29 # losses
30 assert isinstance(model.cri_pix, L1Loss)
31 assert isinstance(model.cri_perceptual, PerceptualLoss)
32 assert isinstance(model.cri_gan, GANLoss)
33 assert isinstance(model.cri_l1, L1Loss)
</pre>
</div>
</div>
</div>
<div id="issue-117">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>31<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>
27 # identity network
28 assert isinstance(model.network_identity, ResNetArcFace)
29 # losses
30 assert isinstance(model.cri_pix, L1Loss)
31 assert isinstance(model.cri_perceptual, PerceptualLoss)
32 assert isinstance(model.cri_gan, GANLoss)
33 assert isinstance(model.cri_l1, L1Loss)
34 # optimizer
</pre>
</div>
</div>
</div>
<div id="issue-118">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>32<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>
28 assert isinstance(model.network_identity, ResNetArcFace)
29 # losses
30 assert isinstance(model.cri_pix, L1Loss)
31 assert isinstance(model.cri_perceptual, PerceptualLoss)
32 assert isinstance(model.cri_gan, GANLoss)
33 assert isinstance(model.cri_l1, L1Loss)
34 # optimizer
35 assert isinstance(model.optimizers[0], torch.optim.Adam)
</pre>
</div>
</div>
</div>
<div id="issue-119">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>33<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>
29 # losses
30 assert isinstance(model.cri_pix, L1Loss)
31 assert isinstance(model.cri_perceptual, PerceptualLoss)
32 assert isinstance(model.cri_gan, GANLoss)
33 assert isinstance(model.cri_l1, L1Loss)
34 # optimizer
35 assert isinstance(model.optimizers[0], torch.optim.Adam)
36 assert isinstance(model.optimizers[1], torch.optim.Adam)
</pre>
</div>
</div>
</div>
<div id="issue-120">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>35<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>
31 assert isinstance(model.cri_perceptual, PerceptualLoss)
32 assert isinstance(model.cri_gan, GANLoss)
33 assert isinstance(model.cri_l1, L1Loss)
34 # optimizer
35 assert isinstance(model.optimizers[0], torch.optim.Adam)
36 assert isinstance(model.optimizers[1], torch.optim.Adam)
37
38 # prepare data
</pre>
</div>
</div>
</div>
<div id="issue-121">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>36<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>
32 assert isinstance(model.cri_gan, GANLoss)
33 assert isinstance(model.cri_l1, L1Loss)
34 # optimizer
35 assert isinstance(model.optimizers[0], torch.optim.Adam)
36 assert isinstance(model.optimizers[1], torch.optim.Adam)
37
38 # prepare data
39 gt = torch.rand((1, 3, 512, 512), dtype=torch.float32)
</pre>
</div>
</div>
</div>
<div id="issue-122">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>47<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>
43 loc_mouth = torch.rand((1, 4), dtype=torch.float32)
44 data = dict(gt=gt, lq=lq, loc_left_eye=loc_left_eye, loc_right_eye=loc_right_eye, loc_mouth=loc_mouth)
45 model.feed_data(data)
46 # check data shape
47 assert model.lq.shape == (1, 3, 512, 512)
48 assert model.gt.shape == (1, 3, 512, 512)
49 assert model.loc_left_eyes.shape == (1, 4)
50 assert model.loc_right_eyes.shape == (1, 4)
</pre>
</div>
</div>
</div>
<div id="issue-123">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>48<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>
44 data = dict(gt=gt, lq=lq, loc_left_eye=loc_left_eye, loc_right_eye=loc_right_eye, loc_mouth=loc_mouth)
45 model.feed_data(data)
46 # check data shape
47 assert model.lq.shape == (1, 3, 512, 512)
48 assert model.gt.shape == (1, 3, 512, 512)
49 assert model.loc_left_eyes.shape == (1, 4)
50 assert model.loc_right_eyes.shape == (1, 4)
51 assert model.loc_mouths.shape == (1, 4)
</pre>
</div>
</div>
</div>
<div id="issue-124">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>49<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>
45 model.feed_data(data)
46 # check data shape
47 assert model.lq.shape == (1, 3, 512, 512)
48 assert model.gt.shape == (1, 3, 512, 512)
49 assert model.loc_left_eyes.shape == (1, 4)
50 assert model.loc_right_eyes.shape == (1, 4)
51 assert model.loc_mouths.shape == (1, 4)
52
</pre>
</div>
</div>
</div>
<div id="issue-125">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>50<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>
46 # check data shape
47 assert model.lq.shape == (1, 3, 512, 512)
48 assert model.gt.shape == (1, 3, 512, 512)
49 assert model.loc_left_eyes.shape == (1, 4)
50 assert model.loc_right_eyes.shape == (1, 4)
51 assert model.loc_mouths.shape == (1, 4)
52
53 # ----------------- test optimize_parameters -------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-126">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>51<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>
47 assert model.lq.shape == (1, 3, 512, 512)
48 assert model.gt.shape == (1, 3, 512, 512)
49 assert model.loc_left_eyes.shape == (1, 4)
50 assert model.loc_right_eyes.shape == (1, 4)
51 assert model.loc_mouths.shape == (1, 4)
52
53 # ----------------- test optimize_parameters -------------------- #
54 model.feed_data(data)
</pre>
</div>
</div>
</div>
<div id="issue-127">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>56<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>
52
53 # ----------------- test optimize_parameters -------------------- #
54 model.feed_data(data)
55 model.optimize_parameters(1)
56 assert model.output.shape == (1, 3, 512, 512)
57 assert isinstance(model.log_dict, dict)
58 # check returned keys
59 expected_keys = [
</pre>
</div>
</div>
</div>
<div id="issue-128">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>57<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>
53 # ----------------- test optimize_parameters -------------------- #
54 model.feed_data(data)
55 model.optimize_parameters(1)
56 assert model.output.shape == (1, 3, 512, 512)
57 assert isinstance(model.log_dict, dict)
58 # check returned keys
59 expected_keys = [
60 &#x27;l_g_pix&#x27;, &#x27;l_g_percep&#x27;, &#x27;l_g_style&#x27;, &#x27;l_g_gan&#x27;, &#x27;l_g_gan_left_eye&#x27;, &#x27;l_g_gan_right_eye&#x27;, &#x27;l_g_gan_mouth&#x27;,
</pre>
</div>
</div>
</div>
<div id="issue-129">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>64<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>
60 &#x27;l_g_pix&#x27;, &#x27;l_g_percep&#x27;, &#x27;l_g_style&#x27;, &#x27;l_g_gan&#x27;, &#x27;l_g_gan_left_eye&#x27;, &#x27;l_g_gan_right_eye&#x27;, &#x27;l_g_gan_mouth&#x27;,
61 &#x27;l_g_comp_style_loss&#x27;, &#x27;l_identity&#x27;, &#x27;l_d&#x27;, &#x27;real_score&#x27;, &#x27;fake_score&#x27;, &#x27;l_d_r1&#x27;, &#x27;l_d_left_eye&#x27;,
62 &#x27;l_d_right_eye&#x27;, &#x27;l_d_mouth&#x27;
63 ]
64 assert set(expected_keys).issubset(set(model.log_dict.keys()))
65
66 # ----------------- remove pyramid_loss_weight-------------------- #
67 model.feed_data(data)
</pre>
</div>
</div>
</div>
<div id="issue-130">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>69<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>
65
66 # ----------------- remove pyramid_loss_weight-------------------- #
67 model.feed_data(data)
68 model.optimize_parameters(100000) # large than remove_pyramid_loss = 50000
69 assert model.output.shape == (1, 3, 512, 512)
70 assert isinstance(model.log_dict, dict)
71 # check returned keys
72 expected_keys = [
</pre>
</div>
</div>
</div>
<div id="issue-131">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.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 # ----------------- remove pyramid_loss_weight-------------------- #
67 model.feed_data(data)
68 model.optimize_parameters(100000) # large than remove_pyramid_loss = 50000
69 assert model.output.shape == (1, 3, 512, 512)
70 assert isinstance(model.log_dict, dict)
71 # check returned keys
72 expected_keys = [
73 &#x27;l_g_pix&#x27;, &#x27;l_g_percep&#x27;, &#x27;l_g_style&#x27;, &#x27;l_g_gan&#x27;, &#x27;l_g_gan_left_eye&#x27;, &#x27;l_g_gan_right_eye&#x27;, &#x27;l_g_gan_mouth&#x27;,
</pre>
</div>
</div>
</div>
<div id="issue-132">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>77<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>
73 &#x27;l_g_pix&#x27;, &#x27;l_g_percep&#x27;, &#x27;l_g_style&#x27;, &#x27;l_g_gan&#x27;, &#x27;l_g_gan_left_eye&#x27;, &#x27;l_g_gan_right_eye&#x27;, &#x27;l_g_gan_mouth&#x27;,
74 &#x27;l_g_comp_style_loss&#x27;, &#x27;l_identity&#x27;, &#x27;l_d&#x27;, &#x27;real_score&#x27;, &#x27;fake_score&#x27;, &#x27;l_d_r1&#x27;, &#x27;l_d_left_eye&#x27;,
75 &#x27;l_d_right_eye&#x27;, &#x27;l_d_mouth&#x27;
76 ]
77 assert set(expected_keys).issubset(set(model.log_dict.keys()))
78
79 # ----------------- test save -------------------- #
80 with tempfile.TemporaryDirectory() as tmpdir:
</pre>
</div>
</div>
</div>
<div id="issue-133">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>87<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>
83 model.save(0, 1)
84
85 # ----------------- test the test function -------------------- #
86 model.test()
87 assert model.output.shape == (1, 3, 512, 512)
88 # delete net_g_ema
89 model.__delattr__(&#x27;net_g_ema&#x27;)
90 model.test()
</pre>
</div>
</div>
</div>
<div id="issue-134">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>91<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>
87 assert model.output.shape == (1, 3, 512, 512)
88 # delete net_g_ema
89 model.__delattr__(&#x27;net_g_ema&#x27;)
90 model.test()
91 assert model.output.shape == (1, 3, 512, 512)
92 assert model.net_g.training is True # should back to training mode after testing
93
94 # ----------------- test nondist_validation -------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-135">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>92<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>
88 # delete net_g_ema
89 model.__delattr__(&#x27;net_g_ema&#x27;)
90 model.test()
91 assert model.output.shape == (1, 3, 512, 512)
92 assert model.net_g.training is True # should back to training mode after testing
93
94 # ----------------- test nondist_validation -------------------- #
95 # construct dataloader
</pre>
</div>
</div>
</div>
<div id="issue-136">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>105<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>
101 scale=4,
102 phase=&#x27;val&#x27;)
103 dataset = PairedImageDataset(dataset_opt)
104 dataloader = torch.utils.data.DataLoader(dataset=dataset, batch_size=1, shuffle=False, num_workers=0)
105 assert model.is_train is True
106 with tempfile.TemporaryDirectory() as tmpdir:
107 model.opt[&#x27;path&#x27;][&#x27;visualization&#x27;] = tmpdir
108 model.nondist_validation(dataloader, 1, None, save_img=True)
</pre>
</div>
</div>
</div>
<div id="issue-137">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>109<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>
105 assert model.is_train is True
106 with tempfile.TemporaryDirectory() as tmpdir:
107 model.opt[&#x27;path&#x27;][&#x27;visualization&#x27;] = tmpdir
108 model.nondist_validation(dataloader, 1, None, save_img=True)
109 assert model.is_train is True
110 # check metric_results
111 assert &#x27;psnr&#x27; in model.metric_results
112 assert isinstance(model.metric_results[&#x27;psnr&#x27;], float)
</pre>
</div>
</div>
</div>
<div id="issue-138">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>111<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>
107 model.opt[&#x27;path&#x27;][&#x27;visualization&#x27;] = tmpdir
108 model.nondist_validation(dataloader, 1, None, save_img=True)
109 assert model.is_train is True
110 # check metric_results
111 assert &#x27;psnr&#x27; in model.metric_results
112 assert isinstance(model.metric_results[&#x27;psnr&#x27;], float)
113
114 # validation
</pre>
</div>
</div>
</div>
<div id="issue-139">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>112<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>
108 model.nondist_validation(dataloader, 1, None, save_img=True)
109 assert model.is_train is True
110 # check metric_results
111 assert &#x27;psnr&#x27; in model.metric_results
112 assert isinstance(model.metric_results[&#x27;psnr&#x27;], float)
113
114 # validation
115 with tempfile.TemporaryDirectory() as tmpdir:
</pre>
</div>
</div>
</div>
<div id="issue-140">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>122<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>
118 model.opt[&#x27;path&#x27;][&#x27;visualization&#x27;] = tmpdir
119 model.opt[&#x27;val&#x27;][&#x27;pbar&#x27;] = True
120 model.nondist_validation(dataloader, 1, None, save_img=True)
121 # check metric_results
122 assert &#x27;psnr&#x27; in model.metric_results
123 assert isinstance(model.metric_results[&#x27;psnr&#x27;], float)
124
125 # if opt[&#x27;val&#x27;][&#x27;suffix&#x27;] is None
</pre>
</div>
</div>
</div>
<div id="issue-141">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>123<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>
119 model.opt[&#x27;val&#x27;][&#x27;pbar&#x27;] = True
120 model.nondist_validation(dataloader, 1, None, save_img=True)
121 # check metric_results
122 assert &#x27;psnr&#x27; in model.metric_results
123 assert isinstance(model.metric_results[&#x27;psnr&#x27;], float)
124
125 # if opt[&#x27;val&#x27;][&#x27;suffix&#x27;] is None
126 model.opt[&#x27;val&#x27;][&#x27;suffix&#x27;] = None
</pre>
</div>
</div>
</div>
<div id="issue-142">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.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 model.opt[&#x27;name&#x27;] = &#x27;demo&#x27;
128 model.opt[&#x27;path&#x27;][&#x27;visualization&#x27;] = tmpdir
129 model.nondist_validation(dataloader, 1, None, save_img=True)
130 # check metric_results
131 assert &#x27;psnr&#x27; in model.metric_results
132 assert isinstance(model.metric_results[&#x27;psnr&#x27;], float)
</pre>
</div>
</div>
</div>
<div id="issue-143">
<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/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_gfpgan_model.py</a><br>
<b>Line number: </b>132<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>
128 model.opt[&#x27;path&#x27;][&#x27;visualization&#x27;] = tmpdir
129 model.nondist_validation(dataloader, 1, None, save_img=True)
130 # check metric_results
131 assert &#x27;psnr&#x27; in model.metric_results
132 assert isinstance(model.metric_results[&#x27;psnr&#x27;], float)
</pre>
</div>
</div>
</div>
<div id="issue-144">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>15<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>
11 net = StyleGAN2GeneratorClean(
12 out_size=32, num_style_feat=512, num_mlp=8, channel_multiplier=1, narrow=0.5).cuda().eval()
13 style = torch.rand((1, 512), dtype=torch.float32).cuda()
14 output = net([style], input_is_latent=False)
15 assert output[0].shape == (1, 3, 32, 32)
16 assert output[1] is None
17
18 # -------------------- with return_latents ----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-145">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>16<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>
12 out_size=32, num_style_feat=512, num_mlp=8, channel_multiplier=1, narrow=0.5).cuda().eval()
13 style = torch.rand((1, 512), dtype=torch.float32).cuda()
14 output = net([style], input_is_latent=False)
15 assert output[0].shape == (1, 3, 32, 32)
16 assert output[1] is None
17
18 # -------------------- with return_latents ----------------------- #
19 output = net([style], input_is_latent=True, return_latents=True)
</pre>
</div>
</div>
</div>
<div id="issue-146">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>20<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>
16 assert output[1] is None
17
18 # -------------------- with return_latents ----------------------- #
19 output = net([style], input_is_latent=True, return_latents=True)
20 assert output[0].shape == (1, 3, 32, 32)
21 assert len(output[1]) == 1
22 # check latent
23 assert output[1][0].shape == (8, 512)
</pre>
</div>
</div>
</div>
<div id="issue-147">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>21<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>
17
18 # -------------------- with return_latents ----------------------- #
19 output = net([style], input_is_latent=True, return_latents=True)
20 assert output[0].shape == (1, 3, 32, 32)
21 assert len(output[1]) == 1
22 # check latent
23 assert output[1][0].shape == (8, 512)
24
</pre>
</div>
</div>
</div>
<div id="issue-148">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>23<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>
19 output = net([style], input_is_latent=True, return_latents=True)
20 assert output[0].shape == (1, 3, 32, 32)
21 assert len(output[1]) == 1
22 # check latent
23 assert output[1][0].shape == (8, 512)
24
25 # -------------------- with randomize_noise = False ----------------------- #
26 output = net([style], randomize_noise=False)
</pre>
</div>
</div>
</div>
<div id="issue-149">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>27<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>
23 assert output[1][0].shape == (8, 512)
24
25 # -------------------- with randomize_noise = False ----------------------- #
26 output = net([style], randomize_noise=False)
27 assert output[0].shape == (1, 3, 32, 32)
28 assert output[1] is None
29
30 # -------------------- with truncation = 0.5 and mixing----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-150">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>28<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>
24
25 # -------------------- with randomize_noise = False ----------------------- #
26 output = net([style], randomize_noise=False)
27 assert output[0].shape == (1, 3, 32, 32)
28 assert output[1] is None
29
30 # -------------------- with truncation = 0.5 and mixing----------------------- #
31 output = net([style, style], truncation=0.5, truncation_latent=style)
</pre>
</div>
</div>
</div>
<div id="issue-151">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>32<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>
28 assert output[1] is None
29
30 # -------------------- with truncation = 0.5 and mixing----------------------- #
31 output = net([style, style], truncation=0.5, truncation_latent=style)
32 assert output[0].shape == (1, 3, 32, 32)
33 assert output[1] is None
34
35 # ------------------ test make_noise ----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-152">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>33<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>
29
30 # -------------------- with truncation = 0.5 and mixing----------------------- #
31 output = net([style, style], truncation=0.5, truncation_latent=style)
32 assert output[0].shape == (1, 3, 32, 32)
33 assert output[1] is None
34
35 # ------------------ test make_noise ----------------------- #
36 out = net.make_noise()
</pre>
</div>
</div>
</div>
<div id="issue-153">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>37<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>
33 assert output[1] is None
34
35 # ------------------ test make_noise ----------------------- #
36 out = net.make_noise()
37 assert len(out) == 7
38 assert out[0].shape == (1, 1, 4, 4)
39 assert out[1].shape == (1, 1, 8, 8)
40 assert out[2].shape == (1, 1, 8, 8)
</pre>
</div>
</div>
</div>
<div id="issue-154">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>38<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>
34
35 # ------------------ test make_noise ----------------------- #
36 out = net.make_noise()
37 assert len(out) == 7
38 assert out[0].shape == (1, 1, 4, 4)
39 assert out[1].shape == (1, 1, 8, 8)
40 assert out[2].shape == (1, 1, 8, 8)
41 assert out[3].shape == (1, 1, 16, 16)
</pre>
</div>
</div>
</div>
<div id="issue-155">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>39<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>
35 # ------------------ test make_noise ----------------------- #
36 out = net.make_noise()
37 assert len(out) == 7
38 assert out[0].shape == (1, 1, 4, 4)
39 assert out[1].shape == (1, 1, 8, 8)
40 assert out[2].shape == (1, 1, 8, 8)
41 assert out[3].shape == (1, 1, 16, 16)
42 assert out[4].shape == (1, 1, 16, 16)
</pre>
</div>
</div>
</div>
<div id="issue-156">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>40<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>
36 out = net.make_noise()
37 assert len(out) == 7
38 assert out[0].shape == (1, 1, 4, 4)
39 assert out[1].shape == (1, 1, 8, 8)
40 assert out[2].shape == (1, 1, 8, 8)
41 assert out[3].shape == (1, 1, 16, 16)
42 assert out[4].shape == (1, 1, 16, 16)
43 assert out[5].shape == (1, 1, 32, 32)
</pre>
</div>
</div>
</div>
<div id="issue-157">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>41<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>
37 assert len(out) == 7
38 assert out[0].shape == (1, 1, 4, 4)
39 assert out[1].shape == (1, 1, 8, 8)
40 assert out[2].shape == (1, 1, 8, 8)
41 assert out[3].shape == (1, 1, 16, 16)
42 assert out[4].shape == (1, 1, 16, 16)
43 assert out[5].shape == (1, 1, 32, 32)
44 assert out[6].shape == (1, 1, 32, 32)
</pre>
</div>
</div>
</div>
<div id="issue-158">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>42<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>
38 assert out[0].shape == (1, 1, 4, 4)
39 assert out[1].shape == (1, 1, 8, 8)
40 assert out[2].shape == (1, 1, 8, 8)
41 assert out[3].shape == (1, 1, 16, 16)
42 assert out[4].shape == (1, 1, 16, 16)
43 assert out[5].shape == (1, 1, 32, 32)
44 assert out[6].shape == (1, 1, 32, 32)
45
</pre>
</div>
</div>
</div>
<div id="issue-159">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>43<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>
39 assert out[1].shape == (1, 1, 8, 8)
40 assert out[2].shape == (1, 1, 8, 8)
41 assert out[3].shape == (1, 1, 16, 16)
42 assert out[4].shape == (1, 1, 16, 16)
43 assert out[5].shape == (1, 1, 32, 32)
44 assert out[6].shape == (1, 1, 32, 32)
45
46 # ------------------ test get_latent ----------------------- #
</pre>
</div>
</div>
</div>
<div id="issue-160">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>44<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>
40 assert out[2].shape == (1, 1, 8, 8)
41 assert out[3].shape == (1, 1, 16, 16)
42 assert out[4].shape == (1, 1, 16, 16)
43 assert out[5].shape == (1, 1, 32, 32)
44 assert out[6].shape == (1, 1, 32, 32)
45
46 # ------------------ test get_latent ----------------------- #
47 out = net.get_latent(style)
</pre>
</div>
</div>
</div>
<div id="issue-161">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>48<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>
44 assert out[6].shape == (1, 1, 32, 32)
45
46 # ------------------ test get_latent ----------------------- #
47 out = net.get_latent(style)
48 assert out.shape == (1, 512)
49
50 # ------------------ test mean_latent ----------------------- #
51 out = net.mean_latent(2)
</pre>
</div>
</div>
</div>
<div id="issue-162">
<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/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_stylegan2_clean_arch.py</a><br>
<b>Line number: </b>52<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>
48 assert out.shape == (1, 512)
49
50 # ------------------ test mean_latent ----------------------- #
51 out = net.mean_latent(2)
52 assert out.shape == (1, 512)
</pre>
</div>
</div>
</div>
<div id="issue-163">
<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/comfy_mtb/extern/GFPGAN/tests/test_utils.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_utils.py</a><br>
<b>Line number: </b>18<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>
14 arch=&#x27;clean&#x27;,
15 channel_multiplier=2,
16 bg_upsampler=None)
17 # test attribute
18 assert isinstance(restorer.gfpgan, GFPGANv1Clean)
19 assert isinstance(restorer.face_helper, FaceRestoreHelper)
20
21 # initialize with the original model
</pre>
</div>
</div>
</div>
<div id="issue-164">
<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/comfy_mtb/extern/GFPGAN/tests/test_utils.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_utils.py</a><br>
<b>Line number: </b>19<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>
15 channel_multiplier=2,
16 bg_upsampler=None)
17 # test attribute
18 assert isinstance(restorer.gfpgan, GFPGANv1Clean)
19 assert isinstance(restorer.face_helper, FaceRestoreHelper)
20
21 # initialize with the original model
22 restorer = GFPGANer(
</pre>
</div>
</div>
</div>
<div id="issue-165">
<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/comfy_mtb/extern/GFPGAN/tests/test_utils.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_utils.py</a><br>
<b>Line number: </b>29<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>
25 arch=&#x27;original&#x27;,
26 channel_multiplier=1,
27 bg_upsampler=None)
28 # test attribute
29 assert isinstance(restorer.gfpgan, GFPGANv1)
30 assert isinstance(restorer.face_helper, FaceRestoreHelper)
31
32 # ------------------ test enhance ---------------- #
</pre>
</div>
</div>
</div>
<div id="issue-166">
<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/comfy_mtb/extern/GFPGAN/tests/test_utils.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_utils.py</a><br>
<b>Line number: </b>30<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>
26 channel_multiplier=1,
27 bg_upsampler=None)
28 # test attribute
29 assert isinstance(restorer.gfpgan, GFPGANv1)
30 assert isinstance(restorer.face_helper, FaceRestoreHelper)
31
32 # ------------------ test enhance ---------------- #
33 img = cv2.imread(&#x27;tests/data/gt/00000000.png&#x27;, cv2.IMREAD_COLOR)
</pre>
</div>
</div>
</div>
<div id="issue-167">
<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/comfy_mtb/extern/GFPGAN/tests/test_utils.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_utils.py</a><br>
<b>Line number: </b>35<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>
31
32 # ------------------ test enhance ---------------- #
33 img = cv2.imread(&#x27;tests/data/gt/00000000.png&#x27;, cv2.IMREAD_COLOR)
34 result = restorer.enhance(img, has_aligned=False, paste_back=True)
35 assert result[0][0].shape == (512, 512, 3)
36 assert result[1][0].shape == (512, 512, 3)
37 assert result[2].shape == (1024, 1024, 3)
38
</pre>
</div>
</div>
</div>
<div id="issue-168">
<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/comfy_mtb/extern/GFPGAN/tests/test_utils.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_utils.py</a><br>
<b>Line number: </b>36<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>
32 # ------------------ test enhance ---------------- #
33 img = cv2.imread(&#x27;tests/data/gt/00000000.png&#x27;, cv2.IMREAD_COLOR)
34 result = restorer.enhance(img, has_aligned=False, paste_back=True)
35 assert result[0][0].shape == (512, 512, 3)
36 assert result[1][0].shape == (512, 512, 3)
37 assert result[2].shape == (1024, 1024, 3)
38
39 # with has_aligned=True
</pre>
</div>
</div>
</div>
<div id="issue-169">
<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/comfy_mtb/extern/GFPGAN/tests/test_utils.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_utils.py</a><br>
<b>Line number: </b>37<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>
33 img = cv2.imread(&#x27;tests/data/gt/00000000.png&#x27;, cv2.IMREAD_COLOR)
34 result = restorer.enhance(img, has_aligned=False, paste_back=True)
35 assert result[0][0].shape == (512, 512, 3)
36 assert result[1][0].shape == (512, 512, 3)
37 assert result[2].shape == (1024, 1024, 3)
38
39 # with has_aligned=True
40 result = restorer.enhance(img, has_aligned=True, paste_back=False)
</pre>
</div>
</div>
</div>
<div id="issue-170">
<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/comfy_mtb/extern/GFPGAN/tests/test_utils.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_utils.py</a><br>
<b>Line number: </b>41<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>
37 assert result[2].shape == (1024, 1024, 3)
38
39 # with has_aligned=True
40 result = restorer.enhance(img, has_aligned=True, paste_back=False)
41 assert result[0][0].shape == (512, 512, 3)
42 assert result[1][0].shape == (512, 512, 3)
43 assert result[2] is None
</pre>
</div>
</div>
</div>
<div id="issue-171">
<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/comfy_mtb/extern/GFPGAN/tests/test_utils.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_utils.py</a><br>
<b>Line number: </b>42<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>
38
39 # with has_aligned=True
40 result = restorer.enhance(img, has_aligned=True, paste_back=False)
41 assert result[0][0].shape == (512, 512, 3)
42 assert result[1][0].shape == (512, 512, 3)
43 assert result[2] is None
</pre>
</div>
</div>
</div>
<div id="issue-172">
<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/comfy_mtb/extern/GFPGAN/tests/test_utils.py" target="_blank">/custom_nodes/comfy_mtb/extern/GFPGAN/tests/test_utils.py</a><br>
<b>Line number: </b>43<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>
39 # with has_aligned=True
40 result = restorer.enhance(img, has_aligned=True, paste_back=False)
41 assert result[0][0].shape == (512, 512, 3)
42 assert result[1][0].shape == (512, 512, 3)
43 assert result[2] is None
</pre>
</div>
</div>
</div>
<div id="issue-173">
<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/comfy_mtb/extern/frame_interpolation/eval/interpolator.py" target="_blank">/custom_nodes/comfy_mtb/extern/frame_interpolation/eval/interpolator.py</a><br>
<b>Line number: </b>43<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>
39 2) A bounding box that can be fed readily to tf.image.crop_to_bounding_box
40 to undo the padding.
41 &quot;&quot;&quot;
42 # Input checking.
43 assert np.ndim(x) == 4
44 assert align &gt; 0, &#x27;align must be a positive number.&#x27;
45
46 height, width = x.shape[-3:-1]
</pre>
</div>
</div>
</div>
<div id="issue-174">
<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/comfy_mtb/extern/frame_interpolation/eval/interpolator.py" target="_blank">/custom_nodes/comfy_mtb/extern/frame_interpolation/eval/interpolator.py</a><br>
<b>Line number: </b>44<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>
40 to undo the padding.
41 &quot;&quot;&quot;
42 # Input checking.
43 assert np.ndim(x) == 4
44 assert align &gt; 0, &#x27;align must be a positive number.&#x27;
45
46 height, width = x.shape[-3:-1]
47 height_to_pad = (align - height % align) if height % align != 0 else 0
</pre>
</div>
</div>
</div>
<div id="issue-175">
<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/comfy_mtb/extern/frame_interpolation/eval/interpolator.py" target="_blank">/custom_nodes/comfy_mtb/extern/frame_interpolation/eval/interpolator.py</a><br>
<b>Line number: </b>84<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>
80
81 height, width, channel = image.shape[-3:]
82 patch_height, patch_width = height//block_height, width//block_width
83
84 assert height == (
85 patch_height * block_height
86 ), &#x27;block_height=%d should evenly divide height=%d.&#x27;%(block_height, height)
87 assert width == (
88 patch_width * block_width
89 ), &#x27;block_width=%d should evenly divide width=%d.&#x27;%(block_width, width)
</pre>
</div>
</div>
</div>
<div id="issue-176">
<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/comfy_mtb/extern/frame_interpolation/eval/interpolator.py" target="_blank">/custom_nodes/comfy_mtb/extern/frame_interpolation/eval/interpolator.py</a><br>
<b>Line number: </b>87<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>
83
84 assert height == (
85 patch_height * block_height
86 ), &#x27;block_height=%d should evenly divide height=%d.&#x27;%(block_height, height)
87 assert width == (
88 patch_width * block_width
89 ), &#x27;block_width=%d should evenly divide width=%d.&#x27;%(block_width, width)
90
91 patch_size = patch_height * patch_width
92 paddings = 2*[[0, 0]]
</pre>
</div>
</div>
</div>
<div id="issue-177">
<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/comfy_mtb/extern/frame_interpolation/predict.py" target="_blank">/custom_nodes/comfy_mtb/extern/frame_interpolation/predict.py</a><br>
<b>Line number: </b>46<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>
42 &quot;(2^times_to_interpolate + 1) frames, fps of 30.&quot;,
43 )
44 def predict(self, frame1, frame2, times_to_interpolate):
45 INPUT_EXT = [&#x27;.png&#x27;, &#x27;.jpg&#x27;, &#x27;.jpeg&#x27;]
46 assert os.path.splitext(str(frame1))[-1] in INPUT_EXT and os.path.splitext(str(frame2))[-1] in INPUT_EXT, \
47 &quot;Please provide png, jpg or jpeg images.&quot;
48
49 # make sure 2 images are the same size
50 img1 = Image.open(str(frame1))
</pre>
</div>
</div>
</div>
<div id="issue-178">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Consider possible security implications associated with the subprocess module.<br>
<b>Test ID:</b> B404<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/install.py" target="_blank">/custom_nodes/comfy_mtb/install.py</a><br>
<b>Line number: </b>7<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess</a><br>
<div class="code">
<pre>
3 import os
4 import platform
5 import shlex
6 import stat
7 import subprocess
8 import sys
9 from contextlib import contextmanager
10 from importlib import import_module
</pre>
</div>
</div>
</div>
<div id="issue-179">
<div class="issue-block issue-sev-high">
<b>subprocess_popen_with_shell_equals_true: </b> subprocess call with shell=True identified, security issue.<br>
<b>Test ID:</b> B602<br>
<b>Severity: </b>HIGH<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/install.py" target="_blank">/custom_nodes/comfy_mtb/install.py</a><br>
<b>Line number: </b>180<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b602_subprocess_popen_with_shell_equals_true.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b602_subprocess_popen_with_shell_equals_true.html</a><br>
<div class="code">
<pre>
176 shell_cmd,
177 stdout=subprocess.PIPE,
178 stderr=subprocess.PIPE,
179 text=True,
180 shell=True,
181 check=True,
182 )
183
184 stdout_lines = result.stdout.strip().split(&quot;\n&quot;)
185 stderr_lines = result.stderr.strip().split(&quot;\n&quot;)
186
187 # Print stdout, skipping ignored lines
188 for line in stdout_lines:
189 if not any(line.startswith(ign) for ign in ignored_lines_start):
190 print(line)
</pre>
</div>
</div>
</div>
<div id="issue-180">
<div class="issue-block issue-sev-medium">
<b>request_without_timeout: </b> Requests call without timeout<br>
<b>Test ID:</b> B113<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>LOW<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/400.html" target="_blank">CWE-400</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/install.py" target="_blank">/custom_nodes/comfy_mtb/install.py</a><br>
<b>Line number: </b>256<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html</a><br>
<div class="code">
<pre>
252 return None
253
254
255 def download_file(url, file_name):
256 with requests.get(url, stream=True) as response:
257 response.raise_for_status()
258 total_size = int(response.headers.get(&quot;content-length&quot;, 0))
259 with open(file_name, &quot;wb&quot;) as file, tqdm(
</pre>
</div>
</div>
</div>
<div id="issue-181">
<div class="issue-block issue-sev-medium">
<b>request_without_timeout: </b> Requests call without timeout<br>
<b>Test ID:</b> B113<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>LOW<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/400.html" target="_blank">CWE-400</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/install.py" target="_blank">/custom_nodes/comfy_mtb/install.py</a><br>
<b>Line number: </b>336<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html</a><br>
<div class="code">
<pre>
332 else:
333 tag_url = (
334 f&quot;https://api.github.com/repos/{repo_owner}/{repo_name}/releases/latest&quot;
335 )
336 response = requests.get(tag_url)
337 if response.status_code == 404:
338 # print_formatted(
339 # f&quot;Tag version &#x27;{apply_color(version,&#x27;cyan&#x27;)}&#x27; not found for {owner}/{repo} repository.&quot;
</pre>
</div>
</div>
</div>
<div id="issue-182">
<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/comfy_mtb/nodes/deep_bump.py" target="_blank">/custom_nodes/comfy_mtb/nodes/deep_bump.py</a><br>
<b>Line number: </b>122<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>
118 &quot;&quot;&quot;
119 # Input kernel length must be odd
120 k_l = len(kernel_1d)
121
122 assert k_l % 2 != 0
123 # Convolution is repeat-padded
124 extended = np.pad(array, k_l // 2, mode=&quot;wrap&quot;)
125 # Output has same size as input (padded, valid-mode convolution)
</pre>
</div>
</div>
</div>
<div id="issue-183">
<div class="issue-block issue-sev-medium">
<b>request_without_timeout: </b> Requests call without timeout<br>
<b>Test ID:</b> B113<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>LOW<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/400.html" target="_blank">CWE-400</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/nodes/generate.py" target="_blank">/custom_nodes/comfy_mtb/nodes/generate.py</a><br>
<b>Line number: </b>101<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html</a><br>
<div class="code">
<pre>
97 else:
98 base_url += f&quot;?&amp;{random_seed}&quot;
99 try:
100 log.debug(f&quot;Getting unsplash image from {base_url}&quot;)
101 response = requests.get(base_url)
102 response.raise_for_status()
103
104 image = Image.open(io.BytesIO(response.content))
</pre>
</div>
</div>
</div>
<div id="issue-184">
<div class="issue-block issue-sev-medium">
<b>blacklist: </b> Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.<br>
<b>Test ID:</b> B310<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/22.html" target="_blank">CWE-22</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/nodes/graph_utils.py" target="_blank">/custom_nodes/comfy_mtb/nodes/graph_utils.py</a><br>
<b>Line number: </b>36<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b310-urllib-urlopen" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b310-urllib-urlopen</a><br>
<div class="code">
<pre>
32
33 url_values = urllib.parse.urlencode(data)
34 url = f&quot;http://{base_url}:{port}/view?{url_values}&quot;
35 log.debug(f&quot;Fetching image from {url}&quot;)
36 with urllib.request.urlopen(url) as response:
37 return io.BytesIO(response.read())
38
39
</pre>
</div>
</div>
</div>
<div id="issue-185">
<div class="issue-block issue-sev-medium">
<b>blacklist: </b> Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.<br>
<b>Test ID:</b> B310<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/22.html" target="_blank">CWE-22</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/nodes/graph_utils.py" target="_blank">/custom_nodes/comfy_mtb/nodes/graph_utils.py</a><br>
<b>Line number: </b>372<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b310-urllib-urlopen" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b310-urllib-urlopen</a><br>
<div class="code">
<pre>
368
369 history_url = f&quot;http://{base_url}:{port}/history&quot;
370 log.debug(f&quot;Fetching history from {history_url}&quot;)
371 output = torch.zeros(0)
372 with urllib.request.urlopen(history_url) as response:
373 output = self.load_batch_frames(response, offset, count, frames)
374
375 if output.size(0) == 0:
</pre>
</div>
</div>
</div>
<div id="issue-186">
<div class="issue-block issue-sev-medium">
<b>blacklist: </b> Use of possibly insecure function - consider using safer ast.literal_eval.<br>
<b>Test ID:</b> B307<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/nodes/graph_utils.py" target="_blank">/custom_nodes/comfy_mtb/nodes/graph_utils.py</a><br>
<b>Line number: </b>515<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b307-eval" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b307-eval</a><br>
<div class="code">
<pre>
511
512 except ValueError:
513 try:
514 expression = expression.replace(&quot;^&quot;, &quot;**&quot;)
515 result = eval(expression)
516 except Exception as e:
517 # Handle any other exceptions and provide a meaningful error message
518 raise ValueError(
</pre>
</div>
</div>
</div>
<div id="issue-187">
<div class="issue-block issue-sev-medium">
<b>request_without_timeout: </b> Requests call without timeout<br>
<b>Test ID:</b> B113<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>LOW<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/400.html" target="_blank">CWE-400</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/nodes/image_processing.py" target="_blank">/custom_nodes/comfy_mtb/nodes/image_processing.py</a><br>
<b>Line number: </b>295<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html</a><br>
<div class="code">
<pre>
291 CATEGORY = &quot;mtb/IO&quot;
292
293 def load(self, url):
294 # get the image from the url
295 image = Image.open(requests.get(url, stream=True).raw)
296 image = ImageOps.exif_transpose(image)
297 return (pil2tensor(image),)
298
</pre>
</div>
</div>
</div>
<div id="issue-188">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Consider possible security implications associated with the subprocess module.<br>
<b>Test ID:</b> B404<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/nodes/io.py" target="_blank">/custom_nodes/comfy_mtb/nodes/io.py</a><br>
<b>Line number: </b>2<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess</a><br>
<div class="code">
<pre>
1 import json
2 import subprocess
3 import uuid
4 from pathlib import Path
5 from typing import List, Optional
6
7 import comfy.model_management as model_management
8 import folder_paths
</pre>
</div>
</div>
</div>
<div id="issue-189">
<div class="issue-block issue-sev-low">
<b>subprocess_without_shell_equals_true: </b> subprocess call - check for execution of untrusted input.<br>
<b>Test ID:</b> B603<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/nodes/io.py" target="_blank">/custom_nodes/comfy_mtb/nodes/io.py</a><br>
<b>Line number: </b>197<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html</a><br>
<div class="code">
<pre>
193 &quot;-y&quot;,
194 out_path,
195 ]
196 log.debug(f&quot;Executing {command}&quot;)
197 subprocess.run(command)
198
199 temp_playlist_path.unlink()
200
</pre>
</div>
</div>
</div>
<div id="issue-190">
<div class="issue-block issue-sev-low">
<b>subprocess_without_shell_equals_true: </b> subprocess call - check for execution of untrusted input.<br>
<b>Test ID:</b> B603<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/nodes/io.py" target="_blank">/custom_nodes/comfy_mtb/nodes/io.py</a><br>
<b>Line number: </b>229<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html</a><br>
<div class="code">
<pre>
225 &quot;gif&quot;,
226 &quot;-y&quot;,
227 out_path,
228 ]
229 process = subprocess.Popen(command, stdin=subprocess.PIPE)
230 for frame in frames:
231 model_management.throw_exception_if_processing_interrupted()
232 Image.fromarray(frame).save(process.stdin, &quot;PNG&quot;)
</pre>
</div>
</div>
</div>
<div id="issue-191">
<div class="issue-block issue-sev-low">
<b>subprocess_without_shell_equals_true: </b> subprocess call - check for execution of untrusted input.<br>
<b>Test ID:</b> B603<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/nodes/io.py" target="_blank">/custom_nodes/comfy_mtb/nodes/io.py</a><br>
<b>Line number: </b>267<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html</a><br>
<div class="code">
<pre>
263 &quot;-y&quot;,
264 out_path,
265 ]
266
267 process = subprocess.Popen(command, stdin=subprocess.PIPE)
268
269 for frame in frames:
270 model_management.throw_exception_if_processing_interrupted()
</pre>
</div>
</div>
</div>
<div id="issue-192">
<div class="issue-block issue-sev-low">
<b>subprocess_without_shell_equals_true: </b> subprocess call - check for execution of untrusted input.<br>
<b>Test ID:</b> B603<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/nodes/io.py" target="_blank">/custom_nodes/comfy_mtb/nodes/io.py</a><br>
<b>Line number: </b>376<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html</a><br>
<div class="code">
<pre>
372 &quot;gif&quot;,
373 &quot;-y&quot;,
374 out_path,
375 ]
376 process = subprocess.Popen(command, stdin=subprocess.PIPE)
377 for image in pil_images:
378 model_management.throw_exception_if_processing_interrupted()
379 image.save(process.stdin, &quot;PNG&quot;)
</pre>
</div>
</div>
</div>
<div id="issue-193">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Consider possible security implications associated with the subprocess module.<br>
<b>Test ID:</b> B404<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/scripts/download_models.py" target="_blank">/custom_nodes/comfy_mtb/scripts/download_models.py</a><br>
<b>Line number: </b>5<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess</a><br>
<div class="code">
<pre>
1 import os
2 import requests
3 from rich.console import Console
4 from tqdm import tqdm
5 import subprocess
6 import sys
7
8 try:
</pre>
</div>
</div>
</div>
<div id="issue-194">
<div class="issue-block issue-sev-low">
<b>subprocess_without_shell_equals_true: </b> subprocess call - check for execution of untrusted input.<br>
<b>Test ID:</b> B603<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/scripts/download_models.py" target="_blank">/custom_nodes/comfy_mtb/scripts/download_models.py</a><br>
<b>Line number: </b>71<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html</a><br>
<div class="code">
<pre>
67 try:
68 import gdown
69 except ImportError:
70 print(&quot;Installing gdown&quot;)
71 subprocess.check_call(
72 [
73 sys.executable,
74 &quot;-m&quot;,
75 &quot;pip&quot;,
76 &quot;install&quot;,
77 &quot;git+https://github.com/melMass/gdown@main&quot;,
78 ]
79 )
80 import gdown
81
82 if &quot;/folders/&quot; in download_url:
</pre>
</div>
</div>
</div>
<div id="issue-195">
<div class="issue-block issue-sev-medium">
<b>request_without_timeout: </b> Requests call without timeout<br>
<b>Test ID:</b> B113<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>LOW<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/400.html" target="_blank">CWE-400</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/scripts/download_models.py" target="_blank">/custom_nodes/comfy_mtb/scripts/download_models.py</a><br>
<b>Line number: </b>94<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html</a><br>
<div class="code">
<pre>
90 # download from google drive
91 gdown.download(download_url, destination, quiet=False, resume=True)
92 return
93
94 response = requests.get(download_url, stream=True)
95 total_size = int(response.headers.get(&quot;content-length&quot;, 0))
96
97 destination_path = os.path.join(destination, filename)
</pre>
</div>
</div>
</div>
<div id="issue-196">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Consider possible security implications associated with the subprocess module.<br>
<b>Test ID:</b> B404<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/scripts/interpolate_frames.py" target="_blank">/custom_nodes/comfy_mtb/scripts/interpolate_frames.py</a><br>
<b>Line number: </b>16<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess</a><br>
<div class="code">
<pre>
12 from rich.console import Console
13 from rich.progress import Progress
14
15 import numpy as np
16 import subprocess
17
18
19 def write_prores_444_video(output_file, frames: List[np.ndarray], fps):
</pre>
</div>
</div>
</div>
<div id="issue-197">
<div class="issue-block issue-sev-low">
<b>subprocess_without_shell_equals_true: </b> subprocess call - check for execution of untrusted input.<br>
<b>Test ID:</b> B603<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/scripts/interpolate_frames.py" target="_blank">/custom_nodes/comfy_mtb/scripts/interpolate_frames.py</a><br>
<b>Line number: </b>53<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b603_subprocess_without_shell_equals_true.html</a><br>
<div class="code">
<pre>
49 &quot;-y&quot;, # Overwrite output file if it already exists
50 output_file,
51 ]
52
53 process = subprocess.Popen(command, stdin=subprocess.PIPE)
54
55 for frame in frames:
56 process.stdin.write(frame.tobytes())
</pre>
</div>
</div>
</div>
<div id="issue-198">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Consider possible security implications associated with the subprocess module.<br>
<b>Test ID:</b> B404<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>9<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_imports.html#b404-import-subprocess</a><br>
<div class="code">
<pre>
5 import os
6 import shlex
7 import shutil
8 import socket
9 import subprocess
10 import sys
11 import uuid
12 from pathlib import Path
</pre>
</div>
</div>
</div>
<div id="issue-199">
<div class="issue-block issue-sev-medium">
<b>request_without_timeout: </b> Requests call without timeout<br>
<b>Test ID:</b> B113<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>LOW<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/400.html" target="_blank">CWE-400</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>187<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b113_request_without_timeout.html</a><br>
<div class="code">
<pre>
183 yield info[4][0]
184
185 def _test_url(self, url):
186 try:
187 response = requests.get(url)
188 return response.status_code == 200
189 except Exception:
190 return False
</pre>
</div>
</div>
</div>
<div id="issue-200">
<div class="issue-block issue-sev-medium">
<b>hardcoded_bind_all_interfaces: </b> Possible binding to all interfaces.<br>
<b>Test ID:</b> B104<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>MEDIUM<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/605.html" target="_blank">CWE-605</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>199<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b104_hardcoded_bind_all_interfaces.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b104_hardcoded_bind_all_interfaces.html</a><br>
<div class="code">
<pre>
195 from comfy.cli_args import args
196
197 ip_checker = IPChecker()
198 base_url = args.listen
199 if base_url == &quot;0.0.0.0&quot;:
200 log.debug(&quot;Server set to 0.0.0.0, we will try to resolve the host IP&quot;)
201 base_url = ip_checker.get_working_ip(
202 f&quot;http://{{}}:{args.port}/history&quot;
</pre>
</div>
</div>
</div>
<div id="issue-201">
<div class="issue-block issue-sev-high">
<b>subprocess_popen_with_shell_equals_true: </b> subprocess call with shell=True identified, security issue.<br>
<b>Test ID:</b> B602<br>
<b>Severity: </b>HIGH<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>300<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b602_subprocess_popen_with_shell_equals_true.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b602_subprocess_popen_with_shell_equals_true.html</a><br>
<div class="code">
<pre>
296 shell_cmd,
297 stdout=subprocess.PIPE,
298 stderr=subprocess.PIPE,
299 text=True,
300 shell=True,
301 check=True,
302 )
303
304 stdout_lines = result.stdout.strip().split(&quot;\n&quot;)
305 stderr_lines = result.stderr.strip().split(&quot;\n&quot;)
306
307 # Print stdout, skipping ignored lines
308 for line in stdout_lines:
309 if not any(line.startswith(ign) for ign in ignored_lines_start):
310 print(line)
</pre>
</div>
</div>
</div>
<div id="issue-202">
<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/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>493<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>
489 np.linspace(1, 0, num=ramp_h)[None], (1, 0)
490 )
491
492 # Assume tiles are squared
493 assert ramp_h == ramp_w
494 # top left corner
495 corner = np.rot90(corner_mask(ramp_h), 2)
496 mask[:ramp_h, :ramp_w] = corner
</pre>
</div>
</div>
</div>
<div id="issue-203">
<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/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>558<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>
554 width = img_size[2] + pad_left + pad_right
555 stride_h, stride_w = stride_size
556
557 # stride must be even
558 assert (stride_h % 2 == 0) and (stride_w % 2 == 0)
559 # stride must be greater or equal than half tile
560 assert (stride_h &gt;= tile_h / 2) and (stride_w &gt;= tile_w / 2)
561 # stride must be smaller or equal tile size
</pre>
</div>
</div>
</div>
<div id="issue-204">
<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/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>560<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>
556
557 # stride must be even
558 assert (stride_h % 2 == 0) and (stride_w % 2 == 0)
559 # stride must be greater or equal than half tile
560 assert (stride_h &gt;= tile_h / 2) and (stride_w &gt;= tile_w / 2)
561 # stride must be smaller or equal tile size
562 assert (stride_h &lt;= tile_h) and (stride_w &lt;= tile_w)
563
</pre>
</div>
</div>
</div>
<div id="issue-205">
<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/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>562<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>
558 assert (stride_h % 2 == 0) and (stride_w % 2 == 0)
559 # stride must be greater or equal than half tile
560 assert (stride_h &gt;= tile_h / 2) and (stride_w &gt;= tile_w / 2)
561 # stride must be smaller or equal tile size
562 assert (stride_h &lt;= tile_h) and (stride_w &lt;= tile_w)
563
564 merged = np.zeros((img_size[0], height, width))
565 mask = generate_mask((tile_h, tile_w), stride_size)
</pre>
</div>
</div>
</div>
<div id="issue-206">
<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/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>591<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>
587 stride_h, stride_w = stride_size
588 img_h, img_w = img.shape[0], img.shape[1]
589
590 # stride must be even
591 assert (stride_h % 2 == 0) and (stride_w % 2 == 0)
592 # stride must be greater or equal than half tile
593 assert (stride_h &gt;= tile_h / 2) and (stride_w &gt;= tile_w / 2)
594 # stride must be smaller or equal tile size
</pre>
</div>
</div>
</div>
<div id="issue-207">
<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/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>593<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>
589
590 # stride must be even
591 assert (stride_h % 2 == 0) and (stride_w % 2 == 0)
592 # stride must be greater or equal than half tile
593 assert (stride_h &gt;= tile_h / 2) and (stride_w &gt;= tile_w / 2)
594 # stride must be smaller or equal tile size
595 assert (stride_h &lt;= tile_h) and (stride_w &lt;= tile_w)
596
</pre>
</div>
</div>
</div>
<div id="issue-208">
<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/comfy_mtb/utils.py" target="_blank">/custom_nodes/comfy_mtb/utils.py</a><br>
<b>Line number: </b>595<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>
591 assert (stride_h % 2 == 0) and (stride_w % 2 == 0)
592 # stride must be greater or equal than half tile
593 assert (stride_h &gt;= tile_h / 2) and (stride_w &gt;= tile_w / 2)
594 # stride must be smaller or equal tile size
595 assert (stride_h &lt;= tile_h) and (stride_w &lt;= tile_w)
596
597 # find total height &amp; width padding sizes
598 pad_h, pad_w = 0, 0
</pre>
</div>
</div>
</div>
</div>
</body>
</html>