Download ComfyUI/app/database/models.py from vidfom/LTX-2-S: direct link, hf CLI and curl.
- Browser
- Download file 566 Bytes
-
https://huggingface.co/vidfom/LTX-2-S/resolve/main/ComfyUI/app/database/models.py
- Command line
-
hf download hf://vidfom/LTX-2-S/ComfyUI/app/database/models.py
-
curl -L -o models.py https://huggingface.co/vidfom/LTX-2-S/resolve/main/ComfyUI/app/database/models.py
566 Bytes
| from typing import Any | |
| from datetime import datetime | |
| from sqlalchemy.orm import DeclarativeBase | |
| class Base(DeclarativeBase): | |
| pass | |
| def to_dict(obj: Any, include_none: bool = False) -> dict[str, Any]: | |
| fields = obj.__table__.columns.keys() | |
| out: dict[str, Any] = {} | |
| for field in fields: | |
| val = getattr(obj, field) | |
| if val is None and not include_none: | |
| continue | |
| if isinstance(val, datetime): | |
| out[field] = val.isoformat() | |
| else: | |
| out[field] = val | |
| return out | |
| # TODO: Define models here | |