MMnode/moxie_combine.py
Z User 5ad3859bf7 feat: slim Moxie Project Video Combine to GetVideoComponents-style outputs
MoxieCombine now exposes exactly images / audio / fps - the leftover
VIDEO and FILENAME_PREFIX outputs are gone, so the output file name is
chosen on easy saveVideo itself. The base easy multitrackProjectVideoCombine
keeps its VIDEO and FILENAME_PREFIX outputs for legacy workflows.

The shipped Moxie-consolidated template is rewired accordingly: fps/images
links follow the new slot indices (2/0), the filename_prefix link is replaced
by the same project-scoped literal the removed output produced, and the
TEMPLATE's save location is unchanged.

pytest: new schema/execute/blocker coverage for MoxieCombine via a
_load_moxie_combine helper; base-combine assertions untouched.
2026-09-27 04:16:02 +00:00

60 lines
2.2 KiB
Python

from __future__ import annotations
from comfy_api.latest import io
from comfy_execution.graph_utils import ExecutionBlocker
from .nodes.project import EasyMultiTrackProjectVideoCombine, TYPE_PROJECT_DATA
class MoxieCombine(EasyMultiTrackProjectVideoCombine):
"""MultiTrack Project Video Combine + Get Video Components.
Consolidates `easy multitrackProjectVideoCombine` and core
`GetVideoComponents`: one node emits the images / audio / fps
consumed by `easy saveVideo` - the output file name is chosen
on `easy saveVideo` itself.
"""
@classmethod
def define_schema(cls) -> io.Schema:
return io.Schema(
node_id="MoxieCombine",
display_name="Moxie Project Video Combine",
category="EasyUse/MultiTrackEditor",
description=(
"Preview and combine the active videos from a MultiTrack project, "
"then expose the combined frames, audio and frame rate directly."
),
inputs=[
io.String.Input("project_name", force_input=True,
tooltip="PROJECT_NAME output of the Moxie MultiTrack Project node."),
TYPE_PROJECT_DATA.Input("project_data"),
],
hidden=[io.Hidden.unique_id],
outputs=[
io.Image.Output("images"),
io.Audio.Output("audio"),
io.Float.Output("fps"),
],
not_idempotent=True,
)
@classmethod
def execute(cls, project_name: str, project_data) -> io.NodeOutput:
out = super().execute(project_name=project_name, project_data=project_data)
video = out[0]
if isinstance(video, ExecutionBlocker):
return io.NodeOutput(video, video, video)
# The base combine has already restored the editor-selected
# resolution (utils/rtx_vsr.py) before the video was returned, so
# every output below - including the images slot consumed by
# `easy saveVideo` - carries the full project resolution.
components = video.get_components()
return io.NodeOutput(
components.images,
components.audio,
float(components.frame_rate),
)