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
d7b3b0f8
Commit
d7b3b0f8
authored
Aug 22, 2023
by
comfyanonymous
Browse files
Don't hardcode node names for image upload widget.
parent
afcb9cb1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
nodes.py
nodes.py
+2
-2
web/extensions/core/uploadImage.js
web/extensions/core/uploadImage.js
+2
-1
No files found.
nodes.py
View file @
d7b3b0f8
...
@@ -1306,7 +1306,7 @@ class LoadImage:
...
@@ -1306,7 +1306,7 @@ class LoadImage:
input_dir
=
folder_paths
.
get_input_directory
()
input_dir
=
folder_paths
.
get_input_directory
()
files
=
[
f
for
f
in
os
.
listdir
(
input_dir
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
input_dir
,
f
))]
files
=
[
f
for
f
in
os
.
listdir
(
input_dir
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
input_dir
,
f
))]
return
{
"required"
:
return
{
"required"
:
{
"image"
:
(
sorted
(
files
),
)},
{
"image"
:
(
sorted
(
files
),
{
"image_upload"
:
True
}
)},
}
}
CATEGORY
=
"image"
CATEGORY
=
"image"
...
@@ -1349,7 +1349,7 @@ class LoadImageMask:
...
@@ -1349,7 +1349,7 @@ class LoadImageMask:
input_dir
=
folder_paths
.
get_input_directory
()
input_dir
=
folder_paths
.
get_input_directory
()
files
=
[
f
for
f
in
os
.
listdir
(
input_dir
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
input_dir
,
f
))]
files
=
[
f
for
f
in
os
.
listdir
(
input_dir
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
input_dir
,
f
))]
return
{
"required"
:
return
{
"required"
:
{
"image"
:
(
sorted
(
files
),
),
{
"image"
:
(
sorted
(
files
),
{
"image_upload"
:
True
}
),
"channel"
:
(
s
.
_color_channels
,
),
}
"channel"
:
(
s
.
_color_channels
,
),
}
}
}
...
...
web/extensions/core/uploadImage.js
View file @
d7b3b0f8
...
@@ -5,7 +5,8 @@ import { app } from "../../scripts/app.js";
...
@@ -5,7 +5,8 @@ import { app } from "../../scripts/app.js";
app
.
registerExtension
({
app
.
registerExtension
({
name
:
"
Comfy.UploadImage
"
,
name
:
"
Comfy.UploadImage
"
,
async
beforeRegisterNodeDef
(
nodeType
,
nodeData
,
app
)
{
async
beforeRegisterNodeDef
(
nodeType
,
nodeData
,
app
)
{
if
(
nodeData
.
name
===
"
LoadImage
"
||
nodeData
.
name
===
"
LoadImageMask
"
)
{
console
.
log
(
nodeData
);
if
(
nodeData
?.
input
?.
required
?.
image
?.[
1
]?.
image_upload
===
true
)
{
nodeData
.
input
.
required
.
upload
=
[
"
IMAGEUPLOAD
"
];
nodeData
.
input
.
required
.
upload
=
[
"
IMAGEUPLOAD
"
];
}
}
},
},
...
...
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