Line data Source code
1 2356 : const loraStackFilename = /^loras\.(?:0|[1-9]\d*)\.lora_name$/
2 :
3 : /**
4 : * Default mappings from model directories to loader nodes.
5 : *
6 : * Each entry maps a model folder (as it appears in the model browser)
7 : * to the node class that loads models from that folder and the
8 : * input name or pattern used to select the model widget.
9 : *
10 : * An empty key ('') means the node auto-loads models without a widget
11 : * selector, so no widget value is assigned when the node is added.
12 : *
13 : * Hierarchical fallback is handled by the store: "a/b/c" tries
14 : * "a/b/c" → "a/b" → "a", so registering a parent directory covers
15 : * all its children unless a more specific entry exists.
16 : *
17 : * Patterns enable the picker on every matching widget. Model drops populate
18 : * the first matching widget.
19 : *
20 : * Format: [modelDirectory, nodeClass, inputNameOrPattern]
21 : */
22 2356 : export const MODEL_NODE_MAPPINGS: ReadonlyArray<
23 : readonly [string, string, string | RegExp]
24 : > = [
25 : // Intentionally unmapped (widget values are model ids / HF repo ids, not
26 : // asset filenames): rmbg, florence2, LLM/Qwen-VL/*, qwen-tts, diffusers
27 : // (Kolors), BiRefNet, EVF-SAM, smol. onnx/human-parts has no assets.
28 : // Also unmapped: segformer_b2_clothes, segformer_b3_clothes,
29 : // segformer_b3_fashion, lama, layer_model, LLM/llava-llama-3-8b-*,
30 : // LLM/Llama-3.2-3B-Instruct, LLM/Florence-2-large-PromptGen-v2.0
31 : // (id widgets); sam3, sharp, BEN, BiRefNet/pth (node/widget names don't
32 : // exist); depthanything, CogVideo/GGUF, checkpoints/dynamicrafter/*,
33 : // transparent-background (asset names not accepted by the node's enum);
34 : // interpolation, clip, onnx (empty or unreachable dirs).
35 :
36 : // ---- ComfyUI core loaders ----
37 : ['checkpoints', 'CheckpointLoaderSimple', 'ckpt_name'],
38 : ['checkpoints', 'ImageOnlyCheckpointLoader', 'ckpt_name'],
39 : ['loras', 'LoraLoader', 'lora_name'],
40 : ['loras', 'LoraLoaderModelOnly', 'lora_name'],
41 : ['loras', 'LoadLoraModel', loraStackFilename],
42 : ['loras', 'LoadLoraTextEncoder', loraStackFilename],
43 : ['vae', 'VAELoader', 'vae_name'],
44 : ['controlnet', 'ControlNetLoader', 'control_net_name'],
45 : ['diffusion_models', 'UNETLoader', 'unet_name'],
46 : ['upscale_models', 'UpscaleModelLoader', 'model_name'],
47 : ['style_models', 'StyleModelLoader', 'style_model_name'],
48 : ['gligen', 'GLIGENLoader', 'gligen_name'],
49 : ['clip_vision', 'CLIPVisionLoader', 'clip_name'],
50 : ['text_encoders', 'CLIPLoader', 'clip_name'],
51 : ['audio_encoders', 'AudioEncoderLoader', 'audio_encoder_name'],
52 : ['model_patches', 'ModelPatchLoader', 'name'],
53 : ['latent_upscale_models', 'LatentUpscaleModelLoader', 'model_name'],
54 :
55 : // ---- AnimateDiff (comfyui-animatediff-evolved) ----
56 : ['animatediff_models', 'ADE_LoadAnimateDiffModel', 'model_name'],
57 : ['animatediff_motion_lora', 'ADE_AnimateDiffLoRALoader', 'name'],
58 :
59 : // ---- Chatterbox TTS (ComfyUI-Fill-Nodes) ----
60 : ['chatterbox/chatterbox', 'FL_ChatterboxTTS', ''],
61 : ['chatterbox/chatterbox_turbo', 'FL_ChatterboxTurboTTS', ''],
62 : ['chatterbox/chatterbox_multilingual', 'FL_ChatterboxMultilingualTTS', ''],
63 : ['chatterbox/chatterbox_vc', 'FL_ChatterboxVC', ''],
64 :
65 : // ---- SAM / SAM2 (comfyui-segment-anything-2, comfyui-impact-pack) ----
66 : ['sam2', 'DownloadAndLoadSAM2Model', 'model'],
67 : ['sams', 'SAMLoader', 'model_name'],
68 :
69 : // ---- DepthAnything (comfyui-depthanythingv3) ----
70 : ['depthanything3', 'DownloadAndLoadDepthAnythingV3Model', 'model'],
71 :
72 : // ---- IP-Adapter (comfyui_ipadapter_plus) ----
73 : ['ipadapter', 'IPAdapterModelLoader', 'ipadapter_file'],
74 :
75 : // ---- NLF pose estimation (ComfyUI-WanVideoWrapper) ----
76 : ['nlf', 'LoadNLFModel', 'nlf_model'],
77 :
78 : // ---- FlashVSR video super-resolution (ComfyUI-FlashVSR_Ultra_Fast) ----
79 : ['FlashVSR', 'FlashVSRNode', ''],
80 : ['FlashVSR-v1.1', 'FlashVSRNode', ''],
81 :
82 : // ---- SEEDVR2 video upscaling (comfyui-seedvr2) ----
83 : ['SEEDVR2', 'SeedVR2LoadDiTModel', 'model'],
84 :
85 : // ---- ChatGLM3 text encoder ----
86 : ['LLM/checkpoints', 'LoadChatGLM3', 'chatglm3_checkpoint'],
87 :
88 : // ---- LivePortrait (comfyui-liveportrait) ----
89 : ['liveportrait', 'DownloadAndLoadLivePortraitModels', ''],
90 :
91 : // ---- MimicMotion (ComfyUI-MimicMotionWrapper) ----
92 : ['mimicmotion', 'DownloadAndLoadMimicMotionModel', 'model'],
93 : ['dwpose', 'MimicMotionGetPoses', ''],
94 :
95 : // ---- Face parsing (comfyui_face_parsing) ----
96 : ['face_parsing', 'FaceParsingModelLoader(FaceParsing)', ''],
97 :
98 : // ---- RIFE video frame interpolation (ComfyUI-RIFE) ----
99 : ['rife', 'RIFE VFI', 'ckpt_name'],
100 :
101 : // ---- UltraShape 3D model generation ----
102 : ['UltraShape', 'UltraShapeLoadModel', 'checkpoint'],
103 :
104 : // ---- Detection models (vitpose, yolo) ----
105 : ['detection', 'OnnxDetectionModelLoader', 'yolo_model'],
106 :
107 : // ---- CogVideoX (comfyui-cogvideoxwrapper) ----
108 : ['CogVideo', 'DownloadAndLoadCogVideoModel', ''],
109 : ['CogVideo/ControlNet', 'DownloadAndLoadCogVideoControlNet', ''],
110 :
111 : // ---- DynamiCrafter (ComfyUI-DynamiCrafterWrapper) ----
112 : ['checkpoints', 'DynamiCrafterModelLoader', 'ckpt_name'],
113 : ['controlnet', 'DynamiCrafterCNLoader', 'ckpt_name'],
114 :
115 : // ---- Inpaint (comfyui-inpaint-nodes) ----
116 : ['inpaint', 'INPAINT_LoadInpaintModel', 'model_name'],
117 : ['inpaint', 'INPAINT_LoadFooocusInpaint', 'head'],
118 : ['inpaint', 'INPAINT_LoadFooocusInpaint', 'patch'],
119 :
120 : // ---- YOLO object detection (comfyui_layerstyle) ----
121 : ['yolo', 'LayerMask: ObjectDetectorYOLO8', 'yolo_model'],
122 :
123 : // ---- MediaPipe face detection (comfyui-liveportrait) ----
124 : ['mediapipe', 'LivePortraitLoadMediaPipeCropper', ''],
125 :
126 : // ---- Superprompt text enhancement ----
127 : ['superprompt-v1', 'Superprompt', ''],
128 :
129 : // ---- ComfyUI core background removal (v0.21+) ----
130 : ['background_removal', 'LoadBackgroundRemovalModel', 'bg_removal_name'],
131 :
132 : // ---- ComfyUI core frame interpolation (v0.21+) ----
133 : ['frame_interpolation', 'FrameInterpolationModelLoader', 'model_name'],
134 :
135 : // ---- FILM frame interpolation (ComfyUI-Frame-Interpolation) ----
136 : ['film', 'FILM VFI', 'ckpt_name'],
137 : ['atm', 'ATM VFI', 'ckpt_name'],
138 : ['momo', 'MOMO VFI', 'ckpt_name'],
139 :
140 : // ---- Ultralytics YOLO detectors (ComfyUI-Impact-Pack) ----
141 : // Intentionally NOT mapped to the asset-picker. The cloud asset-ingestion
142 : // metadata for nested model folders (`ultralytics/bbox`, `ultralytics/segm`)
143 : // still has the two known half-bugs described in #12075:
144 : // 1. Tag lookup mismatch (cloud stores combined tags, picker queries split).
145 : // 2. Submitted value mismatch (picker returns basenames, ingest expects
146 : // subdirectory-prefixed `bbox/<file>` / `segm/<file>`).
147 : // PR #12151 re-added the bbox/segm entries before either half was fixed,
148 : // reintroducing the FaceDetailer breakage. Until BE-689 lands the cloud-side
149 : // fixes, leave these disabled so the node falls back to the static combo
150 : // populated from `/api/object_info`.
151 : // ['ultralytics/bbox', 'UltralyticsDetectorProvider', 'model_name'],
152 : // ['ultralytics/segm', 'UltralyticsDetectorProvider', 'model_name'],
153 :
154 : // ---- Mel-Band RoFormer audio separation (ComfyUI-MelBandRoFormer) ----
155 : ['diffusion_models', 'MelBandRoFormerModelLoader', 'model_name'],
156 :
157 : // ---- ComfyUI core geometry estimation (MoGe) ----
158 : ['geometry_estimation', 'LoadMoGeModel', 'model_name'],
159 :
160 : // ---- ComfyUI core optical flow (RAFT) ----
161 : ['optical_flow', 'OpticalFlowLoader', 'model_name'],
162 :
163 : // ---- WanVideo (ComfyUI-WanVideoWrapper) ----
164 : ['loras', 'WanVideoLoraSelect', 'lora'],
165 :
166 : // ---- LTX-Video IC-LoRA (ComfyUI-LTXVideo) ----
167 : ['loras', 'LTXICLoRALoaderModelOnly', 'lora_name']
168 : ] as const satisfies ReadonlyArray<readonly [string, string, string | RegExp]>
|