Skip to content

Commit cdf7fdd

Browse files
committed
chore: fool that I am for not just using the normal custom-nodes directory...
1 parent d13148c commit cdf7fdd

File tree

5 files changed

+7
-44
lines changed

5 files changed

+7
-44
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"context": "../..",
66
"args": {
77
"USERNAME": "node",
8-
"PYTHON_VERSION": "3.12",
8+
"PYTHON_VERSION": "3.12", // The python version which will be installed in the container
99
"INVOKEAI_ROOT": "/home/node/invokeai",
1010
"INVOKEAI_SRC": "/workspaces/InvokeAI"
1111
}
@@ -33,7 +33,7 @@
3333
// Mount the custom-nodes folder at repo root to allow for easier custom-node development
3434
"type": "bind",
3535
"source": "${localWorkspaceFolder}/.devcontainer/mounts/custom-nodes",
36-
"target": "${containerWorkspaceFolder}/invokeai/app/invocations/custom_nodes/src"
36+
"target": "/home/node/invokeai/nodes"
3737
}
3838
],
3939
"containerEnv": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# ignore any folders within this directory
2-
*/*
2+
*

invokeai/app/invocations/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
import importlib
21
from pathlib import Path
32

4-
# import any devcontainer mounted nodes within 'custom_nodes' as modules (devcontainer mounts them here instead of /invokeai/nodes to avoid confusing development tools like the debugger or pylance or whatever).
5-
importlib.import_module("invokeai.app.invocations.custom_nodes")
6-
73
# add core nodes to __all__
84
python_files = filter(lambda f: not f.name.startswith("_"), Path(__file__).parent.glob("*.py"))
95
__all__ = [f.stem for f in python_files] # type: ignore

invokeai/app/invocations/custom_nodes/__init__.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

invokeai/app/invocations/load_custom_nodes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ def load_custom_nodes(custom_nodes_path: Path, logger: logging.Logger):
2828
target_custom_nodes_readme_path = Path(custom_nodes_path) / "README.md"
2929

3030
# copy our custom nodes README to the custom nodes directory
31-
shutil.copy(source_custom_nodes_readme_path, target_custom_nodes_readme_path)
31+
try:
32+
shutil.copy(source_custom_nodes_readme_path, target_custom_nodes_readme_path)
33+
except Exception as e:
34+
logger.warning(f"Failed to copy custom nodes README file to {custom_nodes_path}: {e}")
3235

3336
loaded_packs: list[str] = []
3437
failed_packs: list[str] = []

0 commit comments

Comments
 (0)