MCPcopy Create free account
hub / github.com/Lightricks/ComfyUI-LTXVideo / find_matching_dir

Function find_matching_dir

gemma_encoder.py:200–213  ·  view source on GitHub ↗

Recursively search for files matching a glob pattern and return the parent directory of the first match.

(root_path: str, pattern: str)

Source from the content-addressed store, hash-verified

198
199
200def find_matching_dir(root_path: str, pattern: str) -> str:
201 """
202 Recursively search for files matching a glob pattern and return the parent directory of the first match.
203 """
204 matches = [
205 Path(p)
206 for p in glob(f"{root_path}/**", recursive=True)
207 if Path(p).match(pattern)
208 ]
209 if not matches:
210 raise FileNotFoundError(
211 f"No files matching pattern '{pattern}' found under {root_path}"
212 )
213 return str(matches[0].parent)
214
215
216@comfy_node(name="LTXVGemmaCLIPModelLoader", description="Gemma 3 Model Loader")

Callers 1

load_modelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected