From 69f48d2ffc72f8879d648eb6119f77a7704707c2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 5 Jul 2026 04:39:05 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/core/inference/video.py | 24 +++++++++++++--------- studio/backend/tests/test_video_backend.py | 3 +-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/studio/backend/core/inference/video.py b/studio/backend/core/inference/video.py index d91cc62737..4bd7751f7c 100644 --- a/studio/backend/core/inference/video.py +++ b/studio/backend/core/inference/video.py @@ -346,9 +346,7 @@ class VideoBackend: with self._lock: if self._load_token == token and self._loading is not None: self._loading.expected_bytes = expected - base_local = self._predownload_base( - base, kwargs.get("hf_token"), kind, ltx23 = ltx23 - ) + base_local = self._predownload_base(base, kwargs.get("hf_token"), kind, ltx23 = ltx23) # The 2.3 assembly pulls per component from the hub id (its snapshot here # deliberately lacks the base VAEs), so it only gets the warmed cache; the # generic from_pretrained paths get the complete local snapshot. @@ -373,7 +371,12 @@ class VideoBackend: _LTX23_BASE_PREFIXES = ("scheduler/", "text_encoder/", "tokenizer/") @staticmethod - def _base_download_files(info: Any, kind: str, *, ltx23: bool = False) -> list[tuple[str, int]]: + def _base_download_files( + info: Any, + kind: str, + *, + ltx23: bool = False, + ) -> list[tuple[str, int]]: """The (rfilename, size) list a load actually needs from the base repo. Single source of truth for the progress estimate AND the scoped pre-download, @@ -398,11 +401,7 @@ class VideoBackend: continue if name.startswith("text_encoder/diffusion_pytorch_model"): continue - if ( - ltx23 - and "/" in name - and not name.startswith(VideoBackend._LTX23_BASE_PREFIXES) - ): + if ltx23 and "/" in name and not name.startswith(VideoBackend._LTX23_BASE_PREFIXES): continue files.append((name, int(size))) return files @@ -435,7 +434,12 @@ class VideoBackend: return None def _predownload_base( - self, base: str, hf_token: Optional[str], kind: str, *, ltx23: bool = False + self, + base: str, + hf_token: Optional[str], + kind: str, + *, + ltx23: bool = False, ) -> Optional[str]: """Pull exactly the base-repo files the load needs; return the local snapshot dir. diff --git a/studio/backend/tests/test_video_backend.py b/studio/backend/tests/test_video_backend.py index 3eece7f807..c34cee5bf9 100644 --- a/studio/backend/tests/test_video_backend.py +++ b/studio/backend/tests/test_video_backend.py @@ -526,6 +526,5 @@ def test_base_download_files_ltx23_keeps_only_shared_components(): assert "text_encoder/model-00001-of-00002.safetensors" in names assert "tokenizer/tokenizer.model" in names assert not any( - n.startswith(("vae/", "connectors/", "latent_upsampler/", "transformer/")) - for n in names + n.startswith(("vae/", "connectors/", "latent_upsampler/", "transformer/")) for n in names )