LTX-Video

Whilst we wait for Hunyuan Video.
This commit is contained in:
City
2024-12-08 00:48:59 +01:00
parent 851564739d
commit 23b9817081
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ def gguf_sd_loader(path, handle_prefix="model.diffusion_model."):
if len(arch_field.types) != 1 or arch_field.types[0] != gguf.GGUFValueType.STRING:
raise TypeError(f"Bad type for GGUF general.architecture key: expected string, got {arch_field.types!r}")
arch_str = str(arch_field.parts[arch_field.data[-1]], encoding="utf-8")
if arch_str not in {"flux", "sd1", "sdxl", "sd3", "aura", "t5", "t5encoder"}:
if arch_str not in {"flux", "sd1", "sdxl", "sd3", "aura", "ltxv", "t5", "t5encoder"}:
raise ValueError(f"Unexpected architecture type in GGUF file, expected one of flux, sd1, sdxl, t5encoder but got {arch_str!r}")
else: # stable-diffusion.cpp
# import here to avoid changes to convert.py breaking regular models
+11 -1
View File
@@ -41,6 +41,16 @@ class ModelAura(ModelTemplate):
]
keys_banned = ["joint_transformer_blocks.3.ff_context.out_projection.weight",]
class ModelLTXV(ModelTemplate):
arch = "ltxv"
keys_detect = [
(
"adaln_single.emb.timestep_embedder.linear_2.weight",
"transformer_blocks.27.scale_shift_table",
"caption_projection.linear_2.weight",
)
]
class ModelSDXL(ModelTemplate):
arch = "sdxl"
shape_fix = True
@@ -65,7 +75,7 @@ class ModelSD1(ModelTemplate):
]
# The architectures are checked in order and the first successful match terminates the search.
arch_list = [ModelFlux, ModelSD3, ModelAura, ModelSDXL, ModelSD1]
arch_list = [ModelFlux, ModelSD3, ModelAura, ModelLTXV, ModelSDXL, ModelSD1]
def is_model_arch(model, state_dict):
# check if model is correct