LightX2V icon indicating copy to clipboard operation
LightX2V copied to clipboard

is this structure correct ?

Open MohamedAliRashad opened this issue 1 month ago • 2 comments

I am trying to load HunyuanVideo-1.5 using LightX2V and i structered this repo to have everything required:

https://huggingface.co/MohamedRashad/HunyuanVideo-1.5-complete/tree/main

but the problem is that it still gives me error

Exit code: 1. Reason: ightx2v/pipeline.py", line 137, in create_generator
    self.runner = self._init_runner(config)
  File "/usr/local/lib/python3.10/site-packages/lightx2v/pipeline.py", line 353, in _init_runner
    runner.init_modules()
  File "/usr/local/lib/python3.10/site-packages/lightx2v/models/runners/default_runner.py", line 40, in init_modules
    self.load_model()
  File "/usr/local/lib/python3.10/site-packages/lightx2v/utils/profiler.py", line 77, in sync_wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/lightx2v/models/runners/default_runner.py", line 89, in load_model
    self.text_encoders = self.load_text_encoder()
  File "/usr/local/lib/python3.10/site-packages/lightx2v/models/runners/hunyuan_video/hunyuan_video_15_runner.py", line 82, in load_text_encoder
    text_encoder = Qwen25VL_TextEncoder(
  File "/usr/local/lib/python3.10/site-packages/lightx2v/models/input_encoders/hf/hunyuan15/qwen25/model.py", line 566, in __init__
    self.text_encoder = TextEncoder(
  File "/usr/local/lib/python3.10/site-packages/lightx2v/models/input_encoders/hf/hunyuan15/qwen25/model.py", line 275, in __init__
    self.tokenizer, self.tokenizer_path, self.processor = load_tokenizer(
  File "/usr/local/lib/python3.10/site-packages/lightx2v/models/input_encoders/hf/hunyuan15/qwen25/model.py", line 176, in load_tokenizer
    tokenizer = AutoTokenizer.from_pretrained(tokenizer_path, padding_side=padding_side)
  File "/usr/local/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 1156, in from_pretrained
    return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2112, in from_pretrained
    return cls._from_pretrained(
  File "/usr/local/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2419, in _from_pretrained
    if _is_local and _config.model_type not in [
AttributeError: 'dict' object has no attribute 'model_type'

This is the code:

# Download main model with specific patterns
model_path = snapshot_download(
    repo_id="MohamedRashad/HunyuanVideo-1.5-complete",
    allow_patterns=[
        "transformer/720p_i2v/*",
        "text_encoder/*",
        "vae/*",
        "scheduler/*",
        "upsampler/*",
        "config.json",
    ]
)

# Initialize pipeline without image_path (will be set per request)
pipe = LightX2VPipeline(
    model_path=model_path,
    model_cls="hunyuan_video_1.5",
    transformer_model_name="720p_i2v",
    task="i2v",
)

# Create generator once during initialization
pipe.create_generator(
    attn_mode="flash_attn2",  # Using standard flash attention (sage_attn2 requires sageattention package)
    infer_steps=50,
    num_frames=121,
    guidance_scale=6.0,
    sample_shift=9.0,
    aspect_ratio="16:9",
    fps=24,
)

MohamedAliRashad avatar Nov 25 '25 19:11 MohamedAliRashad