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-Left",
local_dir="models/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-Left",
allow_file_pattern="ltx-2-19b-lora-camera-control-dolly-left.safetensors",
pipe.load_lora(
pipe.dit,
ModelConfig(model_id="Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-Left", origin_file_pattern="ltx-2-19b-lora-camera-control-dolly-left.safetensors"),
)
pipe.load_lora(pipe.dit, "models/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-Left/ltx-2-19b-lora-camera-control-dolly-left.safetensors", alpha=1.0, hotload=True)
prompt = "Dolly-left shot: A joyful young woman sits at a minimalist desk with a laptop running Diffsynth-Studio, code and generative visuals glowing on screen. She turns slightly toward the camera and says with a smile, 'I enjoy working with Diffsynth-Studio, it's a perfect framework.' As she speaks, the camera smoothly dollies left, revealing a wall of framed open-source project posters, a whiteboard covered in neural network sketches, and a shelf stacked with AI/graphics books beside her."
negative_prompt = (