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
e020ab61
Commit
e020ab61
authored
Nov 24, 2023
by
comfyanonymous
Browse files
Fix output APNG not working with ffmpeg.
parent
8ad5d494
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
comfy_extras/nodes_images.py
comfy_extras/nodes_images.py
+2
-2
web/scripts/pnginfo.js
web/scripts/pnginfo.js
+1
-1
No files found.
comfy_extras/nodes_images.py
View file @
e020ab61
...
@@ -152,10 +152,10 @@ class SaveAnimatedPNG:
...
@@ -152,10 +152,10 @@ class SaveAnimatedPNG:
if
not
args
.
disable_metadata
:
if
not
args
.
disable_metadata
:
metadata
=
PngInfo
()
metadata
=
PngInfo
()
if
prompt
is
not
None
:
if
prompt
is
not
None
:
metadata
.
add
(
b
"
tEXt
"
,
"prompt"
.
encode
(
"latin-1"
,
"strict"
)
+
b
"
\0
"
+
json
.
dumps
(
prompt
).
encode
(
"latin-1"
,
"strict"
),
after_idat
=
True
)
metadata
.
add
(
b
"
comf
"
,
"prompt"
.
encode
(
"latin-1"
,
"strict"
)
+
b
"
\0
"
+
json
.
dumps
(
prompt
).
encode
(
"latin-1"
,
"strict"
),
after_idat
=
True
)
if
extra_pnginfo
is
not
None
:
if
extra_pnginfo
is
not
None
:
for
x
in
extra_pnginfo
:
for
x
in
extra_pnginfo
:
metadata
.
add
(
b
"
tEXt
"
,
x
.
encode
(
"latin-1"
,
"strict"
)
+
b
"
\0
"
+
json
.
dumps
(
extra_pnginfo
[
x
]).
encode
(
"latin-1"
,
"strict"
),
after_idat
=
True
)
metadata
.
add
(
b
"
comf
"
,
x
.
encode
(
"latin-1"
,
"strict"
)
+
b
"
\0
"
+
json
.
dumps
(
extra_pnginfo
[
x
]).
encode
(
"latin-1"
,
"strict"
),
after_idat
=
True
)
file
=
f
"
{
filename
}
_
{
counter
:
05
}
_.png"
file
=
f
"
{
filename
}
_
{
counter
:
05
}
_.png"
pil_images
[
0
].
save
(
os
.
path
.
join
(
full_output_folder
,
file
),
pnginfo
=
metadata
,
compress_level
=
compress_level
,
save_all
=
True
,
duration
=
int
(
1000.0
/
fps
),
append_images
=
pil_images
[
1
:])
pil_images
[
0
].
save
(
os
.
path
.
join
(
full_output_folder
,
file
),
pnginfo
=
metadata
,
compress_level
=
compress_level
,
save_all
=
True
,
duration
=
int
(
1000.0
/
fps
),
append_images
=
pil_images
[
1
:])
...
...
web/scripts/pnginfo.js
View file @
e020ab61
...
@@ -24,7 +24,7 @@ export function getPngMetadata(file) {
...
@@ -24,7 +24,7 @@ export function getPngMetadata(file) {
const
length
=
dataView
.
getUint32
(
offset
);
const
length
=
dataView
.
getUint32
(
offset
);
// Get the chunk type
// Get the chunk type
const
type
=
String
.
fromCharCode
(...
pngData
.
slice
(
offset
+
4
,
offset
+
8
));
const
type
=
String
.
fromCharCode
(...
pngData
.
slice
(
offset
+
4
,
offset
+
8
));
if
(
type
===
"
tEXt
"
)
{
if
(
type
===
"
tEXt
"
||
type
==
"
comf
"
)
{
// Get the keyword
// Get the keyword
let
keyword_end
=
offset
+
8
;
let
keyword_end
=
offset
+
8
;
while
(
pngData
[
keyword_end
]
!==
0
)
{
while
(
pngData
[
keyword_end
]
!==
0
)
{
...
...
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