feat: expose context_frames on Moxie MultiTrack Project
MoxieProject subclasses EasyMultiTrackProject and runs the same
continuation engine, but its consolidated schema hid the new
context_frames widget added to the parent node in 724da63 - so the
overlap stayed locked at 22 for the node end users actually see.
- add the same context_frames combo (5/22/39/56, default 22) between
steps and seed on Moxie MultiTrack Project; execute() already
forwards kwargs through to the base engine untouched
- baked euler/beta sampling stack unchanged: sampling_plan stays
'custom', sampling_mode stays 'single'
- tests: MoxieProject schema order/options, execute passthrough proof
(widget reaches the base engine, baked settings never clobber it),
and the moxie_nodes schema assert updated for the new widget; test
harness gains a comfy.samplers stub and ControlAfterGenerate.randomize
- docs: multitrack-schema.md notes the widget on MoxieProject;
CHANGELOG updated
Default 22 keeps every existing MoxieProject workflow identical.
This commit is contained in:
parent
724da63f7f
commit
0a9416b91a
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
### ⚡ Improvements
|
### ⚡ Improvements
|
||||||
|
|
||||||
- **MultiTrack Project**: The inter-segment context overlap is now configurable. The new `context_frames` widget (5 / 22 / 39 / 56 frames, default 22) chooses how many frames of the previous segment are copied in as continuation context for segments using Context or Context Swap continuity — previously this was fixed at 22 frames in code. Longer values hand off motion more smoothly but generate that many extra frames per continued segment (each continuation also generates 12 grid-alignment tail frames that are trimmed after decode). Values are the H3 temporal-grid lengths already offered by the Moxie context sampler nodes; existing workflows keep 22 and behave exactly as before.
|
- **MultiTrack Project**: The inter-segment context overlap is now configurable. The new `context_frames` widget (5 / 22 / 39 / 56 frames, default 22) chooses how many frames of the previous segment are copied in as continuation context for segments using Context or Context Swap continuity — previously this was fixed at 22 frames in code. Longer values hand off motion more smoothly but generate that many extra frames per continued segment (each continuation also generates 12 grid-alignment tail frames that are trimmed after decode). Values are the H3 temporal-grid lengths already offered by the Moxie context sampler nodes; existing workflows keep 22 and behave exactly as before. The same widget (between `steps` and `seed`) is also exposed on **Moxie MultiTrack Project** — its baked euler/beta sampling stack is unchanged, so end users still only need `steps` and `seed` unless they touch the overlap.
|
||||||
|
|
||||||
- **Moxie Multimedia Loader**: Removed the automatic LoRA application entirely. The 3-step distill (speedup) weights are now baked into the diffusion model itself, so the loader no longer reads `models/loras` — a leftover file there is silently ignored, and the `models/loras` folder can be deleted. The node schema, outputs, and load order (diffusion model → attention backend → CLIP → VAEs) are unchanged; workflows saved earlier keep working. The `Moxie Project` steps tooltip now references the baked-in distill instead of the LoRA.
|
- **Moxie Multimedia Loader**: Removed the automatic LoRA application entirely. The 3-step distill (speedup) weights are now baked into the diffusion model itself, so the loader no longer reads `models/loras` — a leftover file there is silently ignored, and the `models/loras` folder can be deleted. The node schema, outputs, and load order (diffusion model → attention backend → CLIP → VAEs) are unchanged; workflows saved earlier keep working. The `Moxie Project` steps tooltip now references the baked-in distill instead of the LoRA.
|
||||||
- **FFmpeg resolution & diagnostics**: The pack now finds FFmpeg on far more Windows setups and tells you exactly what is wrong when it cannot. When `ffmpeg` is not on the ComfyUI process's PATH (PATH edits only reach processes started afterwards), it is additionally looked up in the classic `C:\ffmpeg\bin`, the ComfyUI/portable folders (including `ffmpeg\bin` next to the run bat), winget/scoop/chocolatey shim locations, and finally the ffmpeg binary bundled with ComfyUI's own `imageio-ffmpeg` dependency. When composing an H3 project still fails, the error dialog now names the concrete cause instead of a generic message: the missing executable, the exact missing segment/locked-audio file paths, odd canvas sizes, or the tail of FFmpeg's own stderr output (e.g. `Unknown encoder 'libx264'`).
|
- **FFmpeg resolution & diagnostics**: The pack now finds FFmpeg on far more Windows setups and tells you exactly what is wrong when it cannot. When `ffmpeg` is not on the ComfyUI process's PATH (PATH edits only reach processes started afterwards), it is additionally looked up in the classic `C:\ffmpeg\bin`, the ComfyUI/portable folders (including `ffmpeg\bin` next to the run bat), winget/scoop/chocolatey shim locations, and finally the ffmpeg binary bundled with ComfyUI's own `imageio-ffmpeg` dependency. When composing an H3 project still fails, the error dialog now names the concrete cause instead of a generic message: the missing executable, the exact missing segment/locked-audio file paths, odd canvas sizes, or the tail of FFmpeg's own stderr output (e.g. `Unknown encoder 'libx264'`).
|
||||||
|
|||||||
@ -5,6 +5,8 @@ from comfy_api.latest import io
|
|||||||
|
|
||||||
from .nodes.project import (
|
from .nodes.project import (
|
||||||
EasyMultiTrackProject,
|
EasyMultiTrackProject,
|
||||||
|
H3_CONTEXT_LENGTH_OPTIONS,
|
||||||
|
H3_CONTEXT_SOURCE_FRAMES,
|
||||||
TYPE_TRACKS_INFO,
|
TYPE_TRACKS_INFO,
|
||||||
_first_input,
|
_first_input,
|
||||||
)
|
)
|
||||||
@ -66,6 +68,19 @@ class MoxieProject(EasyMultiTrackProject):
|
|||||||
tooltip="Sampling steps for the beta scheduler (3 for the baked-in 3-step distill; "
|
tooltip="Sampling steps for the beta scheduler (3 for the baked-in 3-step distill; "
|
||||||
"8 for busy motion, 6 low motion, 4 runs/no dialogue).",
|
"8 for busy motion, 6 low motion, 4 runs/no dialogue).",
|
||||||
),
|
),
|
||||||
|
io.Combo.Input(
|
||||||
|
"context_frames",
|
||||||
|
options=[str(option) for option in H3_CONTEXT_LENGTH_OPTIONS],
|
||||||
|
default=str(H3_CONTEXT_SOURCE_FRAMES),
|
||||||
|
tooltip=(
|
||||||
|
"Video frames copied from the previous segment as "
|
||||||
|
"continuation context for segments whose continuity "
|
||||||
|
"mode is Context or Context Swap. Longer values hand "
|
||||||
|
"off motion more smoothly but generate that many extra "
|
||||||
|
"frames per segment. Values are H3 temporal-grid "
|
||||||
|
"lengths shared with the Moxie context sampler nodes."
|
||||||
|
),
|
||||||
|
),
|
||||||
io.Int.Input(
|
io.Int.Input(
|
||||||
"seed",
|
"seed",
|
||||||
default=42,
|
default=42,
|
||||||
|
|||||||
@ -267,6 +267,7 @@ custom 示例:
|
|||||||
- `project_save`: `new` 或 `override`。在 `override` 且 count 为 `-1` 时,执行逻辑会删除起始索引之后的已保存片段再生成;修改前向用户清楚说明。
|
- `project_save`: `new` 或 `override`。在 `override` 且 count 为 `-1` 时,执行逻辑会删除起始索引之后的已保存片段再生成;修改前向用户清楚说明。
|
||||||
- `sampling_mode`: `single` 或 `dual`;`sampling_plan` 必须是当前节点可用预设。不要仅凭另一份流程中的值假设当前环境支持。
|
- `sampling_mode`: `single` 或 `dual`;`sampling_plan` 必须是当前节点可用预设。不要仅凭另一份流程中的值假设当前环境支持。
|
||||||
- `context_frames`(默认 `"22"`,可选 `"5"` / `"22"` / `"39"` / `"56"`)控制 Context / Context Swap 续接片段从上一段拷贝为延续上下文的视频帧数;取值必须落在 H3 时间潜空间网格(17k+5 帧)上,与 Moxie 上下文采样节点的选项一致。数值越大运动衔接越平滑,但每个续接片段会多生成等量帧(实际生成长度为 `任务长度 + context_frames + 12`,其中 12 帧为网格尾帧,解码后裁掉)。
|
- `context_frames`(默认 `"22"`,可选 `"5"` / `"22"` / `"39"` / `"56"`)控制 Context / Context Swap 续接片段从上一段拷贝为延续上下文的视频帧数;取值必须落在 H3 时间潜空间网格(17k+5 帧)上,与 Moxie 上下文采样节点的选项一致。数值越大运动衔接越平滑,但每个续接片段会多生成等量帧(实际生成长度为 `任务长度 + context_frames + 12`,其中 12 帧为网格尾帧,解码后裁掉)。
|
||||||
|
- `Moxie MultiTrack Project`(`MoxieProject`)同样暴露同一个 `context_frames` 下拉,位于 `steps` 与 `seed` 之间;该节点的其余采样设置仍保持隐藏(euler + beta sigmas 由 `steps` 推导)。
|
||||||
- 编辑器分辨率是一采尺寸;`dual` 不会反算缩小一采。二采宽高分别为 `round(编辑器尺寸 * upscale_by / 32) * 32`,采用 Python `round` 就近对齐,恰好居中时取偶数,不是固定向上对齐。
|
- 编辑器分辨率是一采尺寸;`dual` 不会反算缩小一采。二采宽高分别为 `round(编辑器尺寸 * upscale_by / 32) * 32`,采用 Python `round` 就近对齐,恰好居中时取偶数,不是固定向上对齐。
|
||||||
- `upscale_by` 是 Project 的独立参数,默认 `1.250`,三位小数,步长 `0.001`;旧工作流保留已保存的值。两条放大路径及合并导出均使用放大并对齐后的尺寸。例如 `1344 × 768`、倍率 `1.250` 的二采为 `1664 × 960`。若用户指定最终输出尺寸,应同时核对编辑器尺寸与倍率,不能将编辑器尺寸直接当作双采样的最终尺寸。
|
- `upscale_by` 是 Project 的独立参数,默认 `1.250`,三位小数,步长 `0.001`;旧工作流保留已保存的值。两条放大路径及合并导出均使用放大并对齐后的尺寸。例如 `1344 × 768`、倍率 `1.250` 的二采为 `1664 × 960`。若用户指定最终输出尺寸,应同时核对编辑器尺寸与倍率,不能将编辑器尺寸直接当作双采样的最终尺寸。
|
||||||
- 单采样、仅一采预览保持编辑器尺寸;`upscale_by = 1.000` 不放大但可二采;纯音频项目(`32 × 32`)不放大。旧版反算缩小尺寸的一采检查点和上下文潜空间应重新生成后再按新规则续跑。
|
- 单采样、仅一采预览保持编辑器尺寸;`upscale_by = 1.000` 不放大但可二采;纯音频项目(`32 × 32`)不放大。旧版反算缩小尺寸的一采检查点和上下文潜空间应重新生成后再按新规则续跑。
|
||||||
|
|||||||
@ -185,7 +185,7 @@ def _load_minimax_node(monkeypatch):
|
|||||||
Combo=_PortType,
|
Combo=_PortType,
|
||||||
ComfyNode=object,
|
ComfyNode=object,
|
||||||
Conditioning=_PortType,
|
Conditioning=_PortType,
|
||||||
ControlAfterGenerate=types.SimpleNamespace(fixed="fixed"),
|
ControlAfterGenerate=types.SimpleNamespace(fixed="fixed", randomize="randomize"),
|
||||||
DynamicCombo=_DynamicCombo,
|
DynamicCombo=_DynamicCombo,
|
||||||
Hidden=types.SimpleNamespace(prompt="PROMPT", unique_id="UNIQUE_ID"),
|
Hidden=types.SimpleNamespace(prompt="PROMPT", unique_id="UNIQUE_ID"),
|
||||||
Custom=lambda **kwargs: _PortType,
|
Custom=lambda **kwargs: _PortType,
|
||||||
@ -260,6 +260,12 @@ def _load_minimax_node(monkeypatch):
|
|||||||
comfy.model_management = model_management
|
comfy.model_management = model_management
|
||||||
comfy.nested_tensor = nested_tensor
|
comfy.nested_tensor = nested_tensor
|
||||||
comfy.utils = comfy_utils
|
comfy.utils = comfy_utils
|
||||||
|
comfy_samplers = types.ModuleType("comfy.samplers")
|
||||||
|
comfy_samplers.calculate_sigmas = (
|
||||||
|
lambda *args, **kwargs: torch.arange(8.0)
|
||||||
|
)
|
||||||
|
comfy_samplers.sampler_object = lambda name: {"sampler": name}
|
||||||
|
comfy.samplers = comfy_samplers
|
||||||
|
|
||||||
node_helpers = types.ModuleType("node_helpers")
|
node_helpers = types.ModuleType("node_helpers")
|
||||||
|
|
||||||
@ -448,6 +454,7 @@ def _load_minimax_node(monkeypatch):
|
|||||||
"comfy.model_management": model_management,
|
"comfy.model_management": model_management,
|
||||||
"comfy.nested_tensor": nested_tensor,
|
"comfy.nested_tensor": nested_tensor,
|
||||||
"comfy.utils": comfy_utils,
|
"comfy.utils": comfy_utils,
|
||||||
|
"comfy.samplers": comfy_samplers,
|
||||||
"node_helpers": node_helpers,
|
"node_helpers": node_helpers,
|
||||||
"torchaudio": torchaudio,
|
"torchaudio": torchaudio,
|
||||||
"folder_paths": folder_paths,
|
"folder_paths": folder_paths,
|
||||||
@ -516,6 +523,21 @@ def _load_moxie_combine(monkeypatch):
|
|||||||
return module
|
return module
|
||||||
|
|
||||||
|
|
||||||
|
def _load_moxie_project(monkeypatch):
|
||||||
|
"""Load moxie_project.py into the stub environment set up above."""
|
||||||
|
module = _load_minimax_node(monkeypatch)
|
||||||
|
assert module is not None
|
||||||
|
root = Path(__file__).parents[1]
|
||||||
|
spec = importlib.util.spec_from_file_location(
|
||||||
|
"easy_media.moxie_project", root / "moxie_project.py"
|
||||||
|
)
|
||||||
|
assert spec is not None and spec.loader is not None
|
||||||
|
moxie_module = importlib.util.module_from_spec(spec)
|
||||||
|
sys.modules[spec.name] = moxie_module
|
||||||
|
spec.loader.exec_module(moxie_module)
|
||||||
|
return moxie_module
|
||||||
|
|
||||||
|
|
||||||
def _image_values(*values):
|
def _image_values(*values):
|
||||||
return torch.tensor(values, dtype=torch.float32).reshape(len(values), 1, 1, 1)
|
return torch.tensor(values, dtype=torch.float32).reshape(len(values), 1, 1, 1)
|
||||||
|
|
||||||
@ -6180,3 +6202,68 @@ def test_minimax_prompt_override_node_has_complete_chinese_localization():
|
|||||||
assert translation["inputs"]["video_track_lock"]["name"] == "视频轨锁定"
|
assert translation["inputs"]["video_track_lock"]["name"] == "视频轨锁定"
|
||||||
assert translation["inputs"]["audio_track_lock"]["name"] == "音频轨锁定"
|
assert translation["inputs"]["audio_track_lock"]["name"] == "音频轨锁定"
|
||||||
assert translation["outputs"] == {"0": {"name": "提示词覆盖"}}
|
assert translation["outputs"] == {"0": {"name": "提示词覆盖"}}
|
||||||
|
|
||||||
|
|
||||||
|
def test_moxie_project_schema_exposes_context_frames(monkeypatch):
|
||||||
|
module = _load_moxie_project(monkeypatch)
|
||||||
|
schema = module.MoxieProject.define_schema()
|
||||||
|
inputs = {port.name: port for port in schema.inputs}
|
||||||
|
|
||||||
|
assert schema.node_id == "MoxieProject"
|
||||||
|
assert schema.display_name == "Moxie MultiTrack Project"
|
||||||
|
assert schema.is_input_list is True
|
||||||
|
assert list(inputs) == [
|
||||||
|
"tracks_info",
|
||||||
|
"model",
|
||||||
|
"clip",
|
||||||
|
"video_vae",
|
||||||
|
"audio_vae",
|
||||||
|
"project_name",
|
||||||
|
"steps",
|
||||||
|
"context_frames",
|
||||||
|
"seed",
|
||||||
|
]
|
||||||
|
assert inputs["context_frames"].kwargs["options"] == ["5", "22", "39", "56"]
|
||||||
|
assert inputs["context_frames"].kwargs["default"] == "22"
|
||||||
|
assert inputs["steps"].kwargs["default"] == 3
|
||||||
|
assert inputs["seed"].kwargs["default"] == 42
|
||||||
|
|
||||||
|
|
||||||
|
def test_moxie_project_forwards_context_frames_to_engine(monkeypatch):
|
||||||
|
module = _load_moxie_project(monkeypatch)
|
||||||
|
|
||||||
|
captured = {}
|
||||||
|
|
||||||
|
def fake_execute(cls, **kwargs):
|
||||||
|
captured.update(kwargs)
|
||||||
|
return "sentinel-output"
|
||||||
|
|
||||||
|
monkeypatch.setattr(
|
||||||
|
module.EasyMultiTrackProject, "execute", classmethod(fake_execute)
|
||||||
|
)
|
||||||
|
|
||||||
|
model = types.SimpleNamespace(
|
||||||
|
get_model_object=lambda name: types.SimpleNamespace()
|
||||||
|
)
|
||||||
|
result = module.MoxieProject.execute(
|
||||||
|
tracks_info=[{"tracks": []}],
|
||||||
|
model=[model],
|
||||||
|
clip=[types.SimpleNamespace()],
|
||||||
|
video_vae=[types.SimpleNamespace()],
|
||||||
|
audio_vae=[types.SimpleNamespace()],
|
||||||
|
project_name=["demo"],
|
||||||
|
steps=["4"],
|
||||||
|
context_frames=["5"],
|
||||||
|
seed=["7"],
|
||||||
|
)
|
||||||
|
|
||||||
|
assert result == "sentinel-output"
|
||||||
|
assert captured["context_frames"] == ["5"]
|
||||||
|
assert captured["steps"] == ["4"]
|
||||||
|
assert captured["project_name"] == ["demo"]
|
||||||
|
assert captured["seed"] == ["7"]
|
||||||
|
# Baked settings survive the handoff and never clobber the widget.
|
||||||
|
assert captured["sampling_plan"] == "custom"
|
||||||
|
assert captured["sampling_mode"] == "single"
|
||||||
|
assert captured["sampler"] == {"sampler": "euler"}
|
||||||
|
assert captured["sigmas"].shape == (5,)
|
||||||
|
|||||||
@ -462,9 +462,12 @@ def test_project_schema_takes_direct_model_inputs(moxie):
|
|||||||
"audio_vae",
|
"audio_vae",
|
||||||
"project_name",
|
"project_name",
|
||||||
"steps",
|
"steps",
|
||||||
|
"context_frames",
|
||||||
"seed",
|
"seed",
|
||||||
]
|
]
|
||||||
assert "model_loader" not in inputs
|
assert "model_loader" not in inputs
|
||||||
|
assert inputs["context_frames"].kwargs["options"] == ["5", "22", "39", "56"]
|
||||||
|
assert inputs["context_frames"].kwargs["default"] == "22"
|
||||||
|
|
||||||
# The four model components are required direct connections.
|
# The four model components are required direct connections.
|
||||||
for name in ("model", "clip", "video_vae", "audio_vae"):
|
for name in ("model", "clip", "video_vae", "audio_vae"):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user