Fix LTX pipeline class name: use LTXPipeline instead of LTXVideoPipeline

- The correct class name in diffusers is LTXPipeline, not LTXVideoPipeline
- Updated PIPELINE_CLASS_MAP and detect_pipeline_class
- Updated all references throughout the codebase
- This fixes loading models like Muinez/ltxvideo-2b-nsfw
parent 49cca317
...@@ -581,7 +581,7 @@ PIPELINE_CLASS_MAP = { ...@@ -581,7 +581,7 @@ PIPELINE_CLASS_MAP = {
"StableVideoDiffusionPipeline": {"type": "i2v", "default_vram": "~14-18 GB"}, "StableVideoDiffusionPipeline": {"type": "i2v", "default_vram": "~14-18 GB"},
"WanPipeline": {"type": "video", "default_vram": "~10-24 GB"}, "WanPipeline": {"type": "video", "default_vram": "~10-24 GB"},
"I2VGenXLPipeline": {"type": "i2v", "default_vram": "~18-24 GB"}, "I2VGenXLPipeline": {"type": "i2v", "default_vram": "~18-24 GB"},
"LTXVideoPipeline": {"type": "i2v", "default_vram": "~12-16 GB"}, "LTXPipeline": {"type": "i2v", "default_vram": "~12-16 GB"},
"AnimateDiffPipeline": {"type": "video", "default_vram": "~10-14 GB"}, "AnimateDiffPipeline": {"type": "video", "default_vram": "~10-14 GB"},
"TextToVideoSDPipeline": {"type": "t2v", "default_vram": "~7-9 GB"}, "TextToVideoSDPipeline": {"type": "t2v", "default_vram": "~7-9 GB"},
"TextToVideoZeroPipeline": {"type": "t2v", "default_vram": "~6-8 GB"}, "TextToVideoZeroPipeline": {"type": "t2v", "default_vram": "~6-8 GB"},
...@@ -941,7 +941,7 @@ def detect_pipeline_class(model_info): ...@@ -941,7 +941,7 @@ def detect_pipeline_class(model_info):
if "i2vgen" in model_id: if "i2vgen" in model_id:
return "I2VGenXLPipeline" return "I2VGenXLPipeline"
if "ltx-video" in model_id or "ltxvideo" in model_id: if "ltx-video" in model_id or "ltxvideo" in model_id:
return "LTXVideoPipeline" return "LTXPipeline"
if "animatediff" in model_id: if "animatediff" in model_id:
return "AnimateDiffPipeline" return "AnimateDiffPipeline"
if "mochi" in model_id: if "mochi" in model_id:
...@@ -1791,7 +1791,7 @@ def update_all_models(hf_token=None): ...@@ -1791,7 +1791,7 @@ def update_all_models(hf_token=None):
is_nsfw_model = m["is_nsfw"] is_nsfw_model = m["is_nsfw"]
is_known_pipeline = m["pipeline_class"] in ["WanPipeline", "MochiPipeline", "CogVideoXPipeline", is_known_pipeline = m["pipeline_class"] in ["WanPipeline", "MochiPipeline", "CogVideoXPipeline",
"StableVideoDiffusionPipeline", "I2VGenXLPipeline", "StableVideoDiffusionPipeline", "I2VGenXLPipeline",
"LTXVideoPipeline", "AnimateDiffPipeline", "LTXPipeline", "AnimateDiffPipeline",
"TextToVideoSDPipeline", "TextToVideoZeroPipeline", "TextToVideoSDPipeline", "TextToVideoZeroPipeline",
"HotshotXLPipeline", "AllegroPipeline", "HotshotXLPipeline", "AllegroPipeline",
"HunyuanDiTPipeline", "OpenSoraPipeline", "HunyuanDiTPipeline", "OpenSoraPipeline",
...@@ -1894,7 +1894,7 @@ def update_all_models(hf_token=None): ...@@ -1894,7 +1894,7 @@ def update_all_models(hf_token=None):
is_nsfw_model = m["is_nsfw"] is_nsfw_model = m["is_nsfw"]
is_known_pipeline = m["pipeline_class"] in ["WanPipeline", "MochiPipeline", "CogVideoXPipeline", is_known_pipeline = m["pipeline_class"] in ["WanPipeline", "MochiPipeline", "CogVideoXPipeline",
"StableVideoDiffusionPipeline", "I2VGenXLPipeline", "StableVideoDiffusionPipeline", "I2VGenXLPipeline",
"LTXVideoPipeline", "AnimateDiffPipeline", "LTXPipeline", "AnimateDiffPipeline",
"TextToVideoSDPipeline", "TextToVideoZeroPipeline", "TextToVideoSDPipeline", "TextToVideoZeroPipeline",
"HotshotXLPipeline", "AllegroPipeline", "HotshotXLPipeline", "AllegroPipeline",
"HunyuanDiTPipeline", "OpenSoraPipeline", "HunyuanDiTPipeline", "OpenSoraPipeline",
...@@ -2173,7 +2173,7 @@ def get_pipeline_class(class_name): ...@@ -2173,7 +2173,7 @@ def get_pipeline_class(class_name):
# Try alternative names for known pipelines # Try alternative names for known pipelines
alternatives = { alternatives = {
"LTXVideoPipeline": ["LTXLatentVideoToVideoPipeline", "LTXImageToVideoPipeline"], "LTXPipeline": ["LTXLatentUpsamplePipeline", "LTXImageToVideoPipeline"],
"StableVideoDiffusionPipeline": ["StableVideoDiffusionImg2VidPipeline"], "StableVideoDiffusionPipeline": ["StableVideoDiffusionImg2VidPipeline"],
"CogVideoXPipeline": ["CogVideoXImageToVideoPipeline", "CogVideoXVideoToVideoPipeline"], "CogVideoXPipeline": ["CogVideoXImageToVideoPipeline", "CogVideoXVideoToVideoPipeline"],
"MochiPipeline": ["Mochi1Pipeline", "MochiVideoPipeline"], "MochiPipeline": ["Mochi1Pipeline", "MochiVideoPipeline"],
...@@ -2430,7 +2430,7 @@ class TimingTracker: ...@@ -2430,7 +2430,7 @@ class TimingTracker:
base_time_per_frame = 2.5 # SVD is relatively fast but still ~25 steps base_time_per_frame = 2.5 # SVD is relatively fast but still ~25 steps
elif "CogVideoXPipeline" in model_class: elif "CogVideoXPipeline" in model_class:
base_time_per_frame = 6.0 # CogVideoX 5B is slow base_time_per_frame = 6.0 # CogVideoX 5B is slow
elif "LTXVideoPipeline" in model_class or "ltx" in model_id: elif "LTXPipeline" in model_class or "ltx" in model_id:
base_time_per_frame = 6.0 # LTX is moderate-slow, ~25 steps base_time_per_frame = 6.0 # LTX is moderate-slow, ~25 steps
elif "FluxPipeline" in model_class: elif "FluxPipeline" in model_class:
base_time_per_frame = 12.0 # Flux is slow for images (~20-30 steps) base_time_per_frame = 12.0 # Flux is slow for images (~20-30 steps)
...@@ -7320,7 +7320,7 @@ def main(args): ...@@ -7320,7 +7320,7 @@ def main(args):
print(f" ... and {len(available_pipelines) - 15} more") print(f" ... and {len(available_pipelines) - 15} more")
# Provide specific guidance for known pipelines # Provide specific guidance for known pipelines
if pipeline_class == "LTXVideoPipeline": if pipeline_class == "LTXPipeline":
print(f"\n 📦 LTX Video pipelines in diffusers:") print(f"\n 📦 LTX Video pipelines in diffusers:")
ltx_pipelines = [name for name in dir(diffusers) if 'LTX' in name] ltx_pipelines = [name for name in dir(diffusers) if 'LTX' in name]
if ltx_pipelines: if ltx_pipelines:
...@@ -7669,7 +7669,7 @@ def main(args): ...@@ -7669,7 +7669,7 @@ def main(args):
elif "svd" in model_id_lower or "stable-video-diffusion" in model_id_lower: elif "svd" in model_id_lower or "stable-video-diffusion" in model_id_lower:
detected_class = "StableVideoDiffusionPipeline" detected_class = "StableVideoDiffusionPipeline"
elif "ltx" in model_id_lower: elif "ltx" in model_id_lower:
detected_class = "LTXVideoPipeline" detected_class = "LTXPipeline"
elif "mochi" in model_id_lower: elif "mochi" in model_id_lower:
detected_class = "MochiPipeline" detected_class = "MochiPipeline"
elif "cogvideo" in model_id_lower: elif "cogvideo" in model_id_lower:
...@@ -8388,13 +8388,21 @@ def main(args): ...@@ -8388,13 +8388,21 @@ def main(args):
BasePipelineClass = None BasePipelineClass = None
if "LTX-Video" in base_model or "ltx" in base_model.lower(): if "LTX-Video" in base_model or "ltx" in base_model.lower():
try: try:
from diffusers import LTXVideoPipeline from diffusers import LTXPipeline
BasePipelineClass = LTXVideoPipeline BasePipelineClass = LTXPipeline
if debug: if debug:
print(f" [DEBUG] Using LTXVideoPipeline for base model") print(f" [DEBUG] Using LTXPipeline for base model")
except ImportError: except ImportError as ie:
if debug:
print(f" [DEBUG] LTXPipeline not available: {ie}")
# Try alternative names
try:
from diffusers import LTXImageToVideoPipeline
BasePipelineClass = LTXImageToVideoPipeline
if debug: if debug:
print(f" [DEBUG] LTXVideoPipeline not available, trying generic") print(f" [DEBUG] Using LTXImageToVideoPipeline for base model")
except ImportError:
pass
elif "Wan" in base_model or "wan" in base_model.lower(): elif "Wan" in base_model or "wan" in base_model.lower():
try: try:
from diffusers import WanPipeline from diffusers import WanPipeline
...@@ -8460,8 +8468,13 @@ def main(args): ...@@ -8460,8 +8468,13 @@ def main(args):
FallbackPipelineClass = None FallbackPipelineClass = None
if "LTX-Video" in base_model or "ltx" in base_model.lower(): if "LTX-Video" in base_model or "ltx" in base_model.lower():
try: try:
from diffusers import LTXVideoPipeline from diffusers import LTXPipeline
FallbackPipelineClass = LTXVideoPipeline FallbackPipelineClass = LTXPipeline
except ImportError:
# Try alternative names
try:
from diffusers import LTXImageToVideoPipeline
FallbackPipelineClass = LTXImageToVideoPipeline
except ImportError: except ImportError:
pass pass
elif "Wan" in base_model or "wan" in base_model.lower(): elif "Wan" in base_model or "wan" in base_model.lower():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment