@huggingface/tasks 0.21.36 → 0.21.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/model-libraries-snippets.d.ts.map +1 -1
- package/dist/commonjs/model-libraries-snippets.js +214 -56
- package/dist/commonjs/model-libraries.js +1 -1
- package/dist/esm/model-libraries-snippets.d.ts.map +1 -1
- package/dist/esm/model-libraries-snippets.js +214 -56
- package/dist/esm/model-libraries.js +1 -1
- package/package.json +1 -1
- package/src/model-libraries-snippets.ts +276 -56
- package/src/model-libraries.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-libraries-snippets.d.ts","sourceRoot":"","sources":["../../src/model-libraries-snippets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAoBjD,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAOjD,CAAC;AAkBF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAKjD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,SAAS,KAAG,MAAM,EAIhD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,SAAS,KAAG,MAAM,EAkBlD,CAAC;AAaF,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,KAAG,MAAM,EAY7C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,MAAM,EAenC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,SAAS,KAAG,MAAM,EAsB5D,CAAC;AAEF,eAAO,MAAM,eAA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KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAiB9C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAgD9C,CAAC"}
|
|
@@ -991,77 +991,219 @@ import soundfile as sf
|
|
|
991
991
|
sf.write('output.wav', audio, 24000)`,
|
|
992
992
|
];
|
|
993
993
|
exports.kittentts = kittentts;
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
994
|
+
/**
|
|
995
|
+
* Detect LTX-2.5 (split weights + Gemma 4 TE file) vs LTX-2.3
|
|
996
|
+
* (monolith checkpoint + separate Gemma 3 root). Prefer explicit tags / ids /
|
|
997
|
+
* base_model refs; fall back to 2.3 for unmarked legacy cards.
|
|
998
|
+
*/
|
|
999
|
+
function _isLtx25Model(model) {
|
|
1000
|
+
const refs = [model.id, ...(model.tags ?? [])];
|
|
1001
|
+
const base = model.cardData?.base_model;
|
|
1002
|
+
if (Array.isArray(base)) {
|
|
1003
|
+
refs.push(...base);
|
|
1004
|
+
}
|
|
1005
|
+
else if (base) {
|
|
1006
|
+
refs.push(base);
|
|
1007
|
+
}
|
|
1008
|
+
return refs.some((ref) => /ltx[-_]?2\.5/i.test(ref));
|
|
1009
|
+
}
|
|
1010
|
+
const _LTX_I2V_HINT = `# For image-to-video, add: --image path/to/image.jpg 0 0.8`;
|
|
1011
|
+
const _LTX_GEMMA3_ROOT = "models/gemma-3-12b";
|
|
1012
|
+
const _LTX_DEFAULT_PROMPT = "A beautiful sunset over the ocean";
|
|
1013
|
+
function _ltxInstall(is25) {
|
|
1014
|
+
// natten is only needed for the LTX-2.5 diffusion VAE (skipped automatically on Windows/macOS).
|
|
1015
|
+
return `# Install the LTX-2 pipelines
|
|
997
1016
|
git clone https://github.com/Lightricks/LTX-2.git
|
|
998
1017
|
cd LTX-2
|
|
999
|
-
uv sync --frozen`;
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1018
|
+
uv sync ${is25 ? "--extra natten" : "--frozen"}`;
|
|
1019
|
+
}
|
|
1020
|
+
function _ltxRun(module, args, comment, options) {
|
|
1021
|
+
const body = `uv run python -m ltx_pipelines.${module} \\\n ${args.join(" \\\n ")}`;
|
|
1022
|
+
const parts = [`# ${comment}`, body];
|
|
1023
|
+
if (options?.footer) {
|
|
1024
|
+
parts.push(options.footer);
|
|
1025
|
+
}
|
|
1026
|
+
if (options?.hint) {
|
|
1027
|
+
parts.push(_LTX_I2V_HINT);
|
|
1028
|
+
}
|
|
1029
|
+
return parts.join("\n");
|
|
1030
|
+
}
|
|
1031
|
+
const _LTX_DETAILING_LORA_REPO = "Lightricks/LTX-2.5-22b-IC-LoRA-Pixel-Spatial-Upscaler";
|
|
1032
|
+
const _LTX_DETAILING_LORA_FILE = "ltx-2.5-22b-ic-lora-pixel-spatial-upscaler-x2-1.0.safetensors";
|
|
1033
|
+
function _ltx25SplitArgs(paths) {
|
|
1034
|
+
const args = [
|
|
1035
|
+
`--transformer-path ${paths.transformer}`,
|
|
1036
|
+
`--text-encoder-path ${paths.textEncoder}`,
|
|
1037
|
+
`--video-vae-path ${paths.videoVae}`,
|
|
1038
|
+
`--audio-vae-path ${paths.audioVae}`,
|
|
1039
|
+
`--spatial-upsampler-path ${paths.spatialUpsampler}`,
|
|
1040
|
+
];
|
|
1041
|
+
if (paths.temporalUpsampler) {
|
|
1042
|
+
args.push(`--temporal-upsampler-path ${paths.temporalUpsampler}`);
|
|
1043
|
+
}
|
|
1044
|
+
return args;
|
|
1045
|
+
}
|
|
1046
|
+
function _ltx25RepoPaths(localDir) {
|
|
1047
|
+
const shared = {
|
|
1048
|
+
transformer: `${localDir}/diffusion_models/<distilled-transformer>.safetensors`,
|
|
1049
|
+
textEncoder: `${localDir}/text_encoders/gemma4-12b-with-proj-ltx-2.5-bf16.safetensors`,
|
|
1050
|
+
videoVae: `${localDir}/vae/<video-vae>.safetensors`,
|
|
1051
|
+
audioVae: `${localDir}/vae/<audio-vae>.safetensors`,
|
|
1052
|
+
spatialUpsampler: `${localDir}/latent_upscale_models/<spatial-upsampler>.safetensors`,
|
|
1053
|
+
};
|
|
1054
|
+
return {
|
|
1055
|
+
distilled: shared,
|
|
1056
|
+
// DFR runs on the distilled transformer; detailing IC-LoRA is required separately.
|
|
1057
|
+
dfr: {
|
|
1058
|
+
...shared,
|
|
1059
|
+
temporalUpsampler: `${localDir}/latent_upscale_models/<temporal-upsampler>.safetensors`,
|
|
1060
|
+
},
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
function _ltx25BasePlaceholderPaths() {
|
|
1064
|
+
return {
|
|
1065
|
+
transformer: "path/to/distilled-transformer.safetensors",
|
|
1066
|
+
textEncoder: "path/to/gemma4-12b-with-proj-ltx-2.5-bf16.safetensors",
|
|
1067
|
+
videoVae: "path/to/video-vae.safetensors",
|
|
1068
|
+
audioVae: "path/to/audio-vae.safetensors",
|
|
1069
|
+
spatialUpsampler: "path/to/spatial-upsampler.safetensors",
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
function _ltx25Download(modelId, localDir, kind) {
|
|
1073
|
+
if (kind === "adapter") {
|
|
1074
|
+
return `# Download the adapter weights from this repo
|
|
1075
|
+
# (base components come from Lightricks/LTX-2.5 — see Files and versions)
|
|
1076
|
+
hf download ${modelId} --local-dir ${localDir}`;
|
|
1077
|
+
}
|
|
1078
|
+
const detailingDir = `models/${_LTX_DETAILING_LORA_REPO.split("/")[1]}`;
|
|
1079
|
+
return `# Download weights from this repo
|
|
1080
|
+
# Substitute filenames from this repo's "Files and versions" if they differ
|
|
1081
|
+
hf download ${modelId} \\
|
|
1082
|
+
diffusion_models/<distilled-transformer>.safetensors \\
|
|
1083
|
+
text_encoders/gemma4-12b-with-proj-ltx-2.5-bf16.safetensors \\
|
|
1084
|
+
vae/<video-vae>.safetensors \\
|
|
1085
|
+
vae/<audio-vae>.safetensors \\
|
|
1086
|
+
latent_upscale_models/<spatial-upsampler>.safetensors \\
|
|
1087
|
+
latent_upscale_models/<temporal-upsampler>.safetensors \\
|
|
1088
|
+
--local-dir ${localDir}
|
|
1089
|
+
# DFR requires the detailing IC-LoRA (separate repo; strength is fixed at 0.5)
|
|
1090
|
+
hf download ${_LTX_DETAILING_LORA_REPO} --local-dir ${detailingDir}`;
|
|
1091
|
+
}
|
|
1092
|
+
function _ltx23Download(modelId, localDir) {
|
|
1093
|
+
return `# Download the weights from this repo, plus the Gemma text encoder
|
|
1094
|
+
hf download ${modelId} --local-dir ${localDir}
|
|
1095
|
+
hf download google/gemma-3-12b-it-qat-q4_0-unquantized --local-dir ${_LTX_GEMMA3_ROOT}`;
|
|
1096
|
+
}
|
|
1097
|
+
function _ltx25Snippets(model, localDir, tags) {
|
|
1098
|
+
const install = _ltxInstall(true);
|
|
1099
|
+
const loraArg = `--lora ${localDir}/<weights>.safetensors 1.0`;
|
|
1100
|
+
const basePaths = _ltx25BasePlaceholderPaths();
|
|
1101
|
+
if (tags.includes("ic-lora")) {
|
|
1102
|
+
return [
|
|
1103
|
+
install,
|
|
1104
|
+
_ltx25Download(model.id, localDir, "adapter"),
|
|
1105
|
+
_ltxRun("ic_lora", [
|
|
1106
|
+
..._ltx25SplitArgs(basePaths),
|
|
1107
|
+
loraArg,
|
|
1108
|
+
"--video-conditioning reference.mp4 1.0",
|
|
1109
|
+
`--prompt "your prompt here"`,
|
|
1110
|
+
"--output-path output.mp4",
|
|
1111
|
+
], "Video-to-video with the IC-LoRA (runs on the distilled LTX-2.5 base)"),
|
|
1112
|
+
];
|
|
1113
|
+
}
|
|
1114
|
+
if (tags.includes("lora")) {
|
|
1115
|
+
return [
|
|
1116
|
+
install,
|
|
1117
|
+
_ltx25Download(model.id, localDir, "adapter"),
|
|
1118
|
+
_ltxRun("distilled", [..._ltx25SplitArgs(basePaths), loraArg, `--prompt "your prompt here"`, "--output-path output.mp4"], "Text/image-to-video with the LoRA on the distilled LTX-2.5 pipeline", { hint: true }),
|
|
1119
|
+
];
|
|
1120
|
+
}
|
|
1121
|
+
const { distilled, dfr } = _ltx25RepoPaths(localDir);
|
|
1122
|
+
const detailingDir = `models/${_LTX_DETAILING_LORA_REPO.split("/")[1]}`;
|
|
1123
|
+
return [
|
|
1124
|
+
install,
|
|
1125
|
+
_ltx25Download(model.id, localDir, "base"),
|
|
1126
|
+
_ltxRun("distilled", [
|
|
1127
|
+
..._ltx25SplitArgs(distilled),
|
|
1128
|
+
"--num-frames 121",
|
|
1129
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1130
|
+
"--output-path output.mp4",
|
|
1131
|
+
], "Distilled LTX-2.5 pipeline (fast)", { hint: true }),
|
|
1132
|
+
_ltxRun("dfr_pipeline", [
|
|
1133
|
+
..._ltx25SplitArgs(dfr),
|
|
1134
|
+
`--detailing-lora ${detailingDir}/${_LTX_DETAILING_LORA_FILE}`,
|
|
1135
|
+
"--spatial-upscalings 1",
|
|
1136
|
+
"--temporal-upscalings 1",
|
|
1137
|
+
"--height 1088",
|
|
1138
|
+
"--width 1920",
|
|
1139
|
+
"--num-frames 121",
|
|
1140
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1141
|
+
"--output-path output.mp4",
|
|
1142
|
+
], "DFR pipeline (higher detail fidelity; optional temporal 2x/4x)", {
|
|
1143
|
+
footer: "# For 4K: --spatial-upscalings 2 --width 3840 --height 2176",
|
|
1144
|
+
hint: true,
|
|
1145
|
+
}),
|
|
1146
|
+
];
|
|
1147
|
+
}
|
|
1148
|
+
function _ltx23Snippets(model, localDir, tags) {
|
|
1149
|
+
const install = _ltxInstall(false);
|
|
1150
|
+
const download = _ltx23Download(model.id, localDir);
|
|
1151
|
+
const loraArg = `--lora ${localDir}/<weights>.safetensors 1.0`;
|
|
1152
|
+
const gemma = `--gemma-root ${_LTX_GEMMA3_ROOT}`;
|
|
1010
1153
|
if (tags.includes("ic-lora")) {
|
|
1011
1154
|
return [
|
|
1012
1155
|
install,
|
|
1013
1156
|
download,
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1157
|
+
_ltxRun("ic_lora", [
|
|
1158
|
+
"--distilled-checkpoint-path path/to/distilled_checkpoint.safetensors",
|
|
1159
|
+
"--spatial-upsampler-path path/to/spatial_upsampler.safetensors",
|
|
1160
|
+
gemma,
|
|
1161
|
+
loraArg,
|
|
1162
|
+
"--video-conditioning reference.mp4 1.0",
|
|
1163
|
+
`--prompt "your prompt here"`,
|
|
1164
|
+
"--output-path output.mp4",
|
|
1165
|
+
], "Video-to-video with the IC-LoRA (runs on the distilled base model)"),
|
|
1023
1166
|
];
|
|
1024
1167
|
}
|
|
1025
|
-
// Standard LoRA applied on top of the base pipeline.
|
|
1026
1168
|
if (tags.includes("lora")) {
|
|
1027
1169
|
return [
|
|
1028
1170
|
install,
|
|
1029
1171
|
download,
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
${imageToVideoHint}`,
|
|
1172
|
+
_ltxRun("ti2vid_two_stages_hq", [
|
|
1173
|
+
"--checkpoint-path path/to/checkpoint.safetensors",
|
|
1174
|
+
"--distilled-lora path/to/distilled_lora.safetensors 0.8",
|
|
1175
|
+
"--spatial-upsampler-path path/to/spatial_upsampler.safetensors",
|
|
1176
|
+
gemma,
|
|
1177
|
+
loraArg,
|
|
1178
|
+
`--prompt "your prompt here"`,
|
|
1179
|
+
"--output-path output.mp4",
|
|
1180
|
+
], "Text/image-to-video with the LoRA on the HQ two-stage base pipeline", { hint: true }),
|
|
1040
1181
|
];
|
|
1041
1182
|
}
|
|
1042
|
-
// Base model: the fast (distilled) and HQ (two-stage) pipelines. Substitute the
|
|
1043
|
-
// .safetensors filenames with the ones listed under this repo's "Files and versions".
|
|
1044
1183
|
return [
|
|
1045
1184
|
install,
|
|
1046
1185
|
download,
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
--output-path output.mp4
|
|
1063
|
-
${imageToVideoHint}`,
|
|
1186
|
+
_ltxRun("distilled", [
|
|
1187
|
+
`--distilled-checkpoint-path ${localDir}/<distilled-checkpoint>.safetensors`,
|
|
1188
|
+
`--spatial-upsampler-path ${localDir}/<spatial-upsampler>.safetensors`,
|
|
1189
|
+
gemma,
|
|
1190
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1191
|
+
"--output-path output.mp4",
|
|
1192
|
+
], "Fast pipeline (distilled model, no distilled LoRA needed)", { hint: true }),
|
|
1193
|
+
_ltxRun("ti2vid_two_stages_hq", [
|
|
1194
|
+
`--checkpoint-path ${localDir}/<checkpoint>.safetensors`,
|
|
1195
|
+
`--distilled-lora ${localDir}/<distilled-lora>.safetensors 0.8`,
|
|
1196
|
+
`--spatial-upsampler-path ${localDir}/<spatial-upsampler>.safetensors`,
|
|
1197
|
+
gemma,
|
|
1198
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1199
|
+
"--output-path output.mp4",
|
|
1200
|
+
], "HQ pipeline (two-stage, higher quality)", { hint: true }),
|
|
1064
1201
|
];
|
|
1202
|
+
}
|
|
1203
|
+
const ltx = (model) => {
|
|
1204
|
+
const localDir = `models/${nameWithoutNamespace(model.id)}`;
|
|
1205
|
+
const tags = model.tags ?? [];
|
|
1206
|
+
return _isLtx25Model(model) ? _ltx25Snippets(model, localDir, tags) : _ltx23Snippets(model, localDir, tags);
|
|
1065
1207
|
};
|
|
1066
1208
|
exports.ltx = ltx;
|
|
1067
1209
|
const lightning_ir = (model) => {
|
|
@@ -2147,14 +2289,30 @@ model = BiRefNet.from_pretrained("${model.id}")`,
|
|
|
2147
2289
|
exports.birefnet = birefnet;
|
|
2148
2290
|
const nobg = (model) => {
|
|
2149
2291
|
const installSnippet = `pip install nobg`;
|
|
2150
|
-
|
|
2292
|
+
// we check model tags and if it supports prompts we show an example for it, else we show the default example without prompts
|
|
2293
|
+
const predictCall = model.tags.includes("promptable")
|
|
2294
|
+
? `cutout = model.predict(processor, "image.jpg", "prompt")`
|
|
2295
|
+
: `cutout = model.predict(processor, "image.jpg")`;
|
|
2296
|
+
// snippet using the predict method
|
|
2297
|
+
const predictSnippet = `# Option 1: use via the predict method
|
|
2298
|
+
|
|
2299
|
+
from nobg import AutoModel, AutoProcessor
|
|
2300
|
+
|
|
2301
|
+
model = AutoModel.from_pretrained("${model.id}").eval()
|
|
2302
|
+
processor = AutoProcessor.from_pretrained("${model.id}")
|
|
2303
|
+
|
|
2304
|
+
${predictCall}`;
|
|
2305
|
+
// snippet using the model and processor directly
|
|
2306
|
+
const manualSnippet = `# Option 2: use the model and processor directly
|
|
2307
|
+
|
|
2308
|
+
import torch
|
|
2151
2309
|
from loadimg import load_img
|
|
2152
2310
|
from nobg import AutoModel, AutoProcessor
|
|
2153
2311
|
|
|
2154
2312
|
model = AutoModel.from_pretrained("${model.id}").eval()
|
|
2155
2313
|
processor = AutoProcessor.from_pretrained("${model.id}")
|
|
2156
2314
|
|
|
2157
|
-
image = load_img("
|
|
2315
|
+
image = load_img("image.jpg").convert("RGB")
|
|
2158
2316
|
inputs = processor(image, return_tensors="pt")
|
|
2159
2317
|
|
|
2160
2318
|
with torch.no_grad():
|
|
@@ -2162,7 +2320,7 @@ with torch.no_grad():
|
|
|
2162
2320
|
|
|
2163
2321
|
alpha = processor.post_process_alpha_matting(outputs, target_sizes=[(image.height, image.width)])[0]
|
|
2164
2322
|
processor.cutout(image, alpha).save("output.png")`;
|
|
2165
|
-
return [installSnippet,
|
|
2323
|
+
return [installSnippet, predictSnippet, manualSnippet];
|
|
2166
2324
|
};
|
|
2167
2325
|
exports.nobg = nobg;
|
|
2168
2326
|
const supertonic = () => [
|
|
@@ -796,7 +796,7 @@ exports.MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
796
796
|
countDownloads: `path_extension:"pt"`,
|
|
797
797
|
},
|
|
798
798
|
ltx: {
|
|
799
|
-
prettyLabel: "LTX
|
|
799
|
+
prettyLabel: "LTX-2",
|
|
800
800
|
repoName: "LTX-2",
|
|
801
801
|
repoUrl: "https://github.com/Lightricks/LTX-2",
|
|
802
802
|
docsUrl: "https://github.com/Lightricks/LTX-2",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-libraries-snippets.d.ts","sourceRoot":"","sources":["../../src/model-libraries-snippets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAoBjD,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAOjD,CAAC;AAkBF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAKjD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,SAAS,KAAG,MAAM,EAIhD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,SAAS,KAAG,MAAM,EAkBlD,CAAC;AAaF,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,KAAG,MAAM,EAY7C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,MAAM,EAenC,CAAC;AAEF,eAAO,MAAM,mBAAmB,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AAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAiB9C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAgD9C,CAAC"}
|
|
@@ -946,77 +946,219 @@ audio = m.generate("This high quality TTS model works without a GPU")
|
|
|
946
946
|
import soundfile as sf
|
|
947
947
|
sf.write('output.wav', audio, 24000)`,
|
|
948
948
|
];
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
949
|
+
/**
|
|
950
|
+
* Detect LTX-2.5 (split weights + Gemma 4 TE file) vs LTX-2.3
|
|
951
|
+
* (monolith checkpoint + separate Gemma 3 root). Prefer explicit tags / ids /
|
|
952
|
+
* base_model refs; fall back to 2.3 for unmarked legacy cards.
|
|
953
|
+
*/
|
|
954
|
+
function _isLtx25Model(model) {
|
|
955
|
+
const refs = [model.id, ...(model.tags ?? [])];
|
|
956
|
+
const base = model.cardData?.base_model;
|
|
957
|
+
if (Array.isArray(base)) {
|
|
958
|
+
refs.push(...base);
|
|
959
|
+
}
|
|
960
|
+
else if (base) {
|
|
961
|
+
refs.push(base);
|
|
962
|
+
}
|
|
963
|
+
return refs.some((ref) => /ltx[-_]?2\.5/i.test(ref));
|
|
964
|
+
}
|
|
965
|
+
const _LTX_I2V_HINT = `# For image-to-video, add: --image path/to/image.jpg 0 0.8`;
|
|
966
|
+
const _LTX_GEMMA3_ROOT = "models/gemma-3-12b";
|
|
967
|
+
const _LTX_DEFAULT_PROMPT = "A beautiful sunset over the ocean";
|
|
968
|
+
function _ltxInstall(is25) {
|
|
969
|
+
// natten is only needed for the LTX-2.5 diffusion VAE (skipped automatically on Windows/macOS).
|
|
970
|
+
return `# Install the LTX-2 pipelines
|
|
952
971
|
git clone https://github.com/Lightricks/LTX-2.git
|
|
953
972
|
cd LTX-2
|
|
954
|
-
uv sync --frozen`;
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
973
|
+
uv sync ${is25 ? "--extra natten" : "--frozen"}`;
|
|
974
|
+
}
|
|
975
|
+
function _ltxRun(module, args, comment, options) {
|
|
976
|
+
const body = `uv run python -m ltx_pipelines.${module} \\\n ${args.join(" \\\n ")}`;
|
|
977
|
+
const parts = [`# ${comment}`, body];
|
|
978
|
+
if (options?.footer) {
|
|
979
|
+
parts.push(options.footer);
|
|
980
|
+
}
|
|
981
|
+
if (options?.hint) {
|
|
982
|
+
parts.push(_LTX_I2V_HINT);
|
|
983
|
+
}
|
|
984
|
+
return parts.join("\n");
|
|
985
|
+
}
|
|
986
|
+
const _LTX_DETAILING_LORA_REPO = "Lightricks/LTX-2.5-22b-IC-LoRA-Pixel-Spatial-Upscaler";
|
|
987
|
+
const _LTX_DETAILING_LORA_FILE = "ltx-2.5-22b-ic-lora-pixel-spatial-upscaler-x2-1.0.safetensors";
|
|
988
|
+
function _ltx25SplitArgs(paths) {
|
|
989
|
+
const args = [
|
|
990
|
+
`--transformer-path ${paths.transformer}`,
|
|
991
|
+
`--text-encoder-path ${paths.textEncoder}`,
|
|
992
|
+
`--video-vae-path ${paths.videoVae}`,
|
|
993
|
+
`--audio-vae-path ${paths.audioVae}`,
|
|
994
|
+
`--spatial-upsampler-path ${paths.spatialUpsampler}`,
|
|
995
|
+
];
|
|
996
|
+
if (paths.temporalUpsampler) {
|
|
997
|
+
args.push(`--temporal-upsampler-path ${paths.temporalUpsampler}`);
|
|
998
|
+
}
|
|
999
|
+
return args;
|
|
1000
|
+
}
|
|
1001
|
+
function _ltx25RepoPaths(localDir) {
|
|
1002
|
+
const shared = {
|
|
1003
|
+
transformer: `${localDir}/diffusion_models/<distilled-transformer>.safetensors`,
|
|
1004
|
+
textEncoder: `${localDir}/text_encoders/gemma4-12b-with-proj-ltx-2.5-bf16.safetensors`,
|
|
1005
|
+
videoVae: `${localDir}/vae/<video-vae>.safetensors`,
|
|
1006
|
+
audioVae: `${localDir}/vae/<audio-vae>.safetensors`,
|
|
1007
|
+
spatialUpsampler: `${localDir}/latent_upscale_models/<spatial-upsampler>.safetensors`,
|
|
1008
|
+
};
|
|
1009
|
+
return {
|
|
1010
|
+
distilled: shared,
|
|
1011
|
+
// DFR runs on the distilled transformer; detailing IC-LoRA is required separately.
|
|
1012
|
+
dfr: {
|
|
1013
|
+
...shared,
|
|
1014
|
+
temporalUpsampler: `${localDir}/latent_upscale_models/<temporal-upsampler>.safetensors`,
|
|
1015
|
+
},
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
function _ltx25BasePlaceholderPaths() {
|
|
1019
|
+
return {
|
|
1020
|
+
transformer: "path/to/distilled-transformer.safetensors",
|
|
1021
|
+
textEncoder: "path/to/gemma4-12b-with-proj-ltx-2.5-bf16.safetensors",
|
|
1022
|
+
videoVae: "path/to/video-vae.safetensors",
|
|
1023
|
+
audioVae: "path/to/audio-vae.safetensors",
|
|
1024
|
+
spatialUpsampler: "path/to/spatial-upsampler.safetensors",
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
function _ltx25Download(modelId, localDir, kind) {
|
|
1028
|
+
if (kind === "adapter") {
|
|
1029
|
+
return `# Download the adapter weights from this repo
|
|
1030
|
+
# (base components come from Lightricks/LTX-2.5 — see Files and versions)
|
|
1031
|
+
hf download ${modelId} --local-dir ${localDir}`;
|
|
1032
|
+
}
|
|
1033
|
+
const detailingDir = `models/${_LTX_DETAILING_LORA_REPO.split("/")[1]}`;
|
|
1034
|
+
return `# Download weights from this repo
|
|
1035
|
+
# Substitute filenames from this repo's "Files and versions" if they differ
|
|
1036
|
+
hf download ${modelId} \\
|
|
1037
|
+
diffusion_models/<distilled-transformer>.safetensors \\
|
|
1038
|
+
text_encoders/gemma4-12b-with-proj-ltx-2.5-bf16.safetensors \\
|
|
1039
|
+
vae/<video-vae>.safetensors \\
|
|
1040
|
+
vae/<audio-vae>.safetensors \\
|
|
1041
|
+
latent_upscale_models/<spatial-upsampler>.safetensors \\
|
|
1042
|
+
latent_upscale_models/<temporal-upsampler>.safetensors \\
|
|
1043
|
+
--local-dir ${localDir}
|
|
1044
|
+
# DFR requires the detailing IC-LoRA (separate repo; strength is fixed at 0.5)
|
|
1045
|
+
hf download ${_LTX_DETAILING_LORA_REPO} --local-dir ${detailingDir}`;
|
|
1046
|
+
}
|
|
1047
|
+
function _ltx23Download(modelId, localDir) {
|
|
1048
|
+
return `# Download the weights from this repo, plus the Gemma text encoder
|
|
1049
|
+
hf download ${modelId} --local-dir ${localDir}
|
|
1050
|
+
hf download google/gemma-3-12b-it-qat-q4_0-unquantized --local-dir ${_LTX_GEMMA3_ROOT}`;
|
|
1051
|
+
}
|
|
1052
|
+
function _ltx25Snippets(model, localDir, tags) {
|
|
1053
|
+
const install = _ltxInstall(true);
|
|
1054
|
+
const loraArg = `--lora ${localDir}/<weights>.safetensors 1.0`;
|
|
1055
|
+
const basePaths = _ltx25BasePlaceholderPaths();
|
|
1056
|
+
if (tags.includes("ic-lora")) {
|
|
1057
|
+
return [
|
|
1058
|
+
install,
|
|
1059
|
+
_ltx25Download(model.id, localDir, "adapter"),
|
|
1060
|
+
_ltxRun("ic_lora", [
|
|
1061
|
+
..._ltx25SplitArgs(basePaths),
|
|
1062
|
+
loraArg,
|
|
1063
|
+
"--video-conditioning reference.mp4 1.0",
|
|
1064
|
+
`--prompt "your prompt here"`,
|
|
1065
|
+
"--output-path output.mp4",
|
|
1066
|
+
], "Video-to-video with the IC-LoRA (runs on the distilled LTX-2.5 base)"),
|
|
1067
|
+
];
|
|
1068
|
+
}
|
|
1069
|
+
if (tags.includes("lora")) {
|
|
1070
|
+
return [
|
|
1071
|
+
install,
|
|
1072
|
+
_ltx25Download(model.id, localDir, "adapter"),
|
|
1073
|
+
_ltxRun("distilled", [..._ltx25SplitArgs(basePaths), loraArg, `--prompt "your prompt here"`, "--output-path output.mp4"], "Text/image-to-video with the LoRA on the distilled LTX-2.5 pipeline", { hint: true }),
|
|
1074
|
+
];
|
|
1075
|
+
}
|
|
1076
|
+
const { distilled, dfr } = _ltx25RepoPaths(localDir);
|
|
1077
|
+
const detailingDir = `models/${_LTX_DETAILING_LORA_REPO.split("/")[1]}`;
|
|
1078
|
+
return [
|
|
1079
|
+
install,
|
|
1080
|
+
_ltx25Download(model.id, localDir, "base"),
|
|
1081
|
+
_ltxRun("distilled", [
|
|
1082
|
+
..._ltx25SplitArgs(distilled),
|
|
1083
|
+
"--num-frames 121",
|
|
1084
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1085
|
+
"--output-path output.mp4",
|
|
1086
|
+
], "Distilled LTX-2.5 pipeline (fast)", { hint: true }),
|
|
1087
|
+
_ltxRun("dfr_pipeline", [
|
|
1088
|
+
..._ltx25SplitArgs(dfr),
|
|
1089
|
+
`--detailing-lora ${detailingDir}/${_LTX_DETAILING_LORA_FILE}`,
|
|
1090
|
+
"--spatial-upscalings 1",
|
|
1091
|
+
"--temporal-upscalings 1",
|
|
1092
|
+
"--height 1088",
|
|
1093
|
+
"--width 1920",
|
|
1094
|
+
"--num-frames 121",
|
|
1095
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1096
|
+
"--output-path output.mp4",
|
|
1097
|
+
], "DFR pipeline (higher detail fidelity; optional temporal 2x/4x)", {
|
|
1098
|
+
footer: "# For 4K: --spatial-upscalings 2 --width 3840 --height 2176",
|
|
1099
|
+
hint: true,
|
|
1100
|
+
}),
|
|
1101
|
+
];
|
|
1102
|
+
}
|
|
1103
|
+
function _ltx23Snippets(model, localDir, tags) {
|
|
1104
|
+
const install = _ltxInstall(false);
|
|
1105
|
+
const download = _ltx23Download(model.id, localDir);
|
|
1106
|
+
const loraArg = `--lora ${localDir}/<weights>.safetensors 1.0`;
|
|
1107
|
+
const gemma = `--gemma-root ${_LTX_GEMMA3_ROOT}`;
|
|
965
1108
|
if (tags.includes("ic-lora")) {
|
|
966
1109
|
return [
|
|
967
1110
|
install,
|
|
968
1111
|
download,
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1112
|
+
_ltxRun("ic_lora", [
|
|
1113
|
+
"--distilled-checkpoint-path path/to/distilled_checkpoint.safetensors",
|
|
1114
|
+
"--spatial-upsampler-path path/to/spatial_upsampler.safetensors",
|
|
1115
|
+
gemma,
|
|
1116
|
+
loraArg,
|
|
1117
|
+
"--video-conditioning reference.mp4 1.0",
|
|
1118
|
+
`--prompt "your prompt here"`,
|
|
1119
|
+
"--output-path output.mp4",
|
|
1120
|
+
], "Video-to-video with the IC-LoRA (runs on the distilled base model)"),
|
|
978
1121
|
];
|
|
979
1122
|
}
|
|
980
|
-
// Standard LoRA applied on top of the base pipeline.
|
|
981
1123
|
if (tags.includes("lora")) {
|
|
982
1124
|
return [
|
|
983
1125
|
install,
|
|
984
1126
|
download,
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
${imageToVideoHint}`,
|
|
1127
|
+
_ltxRun("ti2vid_two_stages_hq", [
|
|
1128
|
+
"--checkpoint-path path/to/checkpoint.safetensors",
|
|
1129
|
+
"--distilled-lora path/to/distilled_lora.safetensors 0.8",
|
|
1130
|
+
"--spatial-upsampler-path path/to/spatial_upsampler.safetensors",
|
|
1131
|
+
gemma,
|
|
1132
|
+
loraArg,
|
|
1133
|
+
`--prompt "your prompt here"`,
|
|
1134
|
+
"--output-path output.mp4",
|
|
1135
|
+
], "Text/image-to-video with the LoRA on the HQ two-stage base pipeline", { hint: true }),
|
|
995
1136
|
];
|
|
996
1137
|
}
|
|
997
|
-
// Base model: the fast (distilled) and HQ (two-stage) pipelines. Substitute the
|
|
998
|
-
// .safetensors filenames with the ones listed under this repo's "Files and versions".
|
|
999
1138
|
return [
|
|
1000
1139
|
install,
|
|
1001
1140
|
download,
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
--output-path output.mp4
|
|
1018
|
-
${imageToVideoHint}`,
|
|
1141
|
+
_ltxRun("distilled", [
|
|
1142
|
+
`--distilled-checkpoint-path ${localDir}/<distilled-checkpoint>.safetensors`,
|
|
1143
|
+
`--spatial-upsampler-path ${localDir}/<spatial-upsampler>.safetensors`,
|
|
1144
|
+
gemma,
|
|
1145
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1146
|
+
"--output-path output.mp4",
|
|
1147
|
+
], "Fast pipeline (distilled model, no distilled LoRA needed)", { hint: true }),
|
|
1148
|
+
_ltxRun("ti2vid_two_stages_hq", [
|
|
1149
|
+
`--checkpoint-path ${localDir}/<checkpoint>.safetensors`,
|
|
1150
|
+
`--distilled-lora ${localDir}/<distilled-lora>.safetensors 0.8`,
|
|
1151
|
+
`--spatial-upsampler-path ${localDir}/<spatial-upsampler>.safetensors`,
|
|
1152
|
+
gemma,
|
|
1153
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1154
|
+
"--output-path output.mp4",
|
|
1155
|
+
], "HQ pipeline (two-stage, higher quality)", { hint: true }),
|
|
1019
1156
|
];
|
|
1157
|
+
}
|
|
1158
|
+
export const ltx = (model) => {
|
|
1159
|
+
const localDir = `models/${nameWithoutNamespace(model.id)}`;
|
|
1160
|
+
const tags = model.tags ?? [];
|
|
1161
|
+
return _isLtx25Model(model) ? _ltx25Snippets(model, localDir, tags) : _ltx23Snippets(model, localDir, tags);
|
|
1020
1162
|
};
|
|
1021
1163
|
export const lightning_ir = (model) => {
|
|
1022
1164
|
if (model.tags.includes("bi-encoder")) {
|
|
@@ -2044,14 +2186,30 @@ model = BiRefNet.from_pretrained("${model.id}")`,
|
|
|
2044
2186
|
];
|
|
2045
2187
|
export const nobg = (model) => {
|
|
2046
2188
|
const installSnippet = `pip install nobg`;
|
|
2047
|
-
|
|
2189
|
+
// we check model tags and if it supports prompts we show an example for it, else we show the default example without prompts
|
|
2190
|
+
const predictCall = model.tags.includes("promptable")
|
|
2191
|
+
? `cutout = model.predict(processor, "image.jpg", "prompt")`
|
|
2192
|
+
: `cutout = model.predict(processor, "image.jpg")`;
|
|
2193
|
+
// snippet using the predict method
|
|
2194
|
+
const predictSnippet = `# Option 1: use via the predict method
|
|
2195
|
+
|
|
2196
|
+
from nobg import AutoModel, AutoProcessor
|
|
2197
|
+
|
|
2198
|
+
model = AutoModel.from_pretrained("${model.id}").eval()
|
|
2199
|
+
processor = AutoProcessor.from_pretrained("${model.id}")
|
|
2200
|
+
|
|
2201
|
+
${predictCall}`;
|
|
2202
|
+
// snippet using the model and processor directly
|
|
2203
|
+
const manualSnippet = `# Option 2: use the model and processor directly
|
|
2204
|
+
|
|
2205
|
+
import torch
|
|
2048
2206
|
from loadimg import load_img
|
|
2049
2207
|
from nobg import AutoModel, AutoProcessor
|
|
2050
2208
|
|
|
2051
2209
|
model = AutoModel.from_pretrained("${model.id}").eval()
|
|
2052
2210
|
processor = AutoProcessor.from_pretrained("${model.id}")
|
|
2053
2211
|
|
|
2054
|
-
image = load_img("
|
|
2212
|
+
image = load_img("image.jpg").convert("RGB")
|
|
2055
2213
|
inputs = processor(image, return_tensors="pt")
|
|
2056
2214
|
|
|
2057
2215
|
with torch.no_grad():
|
|
@@ -2059,7 +2217,7 @@ with torch.no_grad():
|
|
|
2059
2217
|
|
|
2060
2218
|
alpha = processor.post_process_alpha_matting(outputs, target_sizes=[(image.height, image.width)])[0]
|
|
2061
2219
|
processor.cutout(image, alpha).save("output.png")`;
|
|
2062
|
-
return [installSnippet,
|
|
2220
|
+
return [installSnippet, predictSnippet, manualSnippet];
|
|
2063
2221
|
};
|
|
2064
2222
|
export const supertonic = () => [
|
|
2065
2223
|
`from supertonic import TTS
|
|
@@ -760,7 +760,7 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
760
760
|
countDownloads: `path_extension:"pt"`,
|
|
761
761
|
},
|
|
762
762
|
ltx: {
|
|
763
|
-
prettyLabel: "LTX
|
|
763
|
+
prettyLabel: "LTX-2",
|
|
764
764
|
repoName: "LTX-2",
|
|
765
765
|
repoUrl: "https://github.com/Lightricks/LTX-2",
|
|
766
766
|
docsUrl: "https://github.com/Lightricks/LTX-2",
|
package/package.json
CHANGED
|
@@ -1036,83 +1036,288 @@ import soundfile as sf
|
|
|
1036
1036
|
sf.write('output.wav', audio, 24000)`,
|
|
1037
1037
|
];
|
|
1038
1038
|
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1039
|
+
/**
|
|
1040
|
+
* Detect LTX-2.5 (split weights + Gemma 4 TE file) vs LTX-2.3
|
|
1041
|
+
* (monolith checkpoint + separate Gemma 3 root). Prefer explicit tags / ids /
|
|
1042
|
+
* base_model refs; fall back to 2.3 for unmarked legacy cards.
|
|
1043
|
+
*/
|
|
1044
|
+
function _isLtx25Model(model: ModelData): boolean {
|
|
1045
|
+
const refs: string[] = [model.id, ...(model.tags ?? [])];
|
|
1046
|
+
const base = model.cardData?.base_model;
|
|
1047
|
+
if (Array.isArray(base)) {
|
|
1048
|
+
refs.push(...base);
|
|
1049
|
+
} else if (base) {
|
|
1050
|
+
refs.push(base);
|
|
1051
|
+
}
|
|
1052
|
+
return refs.some((ref) => /ltx[-_]?2\.5/i.test(ref));
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
const _LTX_I2V_HINT = `# For image-to-video, add: --image path/to/image.jpg 0 0.8`;
|
|
1056
|
+
const _LTX_GEMMA3_ROOT = "models/gemma-3-12b";
|
|
1057
|
+
const _LTX_DEFAULT_PROMPT = "A beautiful sunset over the ocean";
|
|
1058
|
+
|
|
1059
|
+
function _ltxInstall(is25: boolean): string {
|
|
1060
|
+
// natten is only needed for the LTX-2.5 diffusion VAE (skipped automatically on Windows/macOS).
|
|
1061
|
+
return `# Install the LTX-2 pipelines
|
|
1042
1062
|
git clone https://github.com/Lightricks/LTX-2.git
|
|
1043
1063
|
cd LTX-2
|
|
1044
|
-
uv sync --frozen`;
|
|
1064
|
+
uv sync ${is25 ? "--extra natten" : "--frozen"}`;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
function _ltxRun(
|
|
1068
|
+
module: string,
|
|
1069
|
+
args: string[],
|
|
1070
|
+
comment: string,
|
|
1071
|
+
options?: { hint?: boolean; footer?: string },
|
|
1072
|
+
): string {
|
|
1073
|
+
const body = `uv run python -m ltx_pipelines.${module} \\\n ${args.join(" \\\n ")}`;
|
|
1074
|
+
const parts = [`# ${comment}`, body];
|
|
1075
|
+
if (options?.footer) {
|
|
1076
|
+
parts.push(options.footer);
|
|
1077
|
+
}
|
|
1078
|
+
if (options?.hint) {
|
|
1079
|
+
parts.push(_LTX_I2V_HINT);
|
|
1080
|
+
}
|
|
1081
|
+
return parts.join("\n");
|
|
1082
|
+
}
|
|
1045
1083
|
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1084
|
+
interface Ltx25SplitPaths {
|
|
1085
|
+
transformer: string;
|
|
1086
|
+
textEncoder: string;
|
|
1087
|
+
videoVae: string;
|
|
1088
|
+
audioVae: string;
|
|
1089
|
+
spatialUpsampler: string;
|
|
1090
|
+
temporalUpsampler?: string;
|
|
1091
|
+
}
|
|
1050
1092
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
const imageToVideoHint = `# For image-to-video, add: --image path/to/image.jpg 0 0.8`;
|
|
1093
|
+
const _LTX_DETAILING_LORA_REPO = "Lightricks/LTX-2.5-22b-IC-LoRA-Pixel-Spatial-Upscaler";
|
|
1094
|
+
const _LTX_DETAILING_LORA_FILE = "ltx-2.5-22b-ic-lora-pixel-spatial-upscaler-x2-1.0.safetensors";
|
|
1054
1095
|
|
|
1055
|
-
|
|
1096
|
+
function _ltx25SplitArgs(paths: Ltx25SplitPaths): string[] {
|
|
1097
|
+
const args = [
|
|
1098
|
+
`--transformer-path ${paths.transformer}`,
|
|
1099
|
+
`--text-encoder-path ${paths.textEncoder}`,
|
|
1100
|
+
`--video-vae-path ${paths.videoVae}`,
|
|
1101
|
+
`--audio-vae-path ${paths.audioVae}`,
|
|
1102
|
+
`--spatial-upsampler-path ${paths.spatialUpsampler}`,
|
|
1103
|
+
];
|
|
1104
|
+
if (paths.temporalUpsampler) {
|
|
1105
|
+
args.push(`--temporal-upsampler-path ${paths.temporalUpsampler}`);
|
|
1106
|
+
}
|
|
1107
|
+
return args;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
function _ltx25RepoPaths(localDir: string): { distilled: Ltx25SplitPaths; dfr: Ltx25SplitPaths } {
|
|
1111
|
+
const shared = {
|
|
1112
|
+
transformer: `${localDir}/diffusion_models/<distilled-transformer>.safetensors`,
|
|
1113
|
+
textEncoder: `${localDir}/text_encoders/gemma4-12b-with-proj-ltx-2.5-bf16.safetensors`,
|
|
1114
|
+
videoVae: `${localDir}/vae/<video-vae>.safetensors`,
|
|
1115
|
+
audioVae: `${localDir}/vae/<audio-vae>.safetensors`,
|
|
1116
|
+
spatialUpsampler: `${localDir}/latent_upscale_models/<spatial-upsampler>.safetensors`,
|
|
1117
|
+
};
|
|
1118
|
+
return {
|
|
1119
|
+
distilled: shared,
|
|
1120
|
+
// DFR runs on the distilled transformer; detailing IC-LoRA is required separately.
|
|
1121
|
+
dfr: {
|
|
1122
|
+
...shared,
|
|
1123
|
+
temporalUpsampler: `${localDir}/latent_upscale_models/<temporal-upsampler>.safetensors`,
|
|
1124
|
+
},
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
function _ltx25BasePlaceholderPaths(): Ltx25SplitPaths {
|
|
1129
|
+
return {
|
|
1130
|
+
transformer: "path/to/distilled-transformer.safetensors",
|
|
1131
|
+
textEncoder: "path/to/gemma4-12b-with-proj-ltx-2.5-bf16.safetensors",
|
|
1132
|
+
videoVae: "path/to/video-vae.safetensors",
|
|
1133
|
+
audioVae: "path/to/audio-vae.safetensors",
|
|
1134
|
+
spatialUpsampler: "path/to/spatial-upsampler.safetensors",
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
function _ltx25Download(modelId: string, localDir: string, kind: "base" | "adapter"): string {
|
|
1139
|
+
if (kind === "adapter") {
|
|
1140
|
+
return `# Download the adapter weights from this repo
|
|
1141
|
+
# (base components come from Lightricks/LTX-2.5 — see Files and versions)
|
|
1142
|
+
hf download ${modelId} --local-dir ${localDir}`;
|
|
1143
|
+
}
|
|
1144
|
+
const detailingDir = `models/${_LTX_DETAILING_LORA_REPO.split("/")[1]}`;
|
|
1145
|
+
return `# Download weights from this repo
|
|
1146
|
+
# Substitute filenames from this repo's "Files and versions" if they differ
|
|
1147
|
+
hf download ${modelId} \\
|
|
1148
|
+
diffusion_models/<distilled-transformer>.safetensors \\
|
|
1149
|
+
text_encoders/gemma4-12b-with-proj-ltx-2.5-bf16.safetensors \\
|
|
1150
|
+
vae/<video-vae>.safetensors \\
|
|
1151
|
+
vae/<audio-vae>.safetensors \\
|
|
1152
|
+
latent_upscale_models/<spatial-upsampler>.safetensors \\
|
|
1153
|
+
latent_upscale_models/<temporal-upsampler>.safetensors \\
|
|
1154
|
+
--local-dir ${localDir}
|
|
1155
|
+
# DFR requires the detailing IC-LoRA (separate repo; strength is fixed at 0.5)
|
|
1156
|
+
hf download ${_LTX_DETAILING_LORA_REPO} --local-dir ${detailingDir}`;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
function _ltx23Download(modelId: string, localDir: string): string {
|
|
1160
|
+
return `# Download the weights from this repo, plus the Gemma text encoder
|
|
1161
|
+
hf download ${modelId} --local-dir ${localDir}
|
|
1162
|
+
hf download google/gemma-3-12b-it-qat-q4_0-unquantized --local-dir ${_LTX_GEMMA3_ROOT}`;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
function _ltx25Snippets(model: ModelData, localDir: string, tags: string[]): string[] {
|
|
1166
|
+
const install = _ltxInstall(true);
|
|
1167
|
+
const loraArg = `--lora ${localDir}/<weights>.safetensors 1.0`;
|
|
1168
|
+
const basePaths = _ltx25BasePlaceholderPaths();
|
|
1169
|
+
|
|
1170
|
+
if (tags.includes("ic-lora")) {
|
|
1171
|
+
return [
|
|
1172
|
+
install,
|
|
1173
|
+
_ltx25Download(model.id, localDir, "adapter"),
|
|
1174
|
+
_ltxRun(
|
|
1175
|
+
"ic_lora",
|
|
1176
|
+
[
|
|
1177
|
+
..._ltx25SplitArgs(basePaths),
|
|
1178
|
+
loraArg,
|
|
1179
|
+
"--video-conditioning reference.mp4 1.0",
|
|
1180
|
+
`--prompt "your prompt here"`,
|
|
1181
|
+
"--output-path output.mp4",
|
|
1182
|
+
],
|
|
1183
|
+
"Video-to-video with the IC-LoRA (runs on the distilled LTX-2.5 base)",
|
|
1184
|
+
),
|
|
1185
|
+
];
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
if (tags.includes("lora")) {
|
|
1189
|
+
return [
|
|
1190
|
+
install,
|
|
1191
|
+
_ltx25Download(model.id, localDir, "adapter"),
|
|
1192
|
+
_ltxRun(
|
|
1193
|
+
"distilled",
|
|
1194
|
+
[..._ltx25SplitArgs(basePaths), loraArg, `--prompt "your prompt here"`, "--output-path output.mp4"],
|
|
1195
|
+
"Text/image-to-video with the LoRA on the distilled LTX-2.5 pipeline",
|
|
1196
|
+
{ hint: true },
|
|
1197
|
+
),
|
|
1198
|
+
];
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
const { distilled, dfr } = _ltx25RepoPaths(localDir);
|
|
1202
|
+
const detailingDir = `models/${_LTX_DETAILING_LORA_REPO.split("/")[1]}`;
|
|
1203
|
+
return [
|
|
1204
|
+
install,
|
|
1205
|
+
_ltx25Download(model.id, localDir, "base"),
|
|
1206
|
+
_ltxRun(
|
|
1207
|
+
"distilled",
|
|
1208
|
+
[
|
|
1209
|
+
..._ltx25SplitArgs(distilled),
|
|
1210
|
+
"--num-frames 121",
|
|
1211
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1212
|
+
"--output-path output.mp4",
|
|
1213
|
+
],
|
|
1214
|
+
"Distilled LTX-2.5 pipeline (fast)",
|
|
1215
|
+
{ hint: true },
|
|
1216
|
+
),
|
|
1217
|
+
_ltxRun(
|
|
1218
|
+
"dfr_pipeline",
|
|
1219
|
+
[
|
|
1220
|
+
..._ltx25SplitArgs(dfr),
|
|
1221
|
+
`--detailing-lora ${detailingDir}/${_LTX_DETAILING_LORA_FILE}`,
|
|
1222
|
+
"--spatial-upscalings 1",
|
|
1223
|
+
"--temporal-upscalings 1",
|
|
1224
|
+
"--height 1088",
|
|
1225
|
+
"--width 1920",
|
|
1226
|
+
"--num-frames 121",
|
|
1227
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1228
|
+
"--output-path output.mp4",
|
|
1229
|
+
],
|
|
1230
|
+
"DFR pipeline (higher detail fidelity; optional temporal 2x/4x)",
|
|
1231
|
+
{
|
|
1232
|
+
footer: "# For 4K: --spatial-upscalings 2 --width 3840 --height 2176",
|
|
1233
|
+
hint: true,
|
|
1234
|
+
},
|
|
1235
|
+
),
|
|
1236
|
+
];
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
function _ltx23Snippets(model: ModelData, localDir: string, tags: string[]): string[] {
|
|
1240
|
+
const install = _ltxInstall(false);
|
|
1241
|
+
const download = _ltx23Download(model.id, localDir);
|
|
1242
|
+
const loraArg = `--lora ${localDir}/<weights>.safetensors 1.0`;
|
|
1243
|
+
const gemma = `--gemma-root ${_LTX_GEMMA3_ROOT}`;
|
|
1056
1244
|
|
|
1057
|
-
// IC-LoRA: video-to-video / image-to-video with a control (reference) signal.
|
|
1058
|
-
// Checked before "lora" because an IC-LoRA repo may carry both tags.
|
|
1059
1245
|
if (tags.includes("ic-lora")) {
|
|
1060
1246
|
return [
|
|
1061
1247
|
install,
|
|
1062
1248
|
download,
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1249
|
+
_ltxRun(
|
|
1250
|
+
"ic_lora",
|
|
1251
|
+
[
|
|
1252
|
+
"--distilled-checkpoint-path path/to/distilled_checkpoint.safetensors",
|
|
1253
|
+
"--spatial-upsampler-path path/to/spatial_upsampler.safetensors",
|
|
1254
|
+
gemma,
|
|
1255
|
+
loraArg,
|
|
1256
|
+
"--video-conditioning reference.mp4 1.0",
|
|
1257
|
+
`--prompt "your prompt here"`,
|
|
1258
|
+
"--output-path output.mp4",
|
|
1259
|
+
],
|
|
1260
|
+
"Video-to-video with the IC-LoRA (runs on the distilled base model)",
|
|
1261
|
+
),
|
|
1072
1262
|
];
|
|
1073
1263
|
}
|
|
1074
1264
|
|
|
1075
|
-
// Standard LoRA applied on top of the base pipeline.
|
|
1076
1265
|
if (tags.includes("lora")) {
|
|
1077
1266
|
return [
|
|
1078
1267
|
install,
|
|
1079
1268
|
download,
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1269
|
+
_ltxRun(
|
|
1270
|
+
"ti2vid_two_stages_hq",
|
|
1271
|
+
[
|
|
1272
|
+
"--checkpoint-path path/to/checkpoint.safetensors",
|
|
1273
|
+
"--distilled-lora path/to/distilled_lora.safetensors 0.8",
|
|
1274
|
+
"--spatial-upsampler-path path/to/spatial_upsampler.safetensors",
|
|
1275
|
+
gemma,
|
|
1276
|
+
loraArg,
|
|
1277
|
+
`--prompt "your prompt here"`,
|
|
1278
|
+
"--output-path output.mp4",
|
|
1279
|
+
],
|
|
1280
|
+
"Text/image-to-video with the LoRA on the HQ two-stage base pipeline",
|
|
1281
|
+
{ hint: true },
|
|
1282
|
+
),
|
|
1090
1283
|
];
|
|
1091
1284
|
}
|
|
1092
1285
|
|
|
1093
|
-
// Base model: the fast (distilled) and HQ (two-stage) pipelines. Substitute the
|
|
1094
|
-
// .safetensors filenames with the ones listed under this repo's "Files and versions".
|
|
1095
1286
|
return [
|
|
1096
1287
|
install,
|
|
1097
1288
|
download,
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
${
|
|
1289
|
+
_ltxRun(
|
|
1290
|
+
"distilled",
|
|
1291
|
+
[
|
|
1292
|
+
`--distilled-checkpoint-path ${localDir}/<distilled-checkpoint>.safetensors`,
|
|
1293
|
+
`--spatial-upsampler-path ${localDir}/<spatial-upsampler>.safetensors`,
|
|
1294
|
+
gemma,
|
|
1295
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1296
|
+
"--output-path output.mp4",
|
|
1297
|
+
],
|
|
1298
|
+
"Fast pipeline (distilled model, no distilled LoRA needed)",
|
|
1299
|
+
{ hint: true },
|
|
1300
|
+
),
|
|
1301
|
+
_ltxRun(
|
|
1302
|
+
"ti2vid_two_stages_hq",
|
|
1303
|
+
[
|
|
1304
|
+
`--checkpoint-path ${localDir}/<checkpoint>.safetensors`,
|
|
1305
|
+
`--distilled-lora ${localDir}/<distilled-lora>.safetensors 0.8`,
|
|
1306
|
+
`--spatial-upsampler-path ${localDir}/<spatial-upsampler>.safetensors`,
|
|
1307
|
+
gemma,
|
|
1308
|
+
`--prompt "${_LTX_DEFAULT_PROMPT}"`,
|
|
1309
|
+
"--output-path output.mp4",
|
|
1310
|
+
],
|
|
1311
|
+
"HQ pipeline (two-stage, higher quality)",
|
|
1312
|
+
{ hint: true },
|
|
1313
|
+
),
|
|
1115
1314
|
];
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
export const ltx = (model: ModelData): string[] => {
|
|
1318
|
+
const localDir = `models/${nameWithoutNamespace(model.id)}`;
|
|
1319
|
+
const tags = model.tags ?? [];
|
|
1320
|
+
return _isLtx25Model(model) ? _ltx25Snippets(model, localDir, tags) : _ltx23Snippets(model, localDir, tags);
|
|
1116
1321
|
};
|
|
1117
1322
|
|
|
1118
1323
|
export const lightning_ir = (model: ModelData): string[] => {
|
|
@@ -2281,15 +2486,30 @@ model = BiRefNet.from_pretrained("${model.id}")`,
|
|
|
2281
2486
|
|
|
2282
2487
|
export const nobg = (model: ModelData): string[] => {
|
|
2283
2488
|
const installSnippet = `pip install nobg`;
|
|
2489
|
+
// we check model tags and if it supports prompts we show an example for it, else we show the default example without prompts
|
|
2490
|
+
const predictCall = model.tags.includes("promptable")
|
|
2491
|
+
? `cutout = model.predict(processor, "image.jpg", "prompt")`
|
|
2492
|
+
: `cutout = model.predict(processor, "image.jpg")`;
|
|
2493
|
+
// snippet using the predict method
|
|
2494
|
+
const predictSnippet = `# Option 1: use via the predict method
|
|
2284
2495
|
|
|
2285
|
-
|
|
2496
|
+
from nobg import AutoModel, AutoProcessor
|
|
2497
|
+
|
|
2498
|
+
model = AutoModel.from_pretrained("${model.id}").eval()
|
|
2499
|
+
processor = AutoProcessor.from_pretrained("${model.id}")
|
|
2500
|
+
|
|
2501
|
+
${predictCall}`;
|
|
2502
|
+
// snippet using the model and processor directly
|
|
2503
|
+
const manualSnippet = `# Option 2: use the model and processor directly
|
|
2504
|
+
|
|
2505
|
+
import torch
|
|
2286
2506
|
from loadimg import load_img
|
|
2287
2507
|
from nobg import AutoModel, AutoProcessor
|
|
2288
2508
|
|
|
2289
2509
|
model = AutoModel.from_pretrained("${model.id}").eval()
|
|
2290
2510
|
processor = AutoProcessor.from_pretrained("${model.id}")
|
|
2291
2511
|
|
|
2292
|
-
image = load_img("
|
|
2512
|
+
image = load_img("image.jpg").convert("RGB")
|
|
2293
2513
|
inputs = processor(image, return_tensors="pt")
|
|
2294
2514
|
|
|
2295
2515
|
with torch.no_grad():
|
|
@@ -2298,7 +2518,7 @@ with torch.no_grad():
|
|
|
2298
2518
|
alpha = processor.post_process_alpha_matting(outputs, target_sizes=[(image.height, image.width)])[0]
|
|
2299
2519
|
processor.cutout(image, alpha).save("output.png")`;
|
|
2300
2520
|
|
|
2301
|
-
return [installSnippet,
|
|
2521
|
+
return [installSnippet, predictSnippet, manualSnippet];
|
|
2302
2522
|
};
|
|
2303
2523
|
|
|
2304
2524
|
export const supertonic = (): string[] => [
|
package/src/model-libraries.ts
CHANGED
|
@@ -804,7 +804,7 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
|
|
|
804
804
|
countDownloads: `path_extension:"pt"`,
|
|
805
805
|
},
|
|
806
806
|
ltx: {
|
|
807
|
-
prettyLabel: "LTX
|
|
807
|
+
prettyLabel: "LTX-2",
|
|
808
808
|
repoName: "LTX-2",
|
|
809
809
|
repoUrl: "https://github.com/Lightricks/LTX-2",
|
|
810
810
|
docsUrl: "https://github.com/Lightricks/LTX-2",
|