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
f4b93906
"git@developer.sourcefind.cn:chenpangpang/ComfyUI.git" did not exist on "af365e4dd152b23cd6cf993ddf9ed7c7e7088b39"
Commit
f4b93906
authored
Jul 11, 2023
by
comfyanonymous
Browse files
Add a random string to the temp prefix for PreviewImage.
parent
2b2a1474
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
nodes.py
nodes.py
+4
-0
No files found.
nodes.py
View file @
f4b93906
...
...
@@ -7,6 +7,7 @@ import hashlib
import
traceback
import
math
import
time
import
random
from
PIL
import
Image
,
ImageOps
from
PIL.PngImagePlugin
import
PngInfo
...
...
@@ -1116,6 +1117,7 @@ class SaveImage:
def
__init__
(
self
):
self
.
output_dir
=
folder_paths
.
get_output_directory
()
self
.
type
=
"output"
self
.
prefix_append
=
""
@
classmethod
def
INPUT_TYPES
(
s
):
...
...
@@ -1133,6 +1135,7 @@ class SaveImage:
CATEGORY
=
"image"
def
save_images
(
self
,
images
,
filename_prefix
=
"ComfyUI"
,
prompt
=
None
,
extra_pnginfo
=
None
):
filename_prefix
+=
self
.
prefix_append
full_output_folder
,
filename
,
counter
,
subfolder
,
filename_prefix
=
folder_paths
.
get_save_image_path
(
filename_prefix
,
self
.
output_dir
,
images
[
0
].
shape
[
1
],
images
[
0
].
shape
[
0
])
results
=
list
()
for
image
in
images
:
...
...
@@ -1160,6 +1163,7 @@ class PreviewImage(SaveImage):
def
__init__
(
self
):
self
.
output_dir
=
folder_paths
.
get_temp_directory
()
self
.
type
=
"temp"
self
.
prefix_append
=
"_temp_"
+
''
.
join
(
random
.
choice
(
"abcdefghijklmnopqrstupvxyz"
)
for
x
in
range
(
5
))
@
classmethod
def
INPUT_TYPES
(
s
):
...
...
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