Skip to content
Open
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
6 changes: 6 additions & 0 deletions src/diffusers/modular_pipelines/mellon_node_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ def _name_to_label(name: str) -> str:
"display": "slider",
"required_block_params": ["layers"],
},
"output_type": {
"label": "Output Type",
"type": "dropdown",
"default": "np",
"options": ["np", "pil", "pt"],
},
# ControlNet
"controlnet_conditioning_scale": {
"label": "Controlnet Conditioning Scale",
Expand Down
8 changes: 6 additions & 2 deletions src/diffusers/modular_pipelines/wan/decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def inputs(self) -> List[Tuple[str, Any]]:
required=True,
type_hint=torch.Tensor,
description="The denoised latents from the denoising step",
)
),
InputParam(
"output_type", default="np", type_hint=str, description="The output type of the decoded videos"
),
]

@property
Expand Down Expand Up @@ -87,7 +90,8 @@ def __call__(self, components, state: PipelineState) -> PipelineState:
latents = latents.to(vae_dtype)
block_state.videos = components.vae.decode(latents, return_dict=False)[0]

block_state.videos = components.video_processor.postprocess_video(block_state.videos, output_type="np")
output_type = getattr(block_state, "output_type", "np")
block_state.videos = components.video_processor.postprocess_video(block_state.videos, output_type=output_type)

self.set_block_state(state, block_state)

Expand Down
Loading