Spaces:
Paused
Paused
Update api/ltx_server_refactored_complete.py
Browse files
api/ltx_server_refactored_complete.py
CHANGED
|
@@ -42,24 +42,25 @@ RESULTS_DIR = Path("/app/output")
|
|
| 42 |
DEFAULT_FPS = 24.0
|
| 43 |
FRAMES_ALIGNMENT = 8
|
| 44 |
|
| 45 |
-
# --- DEPENDENCY PATH SETUP ---
|
| 46 |
-
# Ensures the LTX-Video library can be imported
|
| 47 |
def add_deps_to_path():
|
| 48 |
-
"""Adds the LTX repository directory to the Python system path."""
|
| 49 |
repo_path = str(LTX_VIDEO_REPO_DIR.resolve())
|
| 50 |
-
if
|
| 51 |
sys.path.insert(0, repo_path)
|
| 52 |
-
|
| 53 |
-
|
| 54 |
add_deps_to_path()
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
from api.gpu_manager import gpu_manager
|
| 59 |
-
from ltx_video.models.autoencoders.vae_encode import (normalize_latents, un_normalize_latents)
|
| 60 |
-
from ltx_video.pipelines.pipeline_ltx_video import (ConditioningItem, LTXMultiScalePipeline, adain_filter_latent)
|
| 61 |
-
from ltx_video.pipelines.pipeline_ltx_video import create_ltx_video_pipeline, create_latent_upsampler
|
| 62 |
-
from ltx_video.utils.inference_utils import load_image_to_tensor_with_resize_and_crop
|
| 63 |
from managers.vae_manager import vae_manager_singleton
|
| 64 |
from tools.video_encode_tool import video_encode_tool_singleton
|
| 65 |
|
|
|
|
| 42 |
DEFAULT_FPS = 24.0
|
| 43 |
FRAMES_ALIGNMENT = 8
|
| 44 |
|
|
|
|
|
|
|
| 45 |
def add_deps_to_path():
|
|
|
|
| 46 |
repo_path = str(LTX_VIDEO_REPO_DIR.resolve())
|
| 47 |
+
if str(LTX_VIDEO_REPO_DIR.resolve()) not in sys.path:
|
| 48 |
sys.path.insert(0, repo_path)
|
| 49 |
+
print(f"[DEBUG] Repo adicionado ao sys.path: {repo_path}")
|
|
|
|
| 50 |
add_deps_to_path()
|
| 51 |
|
| 52 |
+
from ltx_video.pipelines.pipeline_ltx_video import ConditioningItem, LTXMultiScalePipeline
|
| 53 |
+
from ltx_video.utils.skip_layer_strategy import SkipLayerStrategy
|
| 54 |
+
from ltx_video.models.autoencoders.vae_encode import un_normalize_latents, normalize_latents
|
| 55 |
+
from ltx_video.pipelines.pipeline_ltx_video import adain_filter_latent
|
| 56 |
+
from api.ltx.inference import (
|
| 57 |
+
create_ltx_video_pipeline,
|
| 58 |
+
create_latent_upsampler,
|
| 59 |
+
load_image_to_tensor_with_resize_and_crop,
|
| 60 |
+
seed_everething,
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
from api.gpu_manager import gpu_manager
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
from managers.vae_manager import vae_manager_singleton
|
| 65 |
from tools.video_encode_tool import video_encode_tool_singleton
|
| 66 |
|