Skip to content

Commit

Permalink
LTX-Video
Browse files Browse the repository at this point in the history
Whilst we wait for Hunyuan Video.
  • Loading branch information
city96 committed Dec 7, 2024
1 parent 8515647 commit 23b9817
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion tools/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 23b9817

Please sign in to comment.