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
bd2d3e27
Commit
bd2d3e27
authored
Jul 04, 2024
by
comfyanonymous
Browse files
Show comfy_extras warning at the end.
Remove code.
parent
720b1744
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
30 deletions
+13
-30
main.py
main.py
+2
-6
nodes.py
nodes.py
+11
-24
No files found.
main.py
View file @
bd2d3e27
...
...
@@ -81,7 +81,7 @@ import yaml
import
execution
import
server
from
server
import
BinaryEventTypes
from
nodes
import
init_builtin_extra_nodes
,
init_external_custom_
nodes
import
nodes
import
comfy.model_management
def
cuda_malloc_warning
():
...
...
@@ -219,11 +219,7 @@ if __name__ == "__main__":
for
config_path
in
itertools
.
chain
(
*
args
.
extra_model_paths_config
):
load_extra_path_config
(
config_path
)
init_builtin_extra_nodes
()
if
not
args
.
disable_all_custom_nodes
:
init_external_custom_nodes
()
else
:
logging
.
info
(
"Skipping loading of custom nodes"
)
nodes
.
init_extra_nodes
(
init_custom_nodes
=
not
args
.
disable_all_custom_nodes
)
cuda_malloc_warning
()
...
...
nodes.py
View file @
bd2d3e27
...
...
@@ -1888,30 +1888,6 @@ NODE_DISPLAY_NAME_MAPPINGS = {
EXTENSION_WEB_DIRS
=
{}
def
get_module_name
(
module_path
:
str
)
->
str
:
"""
Returns the module name based on the given module path.
Examples:
get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node.py") -> "custom_nodes.my_custom_node"
get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node") -> "custom_nodes.my_custom_node"
get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/") -> "custom_nodes.my_custom_node"
get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/__init__.py") -> "custom_nodes.my_custom_node"
get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/__init__") -> "custom_nodes.my_custom_node"
get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node/__init__/") -> "custom_nodes.my_custom_node"
get_module_name("C:/Users/username/ComfyUI/custom_nodes/my_custom_node.disabled") -> "custom_nodes.my
Args:
module_path (str): The path of the module.
Returns:
str: The module name.
"""
relative_path
=
os
.
path
.
relpath
(
module_path
,
folder_paths
.
base_path
)
if
os
.
path
.
isfile
(
module_path
):
relative_path
=
os
.
path
.
splitext
(
relative_path
)[
0
]
return
relative_path
.
replace
(
os
.
sep
,
'.'
)
def
load_custom_node
(
module_path
,
ignore
=
set
()):
module_name
=
os
.
path
.
basename
(
module_path
)
try
:
...
...
@@ -2039,6 +2015,17 @@ def init_builtin_extra_nodes():
if
not
load_custom_node
(
os
.
path
.
join
(
extras_dir
,
node_file
)):
import_failed
.
append
(
node_file
)
return
import_failed
def
init_extra_nodes
(
init_custom_nodes
=
True
):
import_failed
=
init_external_custom_nodes
()
if
init_custom_nodes
:
init_external_custom_nodes
()
else
:
logging
.
info
(
"Skipping loading of custom nodes"
)
if
len
(
import_failed
)
>
0
:
logging
.
warning
(
"WARNING: some comfy_extras/ nodes did not import correctly. This may be because they are missing some dependencies.
\n
"
)
for
node
in
import_failed
:
...
...
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