diff --git a/README.md b/README.md index 9a268ad..0068c79 100644 --- a/README.md +++ b/README.md @@ -260,6 +260,39 @@ Merge: result = original[0:121] + vace[0:81] + original[153:274] --- +## Node: VACE Mode Select + +Utility node that selects a VACE mode by integer index. Useful when driving the mode choice from another node's integer output (e.g. a selector or counter) instead of a dropdown. + +### Inputs + +| Input | Type | Default | Description | +|---|---|---|---| +| `index` | INT | `0` | Mode index (0–9). Clamped to valid range. | + +### Index Mapping + +| Index | Mode | +|---|---| +| 0 | End Extend | +| 1 | Pre Extend | +| 2 | Middle Extend | +| 3 | Edge Extend | +| 4 | Join Extend | +| 5 | Bidirectional Extend | +| 6 | Frame Interpolation | +| 7 | Replace/Inpaint | +| 8 | Video Inpaint | +| 9 | Keyframe | + +### Outputs + +| Output | Type | Description | +|---|---|---| +| `mode` | COMBO | Selected mode string — wire to VACE Source Prep or VACE Mask Generator's `mode` input. | + +--- + ## Node: WanVideo Save Merged Model Saves a WanVideo diffusion model (with merged LoRAs) as a `.safetensors` file. Found under the **WanVideoWrapper** category. diff --git a/__init__.py b/__init__.py index f361624..697d817 100644 --- a/__init__.py +++ b/__init__.py @@ -11,6 +11,10 @@ from .merge_node import ( NODE_CLASS_MAPPINGS as MERGE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS as MERGE_DISPLAY_MAPPINGS, ) +from .mode_select_node import ( + NODE_CLASS_MAPPINGS as MODE_SELECT_CLASS_MAPPINGS, + NODE_DISPLAY_NAME_MAPPINGS as MODE_SELECT_DISPLAY_MAPPINGS, +) NODE_CLASS_MAPPINGS.update(SAVE_CLASS_MAPPINGS) NODE_CLASS_MAPPINGS.update(LATENT_CLASS_MAPPINGS) @@ -18,6 +22,8 @@ NODE_CLASS_MAPPINGS.update(MERGE_CLASS_MAPPINGS) NODE_DISPLAY_NAME_MAPPINGS.update(SAVE_DISPLAY_MAPPINGS) NODE_DISPLAY_NAME_MAPPINGS.update(LATENT_DISPLAY_MAPPINGS) NODE_DISPLAY_NAME_MAPPINGS.update(MERGE_DISPLAY_MAPPINGS) +NODE_CLASS_MAPPINGS.update(MODE_SELECT_CLASS_MAPPINGS) +NODE_DISPLAY_NAME_MAPPINGS.update(MODE_SELECT_DISPLAY_MAPPINGS) WEB_DIRECTORY = "./web/js" diff --git a/mode_select_node.py b/mode_select_node.py new file mode 100644 index 0000000..c7caeda --- /dev/null +++ b/mode_select_node.py @@ -0,0 +1,31 @@ +from .nodes import VACE_MODES + + +class VACEModeSelect: + """Select a VACE mode by integer index (0-9).""" + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "index": ("INT", {"default": 0, "min": 0, "max": len(VACE_MODES) - 1, "step": 1}), + }, + } + + RETURN_TYPES = (VACE_MODES,) + RETURN_NAMES = ("mode",) + FUNCTION = "select" + CATEGORY = "VACE Tools" + + def select(self, index): + index = max(0, min(index, len(VACE_MODES) - 1)) + return (VACE_MODES[index],) + + +NODE_CLASS_MAPPINGS = { + "VACEModeSelect": VACEModeSelect, +} + +NODE_DISPLAY_NAME_MAPPINGS = { + "VACEModeSelect": "VACE Mode Select", +}