vclmax2 commited on
Commit
38d6dff
·
verified ·
1 Parent(s): af120d1

Restore LoRA strength to 0.8

Browse files
Files changed (1) hide show
  1. app.py +19 -5
app.py CHANGED
@@ -78,6 +78,8 @@ from ltx_pipelines.utils.helpers import (
78
  )
79
  from ltx_pipelines.utils.media_io import decode_audio_from_file, encode_video
80
  from ltx_pipelines.utils.types import PipelineComponents
 
 
81
 
82
  # --- Attention backend patch (same as Element-16) ---
83
  import torch.nn.functional as F
@@ -303,14 +305,22 @@ def download_upsampler():
303
  def download_gemma():
304
  return snapshot_download(repo_id=GEMMA_REPO)
305
 
306
- with ThreadPoolExecutor(max_workers=3) as executor:
 
 
 
 
 
 
307
  f_ckpt = executor.submit(download_checkpoint)
308
  f_upsampler = executor.submit(download_upsampler)
309
  f_gemma = executor.submit(download_gemma)
 
310
 
311
- checkpoint_path = f_ckpt.result()
312
- upsampler_path = f_upsampler.result()
313
- gemma_root = f_gemma.result()
 
314
 
315
  print(f"Checkpoint: {checkpoint_path}")
316
  print(f"Spatial upsampler: {upsampler_path}")
@@ -320,7 +330,11 @@ pipeline = DistilledAudioGuidancePipeline(
320
  distilled_checkpoint_path=checkpoint_path,
321
  spatial_upsampler_path=upsampler_path,
322
  gemma_root=gemma_root,
323
- loras=(),
 
 
 
 
324
  )
325
 
326
  # Preload all models for ZeroGPU tensor packing
 
78
  )
79
  from ltx_pipelines.utils.media_io import decode_audio_from_file, encode_video
80
  from ltx_pipelines.utils.types import PipelineComponents
81
+ from ltx_core.loader.primitives import LoraPathStrengthAndSDOps
82
+ from ltx_core.loader.sd_ops import LTXV_LORA_COMFY_RENAMING_MAP
83
 
84
  # --- Attention backend patch (same as Element-16) ---
85
  import torch.nn.functional as F
 
305
  def download_gemma():
306
  return snapshot_download(repo_id=GEMMA_REPO)
307
 
308
+ def download_talking_head_lora():
309
+ return hf_hub_download(
310
+ repo_id="elix3r/LTX-2.3-22b-AV-LoRA-talking-head",
311
+ filename="LTX-2.3-22b-AV-LoRA-talking-head-v1.safetensors"
312
+ )
313
+
314
+ with ThreadPoolExecutor(max_workers=4) as executor:
315
  f_ckpt = executor.submit(download_checkpoint)
316
  f_upsampler = executor.submit(download_upsampler)
317
  f_gemma = executor.submit(download_gemma)
318
+ f_lora = executor.submit(download_talking_head_lora)
319
 
320
+ checkpoint_path = f_ckpt.result()
321
+ upsampler_path = f_upsampler.result()
322
+ gemma_root = f_gemma.result()
323
+ talking_head_lora = f_lora.result()
324
 
325
  print(f"Checkpoint: {checkpoint_path}")
326
  print(f"Spatial upsampler: {upsampler_path}")
 
330
  distilled_checkpoint_path=checkpoint_path,
331
  spatial_upsampler_path=upsampler_path,
332
  gemma_root=gemma_root,
333
+ loras=(LoraPathStrengthAndSDOps(
334
+ path=talking_head_lora,
335
+ strength=0.8,
336
+ sd_ops=LTXV_LORA_COMFY_RENAMING_MAP
337
+ ),),
338
  )
339
 
340
  # Preload all models for ZeroGPU tensor packing