Add LTX-2.3 overlay metadata
Browse files- README.md +14 -0
- _overlay/materialize.py +71 -0
- _overlay/overlay_manifest.json +15 -0
- model_index.json +36 -0
README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: sglang-diffusion
|
| 3 |
+
tags:
|
| 4 |
+
- sglang-diffusion
|
| 5 |
+
- overlay
|
| 6 |
+
- ltx-2
|
| 7 |
+
- ltx-2-3
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# LTX-2.3 Overlay
|
| 11 |
+
|
| 12 |
+
Overlay metadata repo for using `Lightricks/LTX-2.3` with SGLang Diffusion native LTX2 support.
|
| 13 |
+
|
| 14 |
+
This repo contains only overlay metadata and materialization logic. Source weights remain in `Lightricks/LTX-2.3`.
|
_overlay/materialize.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
from huggingface_hub import snapshot_download
|
| 4 |
+
|
| 5 |
+
from sglang.multimodal_gen.runtime.utils.model_overlay import (
|
| 6 |
+
_copytree_link_or_copy,
|
| 7 |
+
_ensure_dir,
|
| 8 |
+
_link_or_copy_file,
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
AUXILIARY_MODEL_ID = "Lightricks/LTX-2"
|
| 12 |
+
AUXILIARY_PATTERNS = [
|
| 13 |
+
"audio_vae/**",
|
| 14 |
+
"connectors/**",
|
| 15 |
+
"scheduler/**",
|
| 16 |
+
"text_encoder/**",
|
| 17 |
+
"tokenizer/**",
|
| 18 |
+
"transformer/config.json",
|
| 19 |
+
"vae/**",
|
| 20 |
+
"vocoder/**",
|
| 21 |
+
]
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def materialize(
|
| 25 |
+
*,
|
| 26 |
+
overlay_dir: str,
|
| 27 |
+
source_dir: str,
|
| 28 |
+
output_dir: str,
|
| 29 |
+
manifest: dict,
|
| 30 |
+
) -> None:
|
| 31 |
+
_ = overlay_dir, manifest
|
| 32 |
+
|
| 33 |
+
auxiliary_dir = snapshot_download(
|
| 34 |
+
repo_id=AUXILIARY_MODEL_ID,
|
| 35 |
+
allow_patterns=AUXILIARY_PATTERNS,
|
| 36 |
+
max_workers=8,
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
for component_name in (
|
| 40 |
+
"audio_vae",
|
| 41 |
+
"connectors",
|
| 42 |
+
"scheduler",
|
| 43 |
+
"text_encoder",
|
| 44 |
+
"tokenizer",
|
| 45 |
+
"vae",
|
| 46 |
+
"vocoder",
|
| 47 |
+
):
|
| 48 |
+
_copytree_link_or_copy(
|
| 49 |
+
os.path.join(auxiliary_dir, component_name),
|
| 50 |
+
os.path.join(output_dir, component_name),
|
| 51 |
+
)
|
| 52 |
+
|
| 53 |
+
transformer_dir = os.path.join(output_dir, "transformer")
|
| 54 |
+
_ensure_dir(transformer_dir)
|
| 55 |
+
_link_or_copy_file(
|
| 56 |
+
os.path.join(auxiliary_dir, "transformer", "config.json"),
|
| 57 |
+
os.path.join(transformer_dir, "config.json"),
|
| 58 |
+
)
|
| 59 |
+
_link_or_copy_file(
|
| 60 |
+
os.path.join(source_dir, "ltx-2.3-22b-dev.safetensors"),
|
| 61 |
+
os.path.join(transformer_dir, "ltx-2.3-22b-dev.safetensors"),
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
_link_or_copy_file(
|
| 65 |
+
os.path.join(source_dir, "ltx-2.3-22b-distilled-lora-384.safetensors"),
|
| 66 |
+
os.path.join(output_dir, "ltx-2.3-22b-distilled-lora-384.safetensors"),
|
| 67 |
+
)
|
| 68 |
+
_link_or_copy_file(
|
| 69 |
+
os.path.join(source_dir, "ltx-2.3-spatial-upscaler-x2-1.1.safetensors"),
|
| 70 |
+
os.path.join(output_dir, "ltx-2.3-spatial-upscaler-x2-1.1.safetensors"),
|
| 71 |
+
)
|
_overlay/overlay_manifest.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"source_model_id": "Lightricks/LTX-2.3",
|
| 3 |
+
"source_allow_patterns": [
|
| 4 |
+
"ltx-2.3-22b-dev.safetensors",
|
| 5 |
+
"ltx-2.3-22b-distilled-lora-384.safetensors",
|
| 6 |
+
"ltx-2.3-spatial-upscaler-x2-1.1.safetensors"
|
| 7 |
+
],
|
| 8 |
+
"required_source_files": [
|
| 9 |
+
"ltx-2.3-22b-dev.safetensors",
|
| 10 |
+
"ltx-2.3-22b-distilled-lora-384.safetensors",
|
| 11 |
+
"ltx-2.3-spatial-upscaler-x2-1.1.safetensors"
|
| 12 |
+
],
|
| 13 |
+
"custom_materializer": "_overlay/materialize.py",
|
| 14 |
+
"materializer_version": "v1"
|
| 15 |
+
}
|
model_index.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "LTX2Pipeline",
|
| 3 |
+
"_diffusers_version": "0.37.0.dev0",
|
| 4 |
+
"audio_vae": [
|
| 5 |
+
"diffusers",
|
| 6 |
+
"AutoencoderKLLTX2Audio"
|
| 7 |
+
],
|
| 8 |
+
"connectors": [
|
| 9 |
+
"ltx2",
|
| 10 |
+
"LTX2TextConnectors"
|
| 11 |
+
],
|
| 12 |
+
"scheduler": [
|
| 13 |
+
"diffusers",
|
| 14 |
+
"FlowMatchEulerDiscreteScheduler"
|
| 15 |
+
],
|
| 16 |
+
"text_encoder": [
|
| 17 |
+
"transformers",
|
| 18 |
+
"Gemma3ForConditionalGeneration"
|
| 19 |
+
],
|
| 20 |
+
"tokenizer": [
|
| 21 |
+
"transformers",
|
| 22 |
+
"GemmaTokenizerFast"
|
| 23 |
+
],
|
| 24 |
+
"transformer": [
|
| 25 |
+
"diffusers",
|
| 26 |
+
"LTX2VideoTransformer3DModel"
|
| 27 |
+
],
|
| 28 |
+
"vae": [
|
| 29 |
+
"diffusers",
|
| 30 |
+
"AutoencoderKLLTX2Video"
|
| 31 |
+
],
|
| 32 |
+
"vocoder": [
|
| 33 |
+
"ltx2",
|
| 34 |
+
"LTX2Vocoder"
|
| 35 |
+
]
|
| 36 |
+
}
|