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
8a35c12e
Commit
8a35c12e
authored
Mar 26, 2023
by
m957ymj75urz
Browse files
compute %width% and %height% in filepath when saving
parent
f5365c9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
nodes.py
nodes.py
+7
-0
No files found.
nodes.py
View file @
8a35c12e
...
@@ -746,6 +746,13 @@ class SaveImage:
...
@@ -746,6 +746,13 @@ class SaveImage:
except
:
except
:
digits
=
0
digits
=
0
return
(
digits
,
prefix
)
return
(
digits
,
prefix
)
def
compute_vars
(
input
):
input
=
input
.
replace
(
"%width%"
,
str
(
images
[
0
].
shape
[
1
]))
input
=
input
.
replace
(
"%height%"
,
str
(
images
[
0
].
shape
[
0
]))
return
input
filename_prefix
=
compute_vars
(
filename_prefix
)
subfolder
=
os
.
path
.
dirname
(
os
.
path
.
normpath
(
filename_prefix
))
subfolder
=
os
.
path
.
dirname
(
os
.
path
.
normpath
(
filename_prefix
))
filename
=
os
.
path
.
basename
(
os
.
path
.
normpath
(
filename_prefix
))
filename
=
os
.
path
.
basename
(
os
.
path
.
normpath
(
filename_prefix
))
...
...
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