File size: 1,230 Bytes
bc50ea0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | """Shared capability gate for MiniMax H3 masked-target operations."""
from __future__ import annotations
def require_h3_mask_support(operation: str = "masked target generation"):
"""Prefer native H3 AV masks and install only missing compatibility.
The node pack already targets the native Add Guide / MultiRef generation
of MiniMax H3. Keeping that baseline here prevents a legacy guide wrapper
and the newer per-row mask engine from being combined accidentally.
"""
from .patch_layout import native_guides_available
if not native_guides_available():
raise RuntimeError(
"h3_masking: %s requires the native MiniMax H3 Add Guide / "
"MultiRef core from ComfyUI PR #15439. Update ComfyUI before "
"using this path." % operation
)
from .h3_mask_compat import ensure_h3_mask_compat, is_ready
from .h3_mask_payload_compat import ensure_av_mask_payload_compat
ensure_h3_mask_compat()
ensure_av_mask_payload_compat()
if not is_ready():
raise RuntimeError(
"h3_masking: H3 per-stream AV mask support could not be enabled. "
"Check the ComfyUI console capability report."
)
return True
|