eeuuia commited on
Commit
770f85b
·
verified ·
1 Parent(s): aeae6cd

Update api/ltx_server_refactored_complete.py

Browse files
Files changed (1) hide show
  1. api/ltx_server_refactored_complete.py +23 -18
api/ltx_server_refactored_complete.py CHANGED
@@ -2,27 +2,35 @@
2
  # DESCRIPTION: Backend service for video generation using LTX-Video pipeline.
3
  # Features modular generation, narrative chunking, and resource management.
4
 
5
- import gc
6
- import io
 
 
7
  import json
8
- import logging
9
- import os
10
  import random
11
- import shutil
12
- import subprocess
13
- import sys
 
 
 
 
 
14
  import tempfile
15
- import numpy as np
 
 
 
 
 
16
  import time
17
  import traceback
18
- import warnings
19
- from pathlib import Path
20
- from typing import Dict, List, Optional, Tuple
21
-
22
- import torch
23
- import yaml
24
  from einops import rearrange
25
- from huggingface_hub import hf_hub_download
 
 
26
 
27
  # ==============================================================================
28
  # --- INITIAL SETUP & CONFIGURATION ---
@@ -61,9 +69,6 @@ from api.ltx.inference import (
61
  seed_everething,
62
  )
63
 
64
- from api.gpu_manager import gpu_manager
65
- from managers.vae_manager import vae_manager_singleton
66
- from tools.video_encode_tool import video_encode_tool_singleton
67
 
68
 
69
  # ==============================================================================
 
2
  # DESCRIPTION: Backend service for video generation using LTX-Video pipeline.
3
  # Features modular generation, narrative chunking, and resource management.
4
 
5
+ import warnings
6
+ from huggingface_hub import logging
7
+ import os, subprocess, shlex, tempfile
8
+ import torch
9
  import json
10
+ import numpy as np
 
11
  import random
12
+ import os
13
+ import io
14
+ import shlex
15
+ import yaml
16
+ from typing import List, Dict
17
+ from pathlib import Path
18
+ import imageio
19
+ from PIL import Image
20
  import tempfile
21
+ from huggingface_hub import hf_hub_download
22
+ import sys
23
+ import subprocess
24
+ import gc
25
+ import shutil
26
+ import contextlib
27
  import time
28
  import traceback
29
+ from api.gpu_manager import gpu_manager
 
 
 
 
 
30
  from einops import rearrange
31
+ import torch.nn.functional as F
32
+ from managers.vae_manager import vae_manager_singleton
33
+ from tools.video_encode_tool import video_encode_tool_singleton
34
 
35
  # ==============================================================================
36
  # --- INITIAL SETUP & CONFIGURATION ---
 
69
  seed_everething,
70
  )
71
 
 
 
 
72
 
73
 
74
  # ==============================================================================