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

Function get_class_in_module

src/diffusers/utils/dynamic_modules_utils.py:159–168  ·  view source on GitHub ↗

Import a module on the cache directory for modules and extract a class from it.

(class_name, module_path)

Source from the content-addressed store, hash-verified

157
158
159def get_class_in_module(class_name, module_path):
160 """
161 Import a module on the cache directory for modules and extract a class from it.
162 """
163 module_path = module_path.replace(os.path.sep, ".")
164 module = importlib.import_module(module_path)
165
166 if class_name is None:
167 return find_pipeline_class(module)
168 return getattr(module, class_name)
169
170
171def find_pipeline_class(loaded_module):

Callers 1

Calls 1

find_pipeline_classFunction · 0.85

Tested by

no test coverage detected