Skip to content

Commit 8530a2f

Browse files
authored
Refactor target_fps handling in TorchrunInferenceWorker (#580)
1 parent bc2828b commit 8530a2f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lightx2v/server/services/inference/worker.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,13 @@ async def process_request(self, task_data: Dict[str, Any]) -> Dict[str, Any]:
6161
task_data["return_result_tensor"] = False
6262
task_data["negative_prompt"] = task_data.get("negative_prompt", "")
6363

64-
if task_data.get("target_fps") is not None and "video_frame_interpolation" in self.runner.config:
65-
task_data["video_frame_interpolation"] = dict(self.runner.config["video_frame_interpolation"])
66-
task_data["video_frame_interpolation"]["target_fps"] = task_data["target_fps"]
67-
del task_data["target_fps"]
64+
target_fps = task_data.pop("target_fps", None)
65+
if target_fps is not None:
66+
vfi_cfg = self.runner.config.get("video_frame_interpolation")
67+
if vfi_cfg:
68+
task_data["video_frame_interpolation"] = {**vfi_cfg, "target_fps": target_fps}
69+
else:
70+
logger.warning(f"Target FPS {target_fps} is set, but video frame interpolation is not configured")
6871

6972
task_data = EasyDict(task_data)
7073
input_info = set_input_info(task_data)

0 commit comments

Comments
 (0)