| """Public model exports loaded on demand. |
| |
| Lazy imports preserve the existing ``from model import DMD`` API while avoiding |
| the model/pipeline cycle introduced by the standalone Predictor module. |
| """ |
|
|
| from __future__ import annotations |
|
|
| from importlib import import_module |
|
|
|
|
| _EXPORTS = { |
| "CausalDiffusion": ("model.diffusion", "CausalDiffusion"), |
| "CausVid": ("model.causvid", "CausVid"), |
| "DMD": ("model.dmd", "DMD"), |
| "GAN": ("model.gan", "GAN"), |
| "SiD": ("model.sid", "SiD"), |
| "ODERegression": ("model.ode_regression", "ODERegression"), |
| "SelfForcingPredictorV4": ( |
| "model.predictor_v4", |
| "SelfForcingPredictorV4", |
| ), |
| "TripleFeatureFusion": ("model.predictor_v4", "TripleFeatureFusion"), |
| "WanPredictorV4Config": ("model.predictor_v4", "WanPredictorV4Config"), |
| } |
|
|
| __all__ = list(_EXPORTS) |
|
|
|
|
| def __getattr__(name: str): |
| if name not in _EXPORTS: |
| raise AttributeError(name) |
| module_name, attribute = _EXPORTS[name] |
| value = getattr(import_module(module_name), attribute) |
| globals()[name] = value |
| return value |
|
|