fix load lora

This commit is contained in:
mi804
2026-02-10 15:06:04 +08:00
parent 888caf8b88
commit 2f22e598b7
14 changed files with 42 additions and 84 deletions

View File

@@ -1,7 +1,6 @@
import torch
from diffsynth.pipelines.ltx2_audio_video import LTX2AudioVideoPipeline, ModelConfig
from diffsynth.utils.data.media_io_ltx2 import write_video_audio_ltx2
from modelscope import snapshot_download
vram_config = {
"offload_dtype": torch.bfloat16,
@@ -24,12 +23,10 @@ pipe = LTX2AudioVideoPipeline.from_pretrained(
tokenizer_config=ModelConfig(model_id="google/gemma-3-12b-it-qat-q4_0-unquantized"),
stage2_lora_config=ModelConfig(model_id="Lightricks/LTX-2", origin_file_pattern="ltx-2-19b-distilled-lora-384.safetensors"),
)
snapshot_download(
"Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-In",
local_dir="models/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-In",
allow_file_pattern="ltx-2-19b-lora-camera-control-dolly-in.safetensors",
pipe.load_lora(
pipe.dit,
ModelConfig(model_id="Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-In", origin_file_pattern="ltx-2-19b-lora-camera-control-dolly-in.safetensors"),
)
pipe.load_lora(pipe.dit, "models/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-In/ltx-2-19b-lora-camera-control-dolly-in.safetensors", alpha=1.0, hotload=True)
prompt = "Dolly-in shot: A cheerful girl smiles brightly and says, 'I enjoy working with Diffsynth-Studio, it's a perfect framework.' The camera smoothly moves closer to her face, highlighting her enthusiasm and sincerity."
negative_prompt = (