Views
No views yet
cfg_scale=1sigma_shift=10lora_alpha value to control the influence of the LoRA on generation results.cfg_scale=1 and sigma_shift=10.| Without LoRA | With LoRA |
|---|---|
| Without LoRA | With LoRA |
|---|---|
pip install diffsynth1import torch
2from diffsynth import ModelManager, WanVideoPipeline, save_video
3from modelscope import snapshot_download1snapshot_download(
2 model_id="DiffSynth-Studio/Wan2.1-1.3b-lora-aesthetics-v1",
3 local_dir="models/DiffSynth-Studio/Wan2.1-1.3b-lora-aesthetics-v1",
4 allow_file_pattern="*.safetensors"
5)
6model_manager = ModelManager(device="cpu")
7model_manager.load_models(
8 [
9 "models/Wan-AI/Wan2.1-T2V-1.3B/diffusion_pytorch_model.safetensors",
10 "models/Wan-AI/Wan2.1-T2V-1.3B/models_t5_umt5-xxl-enc-bf16.pth",
11 "models/Wan-AI/Wan2.1-T2V-1.3B/Wan2.1_VAE.pth",
12 ],
13 torch_dtype=torch.bfloat16,
14)
15model_manager.load_lora("models/DiffSynth-Studio/Wan2.1-1.3b-lora-aesthetics-v1/model.safetensors", lora_alpha=1)
16pipe = WanVideoPipeline.from_model_manager(model_manager, torch_dtype=torch.bfloat16, device="cuda")
17pipe.enable_vram_management(num_persistent_param_in_dit=None)
18
19video = pipe(
20 prompt="A tranquil tropical beach scene at sunset, with palm trees, flower-covered rocky cliffs, and gentle waves",
21 num_inference_steps=50,
22 seed=1,
23 tiled=True,
24 cfg_scale=1,
25 sigma_shift=10,
26)
27save_video(video, "video.mp4", fps=15, quality=5)