| 1 | """ |
| 2 | LTX-2 Distillation Package. |
| 3 | |
| 4 | Keep package import side effects light so submodules can be imported in |
| 5 | isolation without eagerly loading the full dependency chain. |
| 6 | """ |
| 7 | |
| 8 | from importlib import import_module |
| 9 | |
| 10 | __version__ = "0.1.0" |
| 11 | |
| 12 | __all__ = [ |
| 13 | "LTX2DMD", |
| 14 | "get_denoising_loss", |
| 15 | # ODE Init |
| 16 | "LTX2ODEPairGenerator", |
| 17 | "ODEGenerationConfig", |
| 18 | "LTX2ODERegression", |
| 19 | "ODERegressionConfig", |
| 20 | "ODERegressionLMDBDataset", |
| 21 | "ODERegressionDataset", |
| 22 | ] |
| 23 | |
| 24 | _LAZY_IMPORTS = { |
| 25 | "LTX2DMD": ("ltx_distillation.dmd", "LTX2DMD"), |
| 26 | "get_denoising_loss": ("ltx_distillation.loss", "get_denoising_loss"), |
| 27 | "LTX2ODEPairGenerator": ("ltx_distillation.ode", "LTX2ODEPairGenerator"), |
| 28 | "ODEGenerationConfig": ("ltx_distillation.ode", "ODEGenerationConfig"), |
| 29 | "LTX2ODERegression": ("ltx_distillation.ode", "LTX2ODERegression"), |
| 30 | "ODERegressionConfig": ("ltx_distillation.ode", "ODERegressionConfig"), |
| 31 | "ODERegressionLMDBDataset": ("ltx_distillation.ode", "ODERegressionLMDBDataset"), |
| 32 | "ODERegressionDataset": ("ltx_distillation.ode", "ODERegressionDataset"), |
| 33 | } |
| 34 | |
| 35 | |
| 36 | def __getattr__(name: str): |
| 37 | if name not in _LAZY_IMPORTS: |
| 38 | raise AttributeError(f"module {__name__!r} has no attribute {name!r}") |
| 39 | |
| 40 | module_name, attr_name = _LAZY_IMPORTS[name] |
| 41 | value = getattr(import_module(module_name), attr_name) |
| 42 | globals()[name] = value |
| 43 | return value |
| 44 |