Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def can_encode_while_decoding(
batch.save_output
and batch.return_file_paths_only
and not batch.return_raw_frames
and not (batch.extra or {}).get("retain_decoded_frames", False)
and batch.data_type == DataType.VIDEO
and not batch.enable_frame_interpolation
and not batch.enable_upscaling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def _maybe_reset_multishot_session(self, batch: Req) -> None:
logger.info("JoyEcho memory bank reset for new multi-shot session")

def forward(self, batch: Req, server_args: ServerArgs) -> Req:
batch.extra["retain_decoded_frames"] = batch.enable_memory_bank
if not batch.enable_memory_bank:
return batch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import torch
from diffusers.video_processor import VideoProcessor

from sglang.multimodal_gen.runtime.distributed import get_local_torch_device
from sglang.multimodal_gen.runtime.distributed import (
get_local_torch_device,
get_replica_group,
model_parallel_is_initialized,
)
from sglang.multimodal_gen.runtime.managers.memory_managers.component_manager import (
ComponentUse,
)
Expand Down Expand Up @@ -152,7 +156,11 @@ def forward(self, batch: Req, server_args: ServerArgs) -> OutputBatch:
raise
if output_paths is not None:
output_batch.output_file_paths = output_paths
else:
elif (
batch.extra.get("retain_decoded_frames", False)
or not model_parallel_is_initialized()
or get_replica_group().rank_in_group == 0
):
output_batch.output = self.video_processor.postprocess_video(
video, output_type="np"
)
Expand Down
Loading
Loading