MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / create_dynamic_module

Function create_dynamic_module

src/diffusers/utils/dynamic_modules_utils.py:65–77  ·  view source on GitHub ↗

Creates a dynamic module in the cache directory for modules.

(name: Union[str, os.PathLike])

Source from the content-addressed store, hash-verified

63
64
65def create_dynamic_module(name: Union[str, os.PathLike]):
66 """
67 Creates a dynamic module in the cache directory for modules.
68 """
69 init_hf_modules()
70 dynamic_module_path = Path(HF_MODULES_CACHE) / name
71 # If the parent module does not exist yet, recursively create it.
72 if not dynamic_module_path.parent.exists():
73 create_dynamic_module(dynamic_module_path.parent)
74 os.makedirs(dynamic_module_path, exist_ok=True)
75 init_path = dynamic_module_path / "__init__.py"
76 if not init_path.exists():
77 init_path.touch()
78
79
80def get_relative_imports(module_file):

Callers 1

get_cached_module_fileFunction · 0.85

Calls 1

init_hf_modulesFunction · 0.85

Tested by

no test coverage detected