Lightricks have updated their pipeline
Browse filesApplying same changes as: https://github.com/Lightricks/LTX-Video/commit/93af6864b942e931908fcf1a3f04feebf97dbb36#diff-e4522277a659ca45d158c90142b86a4518428bda49b31d8027e7f5482039a74f
- handler.py +3 -10
handler.py
CHANGED
@@ -89,10 +89,9 @@ class GenerationConfig:
|
|
89 |
quality: int = 18
|
90 |
|
91 |
# STG (Spatiotemporal Guidance) settings
|
92 |
-
stg_scale: float =
|
93 |
-
stg_rescale: float = 0
|
94 |
stg_mode: str = "attention_values" # Can be "attention_values", "attention_skip", "residual", or "transformer_block"
|
95 |
-
stg_skip_layers: str = "19" # Comma-separated list of layers to block for spatiotemporal guidance
|
96 |
|
97 |
# VAE noise augmentation
|
98 |
decode_timestep: float = 0.05
|
@@ -147,10 +146,6 @@ class GenerationConfig:
|
|
147 |
elif self.stg_mode.lower() == "stg_t" or self.stg_mode.lower() == "transformer_block":
|
148 |
self.stg_mode = "transformer_block"
|
149 |
|
150 |
-
# Convert STG skip layers from string to list of integers
|
151 |
-
if isinstance(self.stg_skip_layers, str):
|
152 |
-
self.stg_skip_layers = [int(x.strip()) for x in self.stg_skip_layers.split(",")]
|
153 |
-
|
154 |
# Check if we should enhance the prompt
|
155 |
if self.enhance_prompt and self.prompt:
|
156 |
prompt_word_count = len(self.prompt.split())
|
@@ -407,7 +402,7 @@ class EndpointHandler:
|
|
407 |
width=768, # Using smaller resolution for faster warm-up
|
408 |
height=416,
|
409 |
num_frames=33, # Just enough frames for a valid video
|
410 |
-
guidance_scale=
|
411 |
num_inference_steps=4, # Fewer steps for faster warm-up
|
412 |
seed=42, # Fixed seed for consistent warm-up
|
413 |
fps=16, # Lower FPS for faster processing
|
@@ -505,7 +500,6 @@ class EndpointHandler:
|
|
505 |
stg_scale=params.get("stg_scale", GenerationConfig.stg_scale),
|
506 |
stg_rescale=params.get("stg_rescale", GenerationConfig.stg_rescale),
|
507 |
stg_mode=params.get("stg_mode", GenerationConfig.stg_mode),
|
508 |
-
stg_skip_layers=params.get("stg_skip_layers", GenerationConfig.stg_skip_layers),
|
509 |
|
510 |
# VAE noise settings
|
511 |
decode_timestep=params.get("decode_timestep", GenerationConfig.decode_timestep),
|
@@ -589,7 +583,6 @@ class EndpointHandler:
|
|
589 |
generator=generator,
|
590 |
output_type="pt", # Return as PyTorch tensor
|
591 |
skip_layer_strategy=skip_layer_strategy,
|
592 |
-
skip_block_list=config.stg_skip_layers,
|
593 |
stg_scale=config.stg_scale,
|
594 |
do_rescaling=config.stg_rescale != 1.0,
|
595 |
rescaling_scale=config.stg_rescale,
|
|
|
89 |
quality: int = 18
|
90 |
|
91 |
# STG (Spatiotemporal Guidance) settings
|
92 |
+
stg_scale: float = 0.0
|
93 |
+
stg_rescale: float = 1.0
|
94 |
stg_mode: str = "attention_values" # Can be "attention_values", "attention_skip", "residual", or "transformer_block"
|
|
|
95 |
|
96 |
# VAE noise augmentation
|
97 |
decode_timestep: float = 0.05
|
|
|
146 |
elif self.stg_mode.lower() == "stg_t" or self.stg_mode.lower() == "transformer_block":
|
147 |
self.stg_mode = "transformer_block"
|
148 |
|
|
|
|
|
|
|
|
|
149 |
# Check if we should enhance the prompt
|
150 |
if self.enhance_prompt and self.prompt:
|
151 |
prompt_word_count = len(self.prompt.split())
|
|
|
402 |
width=768, # Using smaller resolution for faster warm-up
|
403 |
height=416,
|
404 |
num_frames=33, # Just enough frames for a valid video
|
405 |
+
guidance_scale=1.0,
|
406 |
num_inference_steps=4, # Fewer steps for faster warm-up
|
407 |
seed=42, # Fixed seed for consistent warm-up
|
408 |
fps=16, # Lower FPS for faster processing
|
|
|
500 |
stg_scale=params.get("stg_scale", GenerationConfig.stg_scale),
|
501 |
stg_rescale=params.get("stg_rescale", GenerationConfig.stg_rescale),
|
502 |
stg_mode=params.get("stg_mode", GenerationConfig.stg_mode),
|
|
|
503 |
|
504 |
# VAE noise settings
|
505 |
decode_timestep=params.get("decode_timestep", GenerationConfig.decode_timestep),
|
|
|
583 |
generator=generator,
|
584 |
output_type="pt", # Return as PyTorch tensor
|
585 |
skip_layer_strategy=skip_layer_strategy,
|
|
|
586 |
stg_scale=config.stg_scale,
|
587 |
do_rescaling=config.stg_rescale != 1.0,
|
588 |
rescaling_scale=config.stg_rescale,
|