Update api/ltx_server_refactored.py
Browse files- api/ltx_server_refactored.py +8 -11
api/ltx_server_refactored.py
CHANGED
|
@@ -282,7 +282,7 @@ class VideoService:
|
|
| 282 |
def _generate_single_chunk_low(
|
| 283 |
self, prompt, negative_prompt,
|
| 284 |
height, width, num_frames, guidance_scale,
|
| 285 |
-
seed,
|
| 286 |
ltx_configs_override=None):
|
| 287 |
"""
|
| 288 |
[NÓ DE GERAÇÃO]
|
|
@@ -309,10 +309,7 @@ class VideoService:
|
|
| 309 |
downscaled_height = x_height - (x_height % vae_scale_factor)
|
| 310 |
|
| 311 |
# --- NÓ 1.2: MONTAGEM DE CONDIÇÕES E OVERRIDES ---
|
| 312 |
-
|
| 313 |
-
if image_conditions: all_conditions.extend(image_conditions)
|
| 314 |
-
if initial_latent_condition: all_conditions.append(initial_latent_condition)
|
| 315 |
-
|
| 316 |
first_pass_config = self.config.get("first_pass", {}).copy()
|
| 317 |
|
| 318 |
if ltx_configs_override:
|
|
@@ -335,7 +332,7 @@ class VideoService:
|
|
| 335 |
first_pass_kwargs = {
|
| 336 |
"prompt": prompt, "negative_prompt": negative_prompt, "height": downscaled_height, "width": downscaled_width,
|
| 337 |
"num_frames": num_frames, "frame_rate": 24, "generator": generator, "output_type": "latent",
|
| 338 |
-
"conditioning_items":
|
| 339 |
**first_pass_config
|
| 340 |
}
|
| 341 |
|
|
@@ -445,17 +442,17 @@ class VideoService:
|
|
| 445 |
latentes_bruto_r = self._generate_single_chunk_low(
|
| 446 |
prompt=chunk_prompt, negative_prompt=negative_prompt, height=height, width=width,
|
| 447 |
num_frames=frames_per_chunk, guidance_scale=guidance_scale, seed=used_seed + i,
|
| 448 |
-
|
| 449 |
ltx_configs_override=ltx_configs_override
|
| 450 |
)
|
| 451 |
|
| 452 |
|
| 453 |
-
print(f"[DEBUG] generate_narrative_low.frames_per_chunk: {frames_per_chunk}")
|
| 454 |
-
|
| 455 |
-
|
| 456 |
|
|
|
|
| 457 |
|
|
|
|
| 458 |
|
|
|
|
| 459 |
log_tensor_info(latentes_bruto_r, f"latentes_bruto_r recebidk: {i}...'")
|
| 460 |
|
| 461 |
#latent_path_bufer = load_tensor(latent_path)
|
|
@@ -542,7 +539,7 @@ class VideoService:
|
|
| 542 |
latent_path = self._generate_single_chunk_low(
|
| 543 |
prompt=prompt, negative_prompt=negative_prompt, height=height, width=width,
|
| 544 |
num_frames=total_actual_frames, guidance_scale=guidance_scale, seed=used_seed,
|
| 545 |
-
|
| 546 |
ltx_configs_override=ltx_configs_override
|
| 547 |
)
|
| 548 |
|
|
|
|
| 282 |
def _generate_single_chunk_low(
|
| 283 |
self, prompt, negative_prompt,
|
| 284 |
height, width, num_frames, guidance_scale,
|
| 285 |
+
seed, itens_conditions=None,
|
| 286 |
ltx_configs_override=None):
|
| 287 |
"""
|
| 288 |
[NÓ DE GERAÇÃO]
|
|
|
|
| 309 |
downscaled_height = x_height - (x_height % vae_scale_factor)
|
| 310 |
|
| 311 |
# --- NÓ 1.2: MONTAGEM DE CONDIÇÕES E OVERRIDES ---
|
| 312 |
+
|
|
|
|
|
|
|
|
|
|
| 313 |
first_pass_config = self.config.get("first_pass", {}).copy()
|
| 314 |
|
| 315 |
if ltx_configs_override:
|
|
|
|
| 332 |
first_pass_kwargs = {
|
| 333 |
"prompt": prompt, "negative_prompt": negative_prompt, "height": downscaled_height, "width": downscaled_width,
|
| 334 |
"num_frames": num_frames, "frame_rate": 24, "generator": generator, "output_type": "latent",
|
| 335 |
+
"conditioning_items": itens_conditions
|
| 336 |
**first_pass_config
|
| 337 |
}
|
| 338 |
|
|
|
|
| 442 |
latentes_bruto_r = self._generate_single_chunk_low(
|
| 443 |
prompt=chunk_prompt, negative_prompt=negative_prompt, height=height, width=width,
|
| 444 |
num_frames=frames_per_chunk, guidance_scale=guidance_scale, seed=used_seed + i,
|
| 445 |
+
itens_conditions=None,
|
| 446 |
ltx_configs_override=ltx_configs_override
|
| 447 |
)
|
| 448 |
|
| 449 |
|
|
|
|
|
|
|
|
|
|
| 450 |
|
| 451 |
+
|
| 452 |
|
| 453 |
+
print(f"[DEBUG] generate_narrative_low.frames_per_chunk: {frames_per_chunk}")
|
| 454 |
|
| 455 |
+
|
| 456 |
log_tensor_info(latentes_bruto_r, f"latentes_bruto_r recebidk: {i}...'")
|
| 457 |
|
| 458 |
#latent_path_bufer = load_tensor(latent_path)
|
|
|
|
| 539 |
latent_path = self._generate_single_chunk_low(
|
| 540 |
prompt=prompt, negative_prompt=negative_prompt, height=height, width=width,
|
| 541 |
num_frames=total_actual_frames, guidance_scale=guidance_scale, seed=used_seed,
|
| 542 |
+
itens_conditions=initial_image_conditions,
|
| 543 |
ltx_configs_override=ltx_configs_override
|
| 544 |
)
|
| 545 |
|