Release V2.1.5 UI serialization stability fix
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_v214_frontend_collapses_advanced_controls_without_reordering_outputs():
|
||||
source = (ROOT / "web" / "h3_continuum_v214.js").read_text(encoding="utf-8")
|
||||
|
||||
assert 'const ADVANCED_PROPERTY = "h3_show_advanced"' in source
|
||||
assert '["last_frame", "IMAGE"]' in source
|
||||
assert '["prompt_plan", "H3_CONTINUUM_PROMPT_PLAN"]' in source
|
||||
assert '["last_state", "H3_CONTINUUM_STATE"]' in source
|
||||
assert "hasAdvancedConnection(node)" in source
|
||||
assert "removeUnlinkedAdvancedSlots(node)" in source
|
||||
assert "Advanced Settings ▸" in source
|
||||
assert "placeAdvancedButton(node, button, expanded)" in source
|
||||
|
||||
|
||||
def test_all_non_primary_nodes_use_native_comfyui_deprecation():
|
||||
source = (ROOT / "nodes.py").read_text(encoding="utf-8")
|
||||
|
||||
assert 'if _node_id == "H3ContinuumSamplerV2"' in source
|
||||
assert "_node_class.DEPRECATED = True" in source
|
||||
assert 'f"{CATEGORY}/Legacy"' in source
|
||||
assert 'f"[Legacy] {_display_name}"' in source
|
||||
|
||||
|
||||
def test_v214_version_metadata_matches():
|
||||
assert 'PACKAGE_VERSION = "2.1.4"' in (ROOT / "version.py").read_text(encoding="utf-8")
|
||||
assert "version = 2.1.4" in (ROOT / "metadata.ini").read_text(encoding="utf-8")
|
||||
assert 'version = "2.1.4"' in (ROOT / "pyproject.toml").read_text(encoding="utf-8")
|
||||
@@ -0,0 +1,133 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.v2.nodes import H3ContinuumSamplerV2
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
SERIALIZED_WIDGET_ORDER = [
|
||||
"prompt_mode",
|
||||
"prompt_script",
|
||||
"chunks",
|
||||
"chunk_seconds",
|
||||
"width",
|
||||
"height",
|
||||
"continuity",
|
||||
"base_seed",
|
||||
"control_after_generate",
|
||||
"audio_continuity",
|
||||
"exact_total_duration",
|
||||
"diagnostics",
|
||||
"reroll_from_chunk",
|
||||
"reroll_nonce",
|
||||
"strict_compatibility",
|
||||
"debug",
|
||||
"seam_correction",
|
||||
"show_preview",
|
||||
]
|
||||
|
||||
|
||||
def test_v215_frontend_preserves_backend_serialization_structure():
|
||||
source = (ROOT / "web" / "h3_continuum_v2.js").read_text(encoding="utf-8")
|
||||
assert not (ROOT / "web" / "h3_continuum_v214.js").exists()
|
||||
for forbidden in (
|
||||
'widget.type = "converted-widget"',
|
||||
'widget.type = "hidden"',
|
||||
"node.widgets.splice(",
|
||||
"node.removeInput(",
|
||||
"node.addInput(",
|
||||
"node.removeOutput(",
|
||||
"node.addOutput(",
|
||||
):
|
||||
assert forbidden not in source
|
||||
assert "setWidgetCollapsed" in source
|
||||
assert "placeTransientAfter" in source
|
||||
assert "serializedBefore.every" in source
|
||||
assert "slotVisibilityRules" in source
|
||||
assert "node.removeInput(" not in source
|
||||
assert "node.addInput(" not in source
|
||||
assert "node.removeOutput(" not in source
|
||||
assert "node.addOutput(" not in source
|
||||
assert "node.widgets.splice(" not in source
|
||||
assert "ensureSeamCorrectionProxy" in source
|
||||
assert "Individual Clip Overrides" in source
|
||||
assert "button.serialize = false" in source
|
||||
assert 'name: "H3Continuum.V215StableInterface"' in source
|
||||
assert source.count("nodeType.prototype.onNodeCreated = function") == 1
|
||||
assert source.count("nodeType.prototype.onConfigure = function") == 1
|
||||
|
||||
|
||||
def test_v215_backend_widget_order_and_workflow_values_remain_aligned():
|
||||
required = H3ContinuumSamplerV2.INPUT_TYPES()["required"]
|
||||
assert list(required)[6:] == [
|
||||
"prompt_mode",
|
||||
"prompt_script",
|
||||
"chunks",
|
||||
"chunk_seconds",
|
||||
"width",
|
||||
"height",
|
||||
"continuity",
|
||||
"base_seed",
|
||||
"audio_continuity",
|
||||
"exact_total_duration",
|
||||
"diagnostics",
|
||||
"reroll_from_chunk",
|
||||
"reroll_nonce",
|
||||
"strict_compatibility",
|
||||
"debug",
|
||||
"seam_correction",
|
||||
]
|
||||
values = [
|
||||
"Auto",
|
||||
"Preserved fallback prompt",
|
||||
2,
|
||||
5.0,
|
||||
1344,
|
||||
768,
|
||||
"Balanced — 22 frames",
|
||||
123456789,
|
||||
"fixed",
|
||||
True,
|
||||
True,
|
||||
"Basic",
|
||||
0,
|
||||
0,
|
||||
True,
|
||||
False,
|
||||
"Auto",
|
||||
True,
|
||||
]
|
||||
mapped = dict(zip(SERIALIZED_WIDGET_ORDER, values, strict=True))
|
||||
assert mapped["chunks"] == 2
|
||||
assert mapped["chunk_seconds"] == 5.0
|
||||
assert mapped["width"] == 1344
|
||||
assert mapped["height"] == 768
|
||||
assert mapped["continuity"] == "Balanced — 22 frames"
|
||||
assert mapped["base_seed"] == 123456789
|
||||
assert mapped["seam_correction"] == "Auto"
|
||||
|
||||
data = json.loads((ROOT / "examples" / "H3_Continuum_V2_3x5s.json").read_text(encoding="utf-8"))
|
||||
node = next(item for item in data["nodes"] if item["type"] == "H3ContinuumSamplerV2")
|
||||
legacy_values = node["widgets_values"]
|
||||
legacy = dict(zip(SERIALIZED_WIDGET_ORDER[:16], legacy_values, strict=True))
|
||||
assert legacy["chunks"] == 3
|
||||
assert legacy["chunk_seconds"] == 5.0
|
||||
assert legacy["width"] == 1344
|
||||
assert legacy["height"] == 768
|
||||
assert legacy["continuity"] == "Balanced — 22 frames"
|
||||
assert legacy["base_seed"] == 123456789
|
||||
|
||||
|
||||
def test_all_non_primary_nodes_use_native_comfyui_deprecation():
|
||||
source = (ROOT / "nodes.py").read_text(encoding="utf-8")
|
||||
assert 'if _node_id == "H3ContinuumSamplerV2"' in source
|
||||
assert "_node_class.DEPRECATED = True" in source
|
||||
assert 'f"{CATEGORY}/Legacy"' in source
|
||||
assert 'f"[Legacy] {_display_name}"' in source
|
||||
|
||||
|
||||
def test_v215_version_metadata_matches():
|
||||
assert 'PACKAGE_VERSION = "2.1.5"' in (ROOT / "version.py").read_text(encoding="utf-8")
|
||||
assert "version = 2.1.5" in (ROOT / "metadata.ini").read_text(encoding="utf-8")
|
||||
assert 'version = "2.1.5"' in (ROOT / "pyproject.toml").read_text(encoding="utf-8")
|
||||
@@ -3,7 +3,7 @@ from pathlib import Path
|
||||
from ComfyUI_H3_Continuum_Join.nodes import NODE_CLASS_MAPPINGS
|
||||
from ComfyUI_H3_Continuum_Join.constants import (
|
||||
PROMPT_FORMAT_OPTIONS,
|
||||
SEAM_CORRECTION_OFF,
|
||||
SEAM_CORRECTION_AUTO,
|
||||
)
|
||||
|
||||
|
||||
@@ -43,14 +43,15 @@ def test_v2_sampler_registers_preview_setting_bridge_and_sixteen_prompt_inputs()
|
||||
assert prompt_input[1]["forceInput"] is True
|
||||
|
||||
|
||||
def test_v2_sampler_defaults_to_the_legacy_seam_path():
|
||||
def test_v2_sampler_defaults_to_auto_seam_correction():
|
||||
schema = NODE_CLASS_MAPPINGS["H3ContinuumSamplerV2"].INPUT_TYPES()
|
||||
assert schema["required"]["seam_correction"][1]["default"] == SEAM_CORRECTION_OFF
|
||||
assert schema["required"]["seam_correction"][1]["default"] == SEAM_CORRECTION_AUTO
|
||||
|
||||
|
||||
def test_v2_interface_keeps_sequence_socket_and_collapsible_overrides():
|
||||
def test_v2_interface_keeps_sequence_socket_and_stable_override_slots():
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
source = (root / "web" / "h3_continuum_v2.js").read_text(encoding="utf-8")
|
||||
assert 'const SEQUENCE_PROMPT_INPUT = "sequence_prompt"' in source
|
||||
assert "Individual Clip Overrides" in source
|
||||
assert "!inputIsConnected(input)" in source
|
||||
assert "syncPromptInputs(node)" in source
|
||||
assert "node.removeInput(" not in source
|
||||
assert "node.addInput(" not in source
|
||||
|
||||
@@ -43,6 +43,24 @@ def test_corrected_cut_preserves_the_total_frame_count():
|
||||
assert corrected_total == legacy_total
|
||||
|
||||
|
||||
def test_auto_keeps_a_clean_legacy_video_boundary():
|
||||
previous = _frames([0.2, 0.2, 0.2, 0.2])
|
||||
current = _frames([0.2, 0.2, 0.2, 0.2])
|
||||
|
||||
corrected, decision, patch = correct_seam(
|
||||
previous,
|
||||
current,
|
||||
context_frames=2,
|
||||
automatic=True,
|
||||
)
|
||||
|
||||
assert torch.equal(corrected, current[2:])
|
||||
assert decision.cut_rewind_frames == 0
|
||||
assert decision.corrected_score == decision.legacy_score
|
||||
assert decision.fallback_reason.startswith("Auto kept the legacy video seam")
|
||||
assert patch is None
|
||||
|
||||
|
||||
def test_high_motion_disables_video_blend():
|
||||
metrics = VideoSeamMetrics(
|
||||
pixel_mae_norm=0.1,
|
||||
|
||||
Reference in New Issue
Block a user