The Moxie model set is MiniMax H3-only, so no other model choices are exposed in the editor: - Moxie Multimedia Loader: removed the clip_type dropdown (which listed every CLIPType recipe in ComfyUI). The H3 Qwen3-VL text encoder is now always loaded with CLIPType.MINIMAX; older ComfyUI builds raise a clear error instead of silently loading the wrong encoder. - Moxie Multimedia Loader: outputs are now exactly model, clip, video_vae, audio_vae - the legacy FAST_MODEL_LOADER (model_loader) bundle output is removed. The model output keeps the attention backend and LoRA applied. - Moxie MultiTrack Project: takes model, clip, video_vae and audio_vae as required direct inputs instead of a bundled model_loader; the fallback plumbing is removed while EasyMultiTrackProject keeps its model_loader input for non-Moxie workflows. - Moxie Preview Override: dropped the model_loader pass-through slots and patches the model input directly. - Moxie-consolidated.json reference workflow updated to the new slots. - Added tests/test_moxie_nodes.py covering the schema contracts, the attention -> LoRA -> output chain, the MINIMAX lock and the project loader synthesis.
123 lines
4.8 KiB
Python
123 lines
4.8 KiB
Python
from __future__ import annotations
|
|
|
|
import comfy.samplers
|
|
from comfy_api.latest import io
|
|
|
|
from .nodes.project import (
|
|
EasyMultiTrackProject,
|
|
TYPE_TRACKS_INFO,
|
|
_first_input,
|
|
)
|
|
|
|
# Values baked from the reference workflow (Moxie-clean.json). End users only
|
|
# control project_name, steps and seed on this node.
|
|
BAKED_PROJECT_SETTINGS = {
|
|
"project_save": "override",
|
|
"segment_start_number": 1,
|
|
"segment_count": -1,
|
|
"sampling_plan": "custom",
|
|
"sampling_mode": "single",
|
|
"1st_pass_only": False,
|
|
"disable_2nd_noise": False,
|
|
"upscale_by": 1.5,
|
|
"upscale_model": "None",
|
|
"enabled_tiling": "false",
|
|
}
|
|
BAKED_SAMPLER_NAME = "euler"
|
|
BAKED_SCHEDULER = "beta"
|
|
|
|
|
|
class MoxieProject(EasyMultiTrackProject):
|
|
"""MultiTrack Project with the sampling stack consolidated.
|
|
|
|
Replaces: easy multitrackProject + 2x KSamplerSelect (euler / sa_solver)
|
|
+ BasicScheduler (beta) + ManualSigmas. Execution delegates to the
|
|
battle-tested Easy-Media implementation with sampler/sigmas computed
|
|
internally from the exposed `steps` widget.
|
|
"""
|
|
|
|
@classmethod
|
|
def define_schema(cls) -> io.Schema:
|
|
return io.Schema(
|
|
node_id="MoxieProject",
|
|
display_name="Moxie MultiTrack Project",
|
|
category="EasyUse/MultiTrackEditor",
|
|
description=(
|
|
"Build and execute a multi-track MiniMax H3 project. "
|
|
"Takes model, clip, video_vae and audio_vae directly from the Moxie Multimedia Loader. "
|
|
"Sampling is baked to a single pass with euler + beta sigmas; set only steps and seed."
|
|
),
|
|
is_input_list=True,
|
|
enable_expand=True,
|
|
not_idempotent=True,
|
|
inputs=[
|
|
TYPE_TRACKS_INFO.Input("tracks_info"),
|
|
io.Model.Input("model", tooltip="Diffusion model from Moxie Multimedia Loader (attention backend and LoRA already applied)."),
|
|
io.Clip.Input("clip", tooltip="CLIP text encoder from Moxie Multimedia Loader."),
|
|
io.Vae.Input("video_vae", tooltip="Video VAE from Moxie Multimedia Loader."),
|
|
io.Vae.Input("audio_vae", tooltip="Audio VAE from Moxie Multimedia Loader (required to decode MiniMax H3 audio)."),
|
|
io.String.Input("project_name", default="",
|
|
tooltip="Name of the project; used for output folders."),
|
|
io.Int.Input(
|
|
"steps",
|
|
default=3,
|
|
min=1,
|
|
max=10000,
|
|
tooltip="Sampling steps for the beta scheduler (3 for the 3-step turbo LoRA; "
|
|
"8 for busy motion with regular LoRAs, 6 low motion, 4 runs/no dialogue).",
|
|
),
|
|
io.Int.Input(
|
|
"seed",
|
|
default=42,
|
|
min=0,
|
|
max=0xFFFFFFFFFFFFFFFF,
|
|
step=1,
|
|
control_after_generate=io.ControlAfterGenerate.randomize,
|
|
),
|
|
],
|
|
hidden=[io.Hidden.prompt, io.Hidden.unique_id],
|
|
outputs=[
|
|
io.String.Output("PROJECT_NAME"),
|
|
io.Audio.Output("LOCKED_AUDIO"),
|
|
],
|
|
)
|
|
|
|
@classmethod
|
|
def execute(cls, **kwargs) -> io.NodeOutput:
|
|
steps = int(_first_input(kwargs.get("steps"), 3))
|
|
|
|
model = _first_input(kwargs.get("model"))
|
|
clip = _first_input(kwargs.get("clip"))
|
|
video_vae = _first_input(kwargs.get("video_vae"))
|
|
audio_vae = _first_input(kwargs.get("audio_vae"))
|
|
|
|
if model is None or clip is None or video_vae is None or audio_vae is None:
|
|
missing = [k for k, v in [("model", model), ("clip", clip), ("video_vae", video_vae), ("audio_vae", audio_vae)] if v is None]
|
|
raise ValueError(
|
|
"MoxieProject: Missing required model components: " + ", ".join(missing) +
|
|
". Wire model, clip, video_vae, and audio_vae from Moxie Multimedia Loader."
|
|
)
|
|
|
|
# Pack the direct inputs into the loader dict consumed by
|
|
# EasyMultiTrackProject.execute (internal plumbing only).
|
|
synthesized_loader = {
|
|
"model": model,
|
|
"clip": clip,
|
|
"vae": video_vae,
|
|
"audio_vae": audio_vae,
|
|
}
|
|
|
|
# Same math as the native BasicScheduler node (scheduler=beta, denoise=1.0).
|
|
sigmas = comfy.samplers.calculate_sigmas(
|
|
model.get_model_object("model_sampling"), BAKED_SCHEDULER, steps
|
|
).cpu()
|
|
sigmas = sigmas[-(steps + 1):]
|
|
sampler = comfy.samplers.sampler_object(BAKED_SAMPLER_NAME)
|
|
|
|
baked = dict(kwargs)
|
|
baked.update(BAKED_PROJECT_SETTINGS)
|
|
baked["model_loader"] = synthesized_loader
|
|
baked["sampler"] = sampler
|
|
baked["sigmas"] = sigmas
|
|
return super().execute(**baked)
|