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
c2c88526
Commit
c2c88526
authored
Feb 16, 2024
by
comfyanonymous
Browse files
Merge branch 'batch-number-in-filename' of
https://github.com/freakabcd/ComfyUI
parents
aeaeca10
2ccc0be2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
nodes.py
nodes.py
+3
-2
No files found.
nodes.py
View file @
c2c88526
...
@@ -1434,7 +1434,7 @@ class SaveImage:
...
@@ -1434,7 +1434,7 @@ class SaveImage:
filename_prefix
+=
self
.
prefix_append
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
])
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
()
results
=
list
()
for
image
in
images
:
for
(
batch_number
,
image
)
in
enumerate
(
images
)
:
i
=
255.
*
image
.
cpu
().
numpy
()
i
=
255.
*
image
.
cpu
().
numpy
()
img
=
Image
.
fromarray
(
np
.
clip
(
i
,
0
,
255
).
astype
(
np
.
uint8
))
img
=
Image
.
fromarray
(
np
.
clip
(
i
,
0
,
255
).
astype
(
np
.
uint8
))
metadata
=
None
metadata
=
None
...
@@ -1446,7 +1446,8 @@ class SaveImage:
...
@@ -1446,7 +1446,8 @@ class SaveImage:
for
x
in
extra_pnginfo
:
for
x
in
extra_pnginfo
:
metadata
.
add_text
(
x
,
json
.
dumps
(
extra_pnginfo
[
x
]))
metadata
.
add_text
(
x
,
json
.
dumps
(
extra_pnginfo
[
x
]))
file
=
f
"
{
filename
}
_
{
counter
:
05
}
_.png"
filename_with_batch_num
=
filename
.
replace
(
"%batch_num%"
,
str
(
batch_number
))
file
=
f
"
{
filename_with_batch_num
}
_
{
counter
:
05
}
_.png"
img
.
save
(
os
.
path
.
join
(
full_output_folder
,
file
),
pnginfo
=
metadata
,
compress_level
=
self
.
compress_level
)
img
.
save
(
os
.
path
.
join
(
full_output_folder
,
file
),
pnginfo
=
metadata
,
compress_level
=
self
.
compress_level
)
results
.
append
({
results
.
append
({
"filename"
:
file
,
"filename"
:
file
,
...
...
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