Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
1f717903
Commit
1f717903
authored
Mar 11, 2023
by
comfyanonymous
Browse files
Prevent potential int overflow in SaveImage
parent
44294a44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
nodes.py
nodes.py
+1
-1
No files found.
nodes.py
View file @
1f717903
...
@@ -790,7 +790,7 @@ class SaveImage:
...
@@ -790,7 +790,7 @@ class SaveImage:
paths
=
list
()
paths
=
list
()
for
image
in
images
:
for
image
in
images
:
i
=
255.
*
image
.
cpu
().
numpy
()
i
=
255.
*
image
.
cpu
().
numpy
()
img
=
Image
.
fromarray
(
i
.
astype
(
np
.
uint8
))
img
=
Image
.
fromarray
(
np
.
clip
(
i
,
0
,
255
)
.
astype
(
np
.
uint8
))
metadata
=
PngInfo
()
metadata
=
PngInfo
()
if
prompt
is
not
None
:
if
prompt
is
not
None
:
metadata
.
add_text
(
"prompt"
,
json
.
dumps
(
prompt
))
metadata
.
add_text
(
"prompt"
,
json
.
dumps
(
prompt
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment