linoyts HF Staff fffiloni commited on
Commit
bf8d04a
·
1 Parent(s): a6609ba

Fix crash by pinning LTX-2 to a compatible commit. (#5)

Browse files

- Fix crash by pinning LTX-2 to a compatible commit. (27ca42686df54a99c6a42ae094d1922c2eebd536)


Co-authored-by: Sylvain Filoni <fffiloni@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +18 -8
app.py CHANGED
@@ -9,19 +9,29 @@ os.environ["TORCHDYNAMO_DISABLE"] = "1"
9
  # Install xformers for memory-efficient attention
10
  subprocess.run([sys.executable, "-m", "pip", "install", "xformers==0.0.32.post2", "--no-build-isolation"], check=False)
11
 
12
- # Clone LTX-2 repo and install packages
13
  LTX_REPO_URL = "https://github.com/Lightricks/LTX-2.git"
14
  LTX_REPO_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "LTX-2")
 
15
 
16
- if not os.path.exists(LTX_REPO_DIR):
17
- print(f"Cloning {LTX_REPO_URL}...")
18
- subprocess.run(["git", "clone", "--depth", "1", LTX_REPO_URL, LTX_REPO_DIR], check=True)
19
 
20
- print("Installing ltx-core and ltx-pipelines from cloned repo...")
 
 
 
 
 
 
21
  subprocess.run(
22
- [sys.executable, "-m", "pip", "install", "--force-reinstall", "--no-deps", "-e",
23
- os.path.join(LTX_REPO_DIR, "packages", "ltx-core"),
24
- "-e", os.path.join(LTX_REPO_DIR, "packages", "ltx-pipelines")],
 
 
 
25
  check=True,
26
  )
27
 
 
9
  # Install xformers for memory-efficient attention
10
  subprocess.run([sys.executable, "-m", "pip", "install", "xformers==0.0.32.post2", "--no-build-isolation"], check=False)
11
 
12
+ # Clone LTX-2 repo at a pinned compatible commit and install packages
13
  LTX_REPO_URL = "https://github.com/Lightricks/LTX-2.git"
14
  LTX_REPO_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "LTX-2")
15
+ LTX_COMMIT = "ae855f8538843825f9015a419cf4ba5edaf5eec2"
16
 
17
+ if os.path.exists(LTX_REPO_DIR):
18
+ print(f"Removing existing repo at {LTX_REPO_DIR}...")
19
+ subprocess.run(["rm", "-rf", LTX_REPO_DIR], check=True)
20
 
21
+ print(f"Cloning {LTX_REPO_URL}...")
22
+ subprocess.run(["git", "clone", LTX_REPO_URL, LTX_REPO_DIR], check=True)
23
+
24
+ print(f"Checking out commit {LTX_COMMIT}...")
25
+ subprocess.run(["git", "-C", LTX_REPO_DIR, "checkout", LTX_COMMIT], check=True)
26
+
27
+ print("Installing ltx-core and ltx-pipelines from pinned repo commit...")
28
  subprocess.run(
29
+ [
30
+ sys.executable, "-m", "pip", "install",
31
+ "--force-reinstall", "--no-deps",
32
+ "-e", os.path.join(LTX_REPO_DIR, "packages", "ltx-core"),
33
+ "-e", os.path.join(LTX_REPO_DIR, "packages", "ltx-pipelines"),
34
+ ],
35
  check=True,
36
  )
37