dagloop5 commited on
Commit
0881456
·
verified ·
1 Parent(s): a376df0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -185,7 +185,10 @@ class LTX23NegativePromptTwoStagePipeline:
185
  ctx_p, ctx_n = self.prompt_encoder(
186
  [prompt, negative_prompt],
187
  enhance_first_prompt=enhance_prompt,
188
- enhance_prompt_image=images[0][0] if len(images) > 0 else None,
 
 
 
189
  enhance_prompt_seed=seed,
190
  streaming_prefetch_count=streaming_prefetch_count,
191
  )
@@ -354,6 +357,15 @@ print(f"Checkpoint: {checkpoint_path}")
354
  print(f"Spatial upsampler: {spatial_upsampler_path}")
355
  print(f"Gemma root: {gemma_root}")
356
 
 
 
 
 
 
 
 
 
 
357
  # Initialize pipeline WITH text encoder and optional audio support
358
  # ---- Replace block (pipeline init) lines 275-281 ----
359
  pipeline = LTX23NegativePromptTwoStagePipeline(
@@ -380,7 +392,7 @@ def _make_lora_key(pose_strength: float, general_strength: float, motion_strengt
380
  rt = round(float(transition_strength), 2)
381
  key_str = f"{pose_lora_path}:{rp}|{general_lora_path}:{rg}|{motion_lora_path}:{rm}|{dreamlay_lora_path}:{rd}|{mself_lora_path}:{rs}|{dramatic_lora_path}:{rr}|{fluid_lora_path}:{rf}|{liquid_lora_path}:{rl}|{demopose_lora_path}:{ro}|{voice_lora_path}:{rv}|{realism_lora_path}:{re}|{transition_lora_path}:{rt}"
382
  key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
383
- return key, key_str
384
 
385
 
386
  def prepare_lora_cache(
 
185
  ctx_p, ctx_n = self.prompt_encoder(
186
  [prompt, negative_prompt],
187
  enhance_first_prompt=enhance_prompt,
188
+ enhance_prompt_image=(
189
+ __import__('PIL.Image', fromlist=['Image']).open(images[0].path)
190
+ if (len(images) > 0 and enhance_prompt) else None
191
+ ),
192
  enhance_prompt_seed=seed,
193
  streaming_prefetch_count=streaming_prefetch_count,
194
  )
 
357
  print(f"Spatial upsampler: {spatial_upsampler_path}")
358
  print(f"Gemma root: {gemma_root}")
359
 
360
+ del pipeline
361
+ gc.collect()
362
+ torch.cuda.empty_cache()
363
+
364
+ pipeline = LTX23NegativePromptTwoStagePipeline(
365
+ checkpoint_path=str(checkpoint_path),
366
+ ...
367
+ )
368
+
369
  # Initialize pipeline WITH text encoder and optional audio support
370
  # ---- Replace block (pipeline init) lines 275-281 ----
371
  pipeline = LTX23NegativePromptTwoStagePipeline(
 
392
  rt = round(float(transition_strength), 2)
393
  key_str = f"{pose_lora_path}:{rp}|{general_lora_path}:{rg}|{motion_lora_path}:{rm}|{dreamlay_lora_path}:{rd}|{mself_lora_path}:{rs}|{dramatic_lora_path}:{rr}|{fluid_lora_path}:{rf}|{liquid_lora_path}:{rl}|{demopose_lora_path}:{ro}|{voice_lora_path}:{rv}|{realism_lora_path}:{re}|{transition_lora_path}:{rt}"
394
  key = hashlib.sha256(key_str.encode("utf-8")).hexdigest()
395
+ return key
396
 
397
 
398
  def prepare_lora_cache(