Aduc-sdr commited on
Commit
e5bca6d
·
verified ·
1 Parent(s): e5134de

Update engineers/deformes7D.py

Browse files
Files changed (1) hide show
  1. engineers/deformes7D.py +22 -7
engineers/deformes7D.py CHANGED
@@ -2,11 +2,12 @@
2
  #
3
  # Copyright (C) 2025 Carlos Rodrigues dos Santos
4
  #
5
- # Version: 3.1.1
6
  #
7
- # This file defines the Deformes7DEngine, the unified production specialist.
8
- # This version includes a robust path fix for loading the main config.yaml,
9
- # ensuring the singleton can be initialized correctly from any context.
 
10
 
11
  import os
12
  import time
@@ -28,7 +29,7 @@ from managers.ltx_manager import ltx_manager_singleton
28
  from managers.latent_enhancer_manager import latent_enhancer_specialist_singleton
29
  from managers.vae_manager import vae_manager_singleton
30
  from engineers.deformes2D_thinker import deformes2d_thinker_singleton
31
- from engineers.deformes3D_thinker import deformes3d_thinker_singleton
32
  from managers.seedvr_manager import seedvr_manager_singleton
33
  from managers.mmaudio_manager import mmaudio_manager_singleton
34
  from tools.video_encode_tool import video_encode_tool_singleton
@@ -164,11 +165,24 @@ class Deformes7DEngine:
164
  logger.info(f"--> Step 4D: Generating Video Fragment V{i-1}")
165
  kb_path, kx_path, ky_path = generated_keyframe_paths[i-1], generated_keyframe_paths[i], generated_keyframe_paths[i+1]
166
 
167
- decision = deformes3d_thinker_singleton.get_cinematic_decision(
 
 
 
 
 
168
  global_prompt, story_history, kb_path, kx_path, ky_path,
169
  storyboard[i-1], storyboard[i], storyboard[i+1]
170
  )
171
- transition_type, motion_prompt = decision["transition_type"], decision["motion_prompt"]
 
 
 
 
 
 
 
 
172
  story_history += f"\n- Act {i}: {motion_prompt}"
173
 
174
  total_frames_brutos = self._quantize_to_multiple(int(seconds_per_fragment * FPS), FRAMES_PER_LATENT_CHUNK)
@@ -184,6 +198,7 @@ class Deformes7DEngine:
184
  conditioning_items.append(LatentConditioningItem(eco_latent_for_next_loop, 0, 1.0))
185
  conditioning_items.append(LatentConditioningItem(dejavu_latent_for_next_loop, DEJAVU_FRAME_TARGET, handler_strength))
186
 
 
187
  if transition_type != "cut":
188
  conditioning_items.append(LatentConditioningItem(ky_latent, DESTINATION_FRAME_TARGET, dest_strength))
189
 
 
2
  #
3
  # Copyright (C) 2025 Carlos Rodrigues dos Santos
4
  #
5
+ # Version: 3.2.0
6
  #
7
+ # This version refactors the main interleaved pipeline to use the new
8
+ # Deformes3DThinker for cinematic motion prompt generation, leveraging the LTX
9
+ # pipeline's internal models. The transition logic is temporarily fixed to
10
+ # 'continuous' to streamline the generation process.
11
 
12
  import os
13
  import time
 
29
  from managers.latent_enhancer_manager import latent_enhancer_specialist_singleton
30
  from managers.vae_manager import vae_manager_singleton
31
  from engineers.deformes2D_thinker import deformes2d_thinker_singleton
32
+ from engineers.deformes3d_thinker import deformes3d_thinker_singleton # <-- NOVA IMPORTAÇÃO
33
  from managers.seedvr_manager import seedvr_manager_singleton
34
  from managers.mmaudio_manager import mmaudio_manager_singleton
35
  from tools.video_encode_tool import video_encode_tool_singleton
 
165
  logger.info(f"--> Step 4D: Generating Video Fragment V{i-1}")
166
  kb_path, kx_path, ky_path = generated_keyframe_paths[i-1], generated_keyframe_paths[i], generated_keyframe_paths[i+1]
167
 
168
+ # =================================================================================
169
+ # === INÍCIO DA MODIFICAÇÃO: LÓGICA DE DECISÃO DE MOVIMENTO REATORADA ===
170
+ # =================================================================================
171
+ # 1. A decisão de movimento agora é delegada ao Deformes3DThinker, que usa
172
+ # os modelos internos de enhancement do LTX, em vez do Gemini.
173
+ motion_prompt = deformes3d_thinker_singleton.get_enhanced_motion_prompt(
174
  global_prompt, story_history, kb_path, kx_path, ky_path,
175
  storyboard[i-1], storyboard[i], storyboard[i+1]
176
  )
177
+
178
+ # 2. Simplificação da transição: Por enquanto, todas as transições são
179
+ # tratadas como "continuous". A lógica de "cut" foi removida provisoriamente
180
+ # e pode ser reintroduzida com um controle mais avançado no futuro.
181
+ transition_type = "continuous"
182
+ # =================================================================================
183
+ # === FIM DA MODIFICAÇÃO ===
184
+ # =================================================================================
185
+
186
  story_history += f"\n- Act {i}: {motion_prompt}"
187
 
188
  total_frames_brutos = self._quantize_to_multiple(int(seconds_per_fragment * FPS), FRAMES_PER_LATENT_CHUNK)
 
198
  conditioning_items.append(LatentConditioningItem(eco_latent_for_next_loop, 0, 1.0))
199
  conditioning_items.append(LatentConditioningItem(dejavu_latent_for_next_loop, DEJAVU_FRAME_TARGET, handler_strength))
200
 
201
+ # Como a transição é sempre 'continuous', esta condição será sempre verdadeira.
202
  if transition_type != "cut":
203
  conditioning_items.append(LatentConditioningItem(ky_latent, DESTINATION_FRAME_TARGET, dest_strength))
204