euiia commited on
Commit
c3d22c6
·
verified ·
1 Parent(s): 2b8bffd

Update aduc_orchestrator.py

Browse files
Files changed (1) hide show
  1. aduc_orchestrator.py +13 -14
aduc_orchestrator.py CHANGED
@@ -51,6 +51,10 @@ class AducOrchestrator:
51
  logger.info("Maestro ADUC está no pódio. Músicos (especialistas) prontos.")
52
 
53
  def process_image_for_story(self, image_path: str, size: int, filename: str = None) -> str:
 
 
 
 
54
  img = Image.open(image_path).convert("RGB")
55
  img_square = ImageOps.fit(img, (size, size), Image.Resampling.LANCZOS)
56
 
@@ -80,7 +84,11 @@ class AducOrchestrator:
80
  return selected_paths
81
 
82
  def task_generate_keyframes(self, storyboard, initial_ref_path, global_prompt, keyframe_resolution, progress_callback_factory=None):
 
 
 
83
  logger.info(f"Ato 1, Cena 2: Direção de Arte. Delegando ao Especialista de Imagem.")
 
84
  general_ref_paths = self.director.get_state("processed_ref_paths", [])
85
 
86
  final_keyframes = self.painter.generate_keyframes_from_storyboard(
@@ -96,12 +104,8 @@ class AducOrchestrator:
96
  logger.info("Maestro: Especialista de Imagem concluiu a geração dos keyframes.")
97
  return final_keyframes
98
 
99
- def task_produce_final_movie_with_feedback(self, keyframes, global_prompt,
100
- # Novos parâmetros de controle da UI
101
- n_chunks_to_generate, video_end_chunk,
102
- eco_start_chunk, handler_start_chunk,
103
- handler_frame_target,
104
- # Parâmetros restantes
105
  handler_strength,
106
  destination_convergence_strength,
107
  video_resolution, use_continuity_director,
@@ -110,18 +114,13 @@ class AducOrchestrator:
110
  logger.info("AducOrchestrator: Delegando a produção do filme completo ao Deformes4DEngine.")
111
  storyboard = self.director.get_state("storyboard", [])
112
 
113
- # --- CHAMADA ATUALIZADA PARA O MOTOR COM OS NOVOS PARÂMETROS ---
114
  for update in self.editor.generate_full_movie(
115
  keyframes=keyframes,
116
  global_prompt=global_prompt,
117
  storyboard=storyboard,
118
- # Novos parâmetros de controle dinâmicos
119
- n_chunks_to_generate=n_chunks_to_generate,
120
- video_end_chunk=video_end_chunk,
121
- eco_start_chunk=eco_start_chunk,
122
- handler_start_chunk=handler_start_chunk,
123
- handler_frame_target=handler_frame_target,
124
- # Parâmetros restantes
125
  handler_strength=handler_strength,
126
  destination_convergence_strength=destination_convergence_strength,
127
  video_resolution=video_resolution,
 
51
  logger.info("Maestro ADUC está no pódio. Músicos (especialistas) prontos.")
52
 
53
  def process_image_for_story(self, image_path: str, size: int, filename: str = None) -> str:
54
+ """
55
+ Pré-processa uma imagem de referência: converte para RGB, redimensiona para um
56
+ quadrado e salva no diretório de trabalho.
57
+ """
58
  img = Image.open(image_path).convert("RGB")
59
  img_square = ImageOps.fit(img, (size, size), Image.Resampling.LANCZOS)
60
 
 
84
  return selected_paths
85
 
86
  def task_generate_keyframes(self, storyboard, initial_ref_path, global_prompt, keyframe_resolution, progress_callback_factory=None):
87
+ """
88
+ Delega a tarefa de geração de keyframes para o ImageSpecialist.
89
+ """
90
  logger.info(f"Ato 1, Cena 2: Direção de Arte. Delegando ao Especialista de Imagem.")
91
+
92
  general_ref_paths = self.director.get_state("processed_ref_paths", [])
93
 
94
  final_keyframes = self.painter.generate_keyframes_from_storyboard(
 
104
  logger.info("Maestro: Especialista de Imagem concluiu a geração dos keyframes.")
105
  return final_keyframes
106
 
107
+ def task_produce_final_movie_with_feedback(self, keyframes, global_prompt, seconds_per_fragment,
108
+ trim_percent: int,
 
 
 
 
109
  handler_strength,
110
  destination_convergence_strength,
111
  video_resolution, use_continuity_director,
 
114
  logger.info("AducOrchestrator: Delegando a produção do filme completo ao Deformes4DEngine.")
115
  storyboard = self.director.get_state("storyboard", [])
116
 
117
+ # A chamada para generate_full_movie agora usa `trim_percent` e ignora os parâmetros antigos.
118
  for update in self.editor.generate_full_movie(
119
  keyframes=keyframes,
120
  global_prompt=global_prompt,
121
  storyboard=storyboard,
122
+ seconds_per_fragment=seconds_per_fragment,
123
+ trim_percent=trim_percent,
 
 
 
 
 
124
  handler_strength=handler_strength,
125
  destination_convergence_strength=destination_convergence_strength,
126
  video_resolution=video_resolution,