Skip to content

Conversation

rb-synth
Copy link

@rb-synth rb-synth commented May 7, 2025

  • Moved code inside src, so that pip install -e . can be used (by updating pyproject.toml).
  • Moved the inference script inside the package so that it can be imported from elsewhere, e.g., from ltx_video.inference import infer.
  • give def infer signature the same defaults as argparse so that it can be used as a function from elsewhere.
  • models_dir argument exposed (so can be set to None and use hf default)
  • move configs inside src/ltx_video so that it will be included with pip install. Path defaults to relative to inference.py.

Local install:

uv venv --python 3.12
uv sync --all-extras --inexact --python 3.12 --index-strategy unsafe-best-match

Or add as dependency to another package (in e.g., requirements.txt):

>>> requirements.txt
git+https://github.com/rb-synth/LTX-Video.git@refactor#egg=ltx_video[inference-script]

And run with:

from ltx_video.inference import infer
infer(prompt="something")

@rb-synth rb-synth changed the title better install Improved installation and inference from python function (rather than CLI) May 7, 2025
# pytype static type analyzer
.pytype/

# Cython debug symbols
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing to the package!
General comment:
Please use commit messages that match the regex pattern: .: [A-Z].

"einops",
"timm",
"imageio",
"timm"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash commit bd56660 into the first commit of the PR

frame_rate: int = 30
device: Optional[str] = None
pipeline_config: str = "configs/ltxv-13b-0.9.7-dev.yaml"
pipeline_config: str = str(CONFIG_PATH / "ltxv-13b-0.9.7-dev.yaml")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default should be ltxv-13b-0.9.7-distilled.yaml

# create env
python -m venv env
source env/bin/activate
python -m pip install -e .\[inference-script\]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the Readme to point to the new location of inference.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants