linoyts HF Staff commited on
Commit
76c0773
·
verified ·
1 Parent(s): 8acf492
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -45,6 +45,17 @@ pipe = WanImageToVideoPipeline.from_pretrained(MODEL_ID,
45
  torch_dtype=torch.bfloat16,
46
  ).to('cuda')
47
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
  optimize_pipeline_(pipe,
50
  image=Image.new('RGB', (LANDSCAPE_WIDTH, LANDSCAPE_HEIGHT)),
 
45
  torch_dtype=torch.bfloat16,
46
  ).to('cuda')
47
 
48
+ # load, fuse, unload before compilation
49
+ pipe.load_lora_weights(
50
+ "vrgamedevgirl84/Wan14BT2VFusioniX",
51
+ weight_name="FusionX_LoRa/Phantom_Wan_14B_FusionX_LoRA.safetensors",
52
+ adapter_name="phantom"
53
+ )
54
+
55
+ pipeline.set_adapters(["phantom"], adapter_weights=[0.95])
56
+ pipeline.fuse_lora(adapter_names=["phantom"], lora_scale=1.0)
57
+ pipeline.unload_lora_weights()
58
+
59
 
60
  optimize_pipeline_(pipe,
61
  image=Image.new('RGB', (LANDSCAPE_WIDTH, LANDSCAPE_HEIGHT)),