-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path__init__.py
More file actions
50 lines (39 loc) · 2.1 KB
/
__init__.py
File metadata and controls
50 lines (39 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import logging
import os
log_level = os.getenv("LOG_LEVEL", "INFO").upper()
logging.basicConfig(
level=getattr(logging, log_level, logging.INFO),
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
logger = logging.getLogger(__name__)
NODE_PACK_NAME = "Stand-In"
logger.info("=" * 40 + f" {NODE_PACK_NAME} " + "=" * 40)
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
try:
from .nodes import FaceProcessorLoader, ApplyFaceProcessor
from .videoinput import VideoInputPreprocessor
from .videocombine import VideoBackgroundRestorer
from .choose_face_only_mode import FaceOnlyModeSwitch
from .cropper import VideoFramePreprocessor
# Map the class names to the classes themselves
NODE_CLASS_MAPPINGS["FaceProcessorLoader"] = FaceProcessorLoader
NODE_CLASS_MAPPINGS["ApplyFaceProcessor"] = ApplyFaceProcessor
NODE_CLASS_MAPPINGS["VideoInputPreprocessor"] = VideoInputPreprocessor
NODE_CLASS_MAPPINGS["VideoBackgroundRestorer"] = VideoBackgroundRestorer
NODE_CLASS_MAPPINGS["FaceOnlyModeSwitch"] = FaceOnlyModeSwitch
NODE_CLASS_MAPPINGS["VideoFramePreprocessor"] = VideoFramePreprocessor
NODE_DISPLAY_NAME_MAPPINGS["FaceProcessorLoader"] = "Stand-In Processor Loader"
NODE_DISPLAY_NAME_MAPPINGS["ApplyFaceProcessor"] = "Apply Stand-In Processor"
NODE_DISPLAY_NAME_MAPPINGS["VideoInputPreprocessor"] = "Stand-In VideoInputPreprocessor"
NODE_DISPLAY_NAME_MAPPINGS["VideoBackgroundRestorer"] = "Stand-In Background Restorer"
NODE_DISPLAY_NAME_MAPPINGS["FaceOnlyModeSwitch"] = "Face Only Mode Switch (Stand-In)"
NODE_DISPLAY_NAME_MAPPINGS["VideoFramePreprocessor"] = "Stand-In Trimmer & Cropper"
logger.info("Successfully loaded all Stand-In nodes.")
except ImportError:
logger.exception(f"Failed to import nodes for {NODE_PACK_NAME}. Please ensure all dependencies are installed.")
except Exception as e:
logger.exception(f"An unexpected error occurred while loading nodes for {NODE_PACK_NAME}: {e}")
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
# --- Footer Banner ---
logger.info("=" * (82 + len(NODE_PACK_NAME)))