diff --git a/README.md b/README.md index 98d9baa..a9e7643 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,9 @@ checkpoint/ ## Workflow -[workflow/workflow_mat_anyone.json](workflow/workflow_mat_anyone.json) +The extension now includes the `MatAnyone2Video` node, which runs the improved MatAnyoneV2 model for higher-quality and more robust video matting. + +**Workflow**: [workflow/workflow_mat_anyone.json](workflow/workflow_mat_anyone.json) ![matanyone_example](workflow/mat_anyone_preview.png) (Not a workflow-embedded image) @@ -31,18 +33,16 @@ Inputs: - `mask_frame`: The input mask's index (defaults to 0). Support first (0), last and middle frame. - `n_warmup`: Number of iterations to warm up the model. Defaults to 10. +**Memory Management Inputs**: + +- `max_internal_size` (optional): Resizes the internal processing resolution to save memory (e.g., 360, 480). Default is -1 (full resolution). +- `max_mem_frames` (optional): The number of key frames kept in high-resolution working memory. Default is 5. +- `use_long_term` (optional): Limits active memory scaling by compressing older frames into long-term prototype memories, preventing OOM over time. Default is False. (Useful for long videos) + Your input mask won't actually be in the final matte. Instead, the warmup process generate a new input mask, which is then propagated throughout the video. -### MatAnyone 2 Support - -The extension now includes the `MatAnyone2Video` node, which runs the improved MatAnyoneV2 model for higher-quality and more robust video matting. - -**Workflow V2**: [workflow/workflow_mat_anyone_v2.json](workflow/workflow_mat_anyone_v2.json) - -![matanyone_example](workflow/mat_anyone_preview_v2.png) -(Not a workflow-embedded image) - Additional Inputs for V2: + - `r_erode` (optional): The radius for morphological erosion applied to the `foreground_mask` before processing (defaults to 0). Useful for refining rough masks. - `r_dilate` (optional): The radius for morphological dilation applied to the `foreground_mask` before processing (defaults to 0). diff --git a/mat_anyone.py b/mat_anyone.py index db262c9..a0e41c3 100644 --- a/mat_anyone.py +++ b/mat_anyone.py @@ -66,7 +66,6 @@ def inference_matanyone( n_warmup=10, ): mask = preprocess_mask(mask) - vframes = vframes.to(device) mask = mask.to(device) length = vframes.shape[0] phas = [None] * length # initialize output list @@ -80,13 +79,13 @@ def inference_matanyone( repeated_frames = repeated_frames.to(device) output_prob = warming_up(mask, processor, n_warmup, repeated_frames) - phas[0] = processor.output_prob_to_mask(output_prob).unsqueeze(0) + phas[0] = processor.output_prob_to_mask(output_prob).unsqueeze(0).cpu() pbar = ProgressBar(length - 1) for ti in tqdm(range(1, length), desc="Forward Propagation"): - image = vframes[ti] + image = vframes[ti].to(device) output_prob = processor.step(image) - phas[ti] = processor.output_prob_to_mask(output_prob).unsqueeze(0) + phas[ti] = processor.output_prob_to_mask(output_prob).unsqueeze(0).cpu() pbar.update_absolute(ti - 1, length - 1) elif frame_index == length - 1: @@ -98,15 +97,17 @@ def inference_matanyone( reversed_mask = mask # mask for the last frame output_prob = warming_up(reversed_mask, processor, n_warmup, repeated_frames) - phas[frame_index] = processor.output_prob_to_mask(output_prob).unsqueeze(0) + phas[frame_index] = ( + processor.output_prob_to_mask(output_prob).unsqueeze(0).cpu() + ) pbar = ProgressBar(length - 1) for ti in tqdm(range(1, length), desc="Backward Propagation"): - image = reversed_vframes[ti] + image = reversed_vframes[ti].to(device) output_prob = processor.step(image) - phas[length - 1 - ti] = processor.output_prob_to_mask( - output_prob - ).unsqueeze(0) # reverse index + phas[length - 1 - ti] = ( + processor.output_prob_to_mask(output_prob).unsqueeze(0).cpu() + ) # reverse index pbar.update_absolute(ti - 1, length - 1) elif 0 < frame_index < length - 1: @@ -117,14 +118,16 @@ def inference_matanyone( # Warm up at frame_index output_prob = warming_up(mask, processor, n_warmup, repeated_frames) - phas[frame_index] = processor.output_prob_to_mask(output_prob).unsqueeze(0) + phas[frame_index] = ( + processor.output_prob_to_mask(output_prob).unsqueeze(0).cpu() + ) # Forward Propagation (from frame_index + 1 to end) pbar_forward = ProgressBar(length - 1 - frame_index) for ti in tqdm(range(frame_index + 1, length), desc="Forward Propagation"): - image = vframes[ti] + image = vframes[ti].to(device) output_prob = processor.step(image) - phas[ti] = processor.output_prob_to_mask(output_prob).unsqueeze(0) + phas[ti] = processor.output_prob_to_mask(output_prob).unsqueeze(0).cpu() pbar_forward.update_absolute( ti - (frame_index + 1), length - 1 - frame_index ) @@ -134,11 +137,11 @@ def inference_matanyone( reversed_vframes_backward = torch.flip(vframes[:frame_index], dims=[0]) pbar_backward = ProgressBar(frame_index) for ti in tqdm(range(frame_index), desc="Backward Propagation"): - image = reversed_vframes_backward[ti] + image = reversed_vframes_backward[ti].to(device) output_prob = processor.step(image) - phas[frame_index - 1 - ti] = processor.output_prob_to_mask( - output_prob - ).unsqueeze(0) # reverse index + phas[frame_index - 1 - ti] = ( + processor.output_prob_to_mask(output_prob).unsqueeze(0).cpu() + ) # reverse index pbar_backward.update_absolute(ti, frame_index) return phas diff --git a/mat_anyone2.py b/mat_anyone2.py new file mode 100644 index 0000000..7cfe8b3 --- /dev/null +++ b/mat_anyone2.py @@ -0,0 +1,182 @@ +""" +MatAnyone2 inference wrapper for ComfyUI. +""" + +from pathlib import Path + +import numpy as np +import torch + +from comfy.utils import ProgressBar + +from .constants import ckpt_path_matanyone2 +from .src.matanyone2.inference.inference_core import InferenceCore +from .src.matanyone2.utils.get_default_model import get_matanyone2_model +from .src.matanyone2.utils.inference_utils import gen_dilate, gen_erosion + +base_dir = Path(__file__).resolve().parent +device = torch.device("cuda" if torch.cuda.is_available() else "cpu") + + +def get_matanyone2_model_cached(): + """Loads MatAnyone2 model from checkpoint (user must place matanyone2.pth in checkpoint/).""" + ckpt_path = base_dir / ckpt_path_matanyone2 + if not ckpt_path.exists(): + raise FileNotFoundError( + "MatAnyone2 checkpoint not found at %s. " + "Download matanyone2.pth and place it in the checkpoint folder." % ckpt_path + ) + return get_matanyone2_model(str(ckpt_path), device) + + +def warming_up2( + mask_t, processor, n_warmup, repeated_frames, pbar=None, pbar_start=0, total_len=0 +): + output_prob = None + objects = [1] + for ti in range(n_warmup): + image = repeated_frames[ti] + if ti == 0: + output_prob = processor.step(image, mask_t, objects=objects) + output_prob = processor.step(image, first_frame_pred=True) + else: + output_prob = processor.step(image, first_frame_pred=True) + if pbar is not None: + pbar.update_absolute(pbar_start + ti, total_len) + return output_prob + + +def inference_matanyone2( + vframes: torch.Tensor, + mask: torch.Tensor, + processor: InferenceCore, + mask_frame: int = 0, + n_warmup: int = 10, + r_erode: int = 0, + r_dilate: int = 0, +): + """ + Runs MatAnyone2 inference on video frames. + + Args: + vframes: (T, C, H, W) RGB, float [0, 1] + mask: (H, W) or (1, H, W) float [0, 1] or int + processor: InferenceCore instance + mask_frame: Frame index for mask + n_warmup: Warmup iterations + r_erode: Erosion kernel size + r_dilate: Dilation kernel size + + Returns: + List of alpha tensors (1, 1, H, W) per frame + """ + mask = mask.squeeze().float() + if mask.max() <= 1.0: + mask = (mask * 255).clamp(0, 255) + mask_np = mask.cpu().numpy().astype(np.uint8) + + if r_dilate > 0: + mask_np = gen_dilate(mask_np, r_dilate, r_dilate) + if r_erode > 0: + mask_np = gen_erosion(mask_np, r_erode, r_erode) + + mask_t = torch.from_numpy(mask_np).float().to(device) + length = vframes.shape[0] + + if mask_frame >= length: + raise ValueError(f"Expected 0 <= x < {length}, got {mask_frame}") + + phas = [None] * length + + if mask_frame == 0: + total_len = n_warmup + length + pbar = ProgressBar(total_len) + repeated_frames = vframes[0].unsqueeze(0).repeat(n_warmup, 1, 1, 1).to(device) + + output_prob = warming_up2( + mask_t, processor, n_warmup, repeated_frames, pbar, 0, total_len + ) + mask_out = processor.output_prob_to_mask(output_prob) + phas[0] = mask_out.unsqueeze(0).unsqueeze(0) + + for ti in range(1, length): + image = vframes[ti].to(device) + output_prob = processor.step(image) + mask_out = processor.output_prob_to_mask(output_prob) + phas[ti] = mask_out.unsqueeze(0).unsqueeze(0).cpu() + pbar.update_absolute(n_warmup + ti, total_len) + + elif mask_frame == length - 1: + total_len = n_warmup + length + pbar = ProgressBar(total_len) + reversed_vframes = torch.flip(vframes, dims=[0]) + repeated_frames = ( + reversed_vframes[0].unsqueeze(0).repeat(n_warmup, 1, 1, 1).to(device) + ) + + output_prob = warming_up2( + mask_t, processor, n_warmup, repeated_frames, pbar, 0, total_len + ) + mask_out = processor.output_prob_to_mask(output_prob) + phas[mask_frame] = mask_out.unsqueeze(0).unsqueeze(0).cpu() + + for ti in range(1, length): + image = reversed_vframes[ti].to(device) + output_prob = processor.step(image) + mask_out = processor.output_prob_to_mask(output_prob) + phas[length - 1 - ti] = mask_out.unsqueeze(0).unsqueeze(0).cpu() + pbar.update_absolute(n_warmup + ti, total_len) + + elif 0 < mask_frame < length - 1: + # Two passes: forward then backward + total_len = n_warmup + (length - mask_frame) + n_warmup + mask_frame + pbar = ProgressBar(total_len) + current_step = 0 + + # Pass 1: Forward + repeated_frames = ( + vframes[mask_frame].unsqueeze(0).repeat(n_warmup, 1, 1, 1).to(device) + ) + output_prob = warming_up2( + mask_t, processor, n_warmup, repeated_frames, pbar, current_step, total_len + ) + current_step += n_warmup + mask_out = processor.output_prob_to_mask(output_prob) + phas[mask_frame] = mask_out.unsqueeze(0).unsqueeze(0).cpu() + + for ti in range(mask_frame + 1, length): + image = vframes[ti].to(device) + output_prob = processor.step(image) + mask_out = processor.output_prob_to_mask(output_prob) + phas[ti] = mask_out.unsqueeze(0).unsqueeze(0).cpu() + pbar.update_absolute(current_step, total_len) + current_step += 1 + + # Pass 2: Backward + processor = type(processor)(processor.network, cfg=processor.network.cfg) + repeated_frames_back = ( + vframes[mask_frame].unsqueeze(0).repeat(n_warmup, 1, 1, 1).to(device) + ) + + output_prob = warming_up2( + mask_t, + processor, + n_warmup, + repeated_frames_back, + pbar, + current_step, + total_len, + ) + current_step += n_warmup + + reversed_vframes_backward = torch.flip(vframes[:mask_frame], dims=[0]) + + for ti in range(mask_frame): + image = reversed_vframes_backward[ti].to(device) + output_prob = processor.step(image) + mask_out = processor.output_prob_to_mask(output_prob) + phas[mask_frame - 1 - ti] = mask_out.unsqueeze(0).unsqueeze(0).cpu() + pbar.update_absolute(current_step, total_len) + current_step += 1 + + return phas diff --git a/run.py b/run.py index 6579d6c..fc84fad 100644 --- a/run.py +++ b/run.py @@ -45,6 +45,18 @@ class MatAnyoneVideo: "foreground_mask": ("IMAGE",), "foreground_MASK": ("MASK",), "solid_color": ("IMAGE",), + "max_internal_size": ( + "INT", + {"default": -1, "min": -1, "step": 1}, + ), + "max_mem_frames": ( + "INT", + {"default": 5, "min": 1, "step": 1}, + ), + "use_long_term": ( + "BOOLEAN", + {"default": False}, + ), }, } @@ -67,12 +79,19 @@ class MatAnyoneVideo: foreground_mask: torch.Tensor | None = None, foreground_MASK: torch.Tensor | None = None, solid_color: torch.Tensor | None = None, + max_internal_size: int = -1, + max_mem_frames: int = 5, + use_long_term: bool = False, ): mask = get_mask(foreground_mask, foreground_MASK) src_video = src_video.permute(0, 3, 1, 2) # T CHW RGB # load MatAnyone model matanyone = get_matanyone_model(f"{base_dir}/{ckpt_path}") + matanyone.cfg.max_internal_size = max_internal_size + matanyone.cfg.max_mem_frames = max_mem_frames + matanyone.cfg.use_long_term = use_long_term + processor = InferenceCore(matanyone, cfg=matanyone.cfg) phas = inference_matanyone(src_video, mask, processor, mask_frame, n_warmup) out_mask = torch.cat(phas).unsqueeze(1).permute(0, 2, 3, 1) @@ -123,6 +142,18 @@ class MatAnyone2Video: "INT", {"default": 0, "min": 0, "step": 1}, ), + "max_internal_size": ( + "INT", + {"default": -1, "min": -1, "step": 1}, + ), + "max_mem_frames": ( + "INT", + {"default": 5, "min": 1, "step": 1}, + ), + "use_long_term": ( + "BOOLEAN", + {"default": False}, + ), }, } @@ -147,11 +178,18 @@ class MatAnyone2Video: solid_color: torch.Tensor | None = None, r_erode: int = 0, r_dilate: int = 0, + max_internal_size: int = -1, + max_mem_frames: int = 5, + use_long_term: bool = False, ): mask = get_mask(foreground_mask, foreground_MASK) src_video = src_video.permute(0, 3, 1, 2) # T C H W RGB, [0, 1] matanyone2 = get_matanyone2_model_cached() + matanyone2.cfg.max_internal_size = max_internal_size + matanyone2.cfg.max_mem_frames = max_mem_frames + matanyone2.cfg.use_long_term = use_long_term + processor = InferenceCore2(matanyone2, cfg=matanyone2.cfg) phas = inference_matanyone2( src_video, diff --git a/src/matanyone2/inference/inference_core.py b/src/matanyone2/inference/inference_core.py index 91152dc..391731c 100644 --- a/src/matanyone2/inference/inference_core.py +++ b/src/matanyone2/inference/inference_core.py @@ -234,12 +234,20 @@ class InferenceCore: .long() ) else: - mask = F.interpolate( - mask.unsqueeze(0), - size=(new_h, new_w), - mode="bilinear", - align_corners=False, - )[0] + if mask.dim() == 2: + mask = F.interpolate( + mask.unsqueeze(0).unsqueeze(0).float(), + size=(new_h, new_w), + mode="bilinear", + align_corners=False, + )[0, 0] + else: + mask = F.interpolate( + mask.unsqueeze(0).float(), + size=(new_h, new_w), + mode="bilinear", + align_corners=False, + )[0] self.curr_ti += 1 diff --git a/workflow/mat_anyone_preview.png b/workflow/mat_anyone_preview.png index 463a75b..c20fa9e 100644 Binary files a/workflow/mat_anyone_preview.png and b/workflow/mat_anyone_preview.png differ diff --git a/workflow/mat_anyone_preview_v2.png b/workflow/mat_anyone_preview_v2.png deleted file mode 100644 index 1e18c05..0000000 Binary files a/workflow/mat_anyone_preview_v2.png and /dev/null differ diff --git a/workflow/workflow_mat_anyone.json b/workflow/workflow_mat_anyone.json index 09574d3..0ba7f5e 100644 --- a/workflow/workflow_mat_anyone.json +++ b/workflow/workflow_mat_anyone.json @@ -1,625 +1,1430 @@ { - "last_node_id": 43, - "last_link_id": 76, - "nodes": [ - { - "id": 40, - "type": "VHS_VideoInfoLoaded", - "pos": [ - -174.8192596435547, - 835.6626586914062 - ], - "size": [ - 242.013671875, - 106 - ], - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ + "id": "b93b71a0-0eab-4079-9e10-83b529e72423", + "revision": 0, + "last_node_id": 52, + "last_link_id": 120, + "nodes": [ { - "name": "video_info", - "type": "VHS_VIDEOINFO", - "link": 71 + "id": 47, + "type": "Reroute", + "pos": [ + 491.8094624515745, + 420.8710519552324 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 120 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 91 + ] + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 2, + "type": "VHS_LoadVideo", + "pos": [ + -856.5314306640627, + 408.2031335449222 + ], + "size": [ + 352.79998779296875, + 511.1687149392035 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [ + { + "localized_name": "meta_batch", + "name": "meta_batch", + "shape": 7, + "type": "VHS_BatchManager", + "link": null + }, + { + "localized_name": "vae", + "name": "vae", + "shape": 7, + "type": "VAE", + "link": null + }, + { + "localized_name": "video", + "name": "video", + "type": "COMBO", + "widget": { + "name": "video" + }, + "link": null + }, + { + "localized_name": "force_rate", + "name": "force_rate", + "type": "FLOAT", + "widget": { + "name": "force_rate" + }, + "link": null + }, + { + "localized_name": "custom_width", + "name": "custom_width", + "type": "INT", + "widget": { + "name": "custom_width" + }, + "link": null + }, + { + "localized_name": "custom_height", + "name": "custom_height", + "type": "INT", + "widget": { + "name": "custom_height" + }, + "link": null + }, + { + "localized_name": "frame_load_cap", + "name": "frame_load_cap", + "type": "INT", + "widget": { + "name": "frame_load_cap" + }, + "link": null + }, + { + "localized_name": "skip_first_frames", + "name": "skip_first_frames", + "type": "INT", + "widget": { + "name": "skip_first_frames" + }, + "link": null + }, + { + "localized_name": "select_every_nth", + "name": "select_every_nth", + "type": "INT", + "widget": { + "name": "select_every_nth" + }, + "link": null + }, + { + "localized_name": "format", + "name": "format", + "shape": 7, + "type": "COMBO", + "widget": { + "name": "format" + }, + "link": null + } + ], + "outputs": [ + { + "localized_name": "IMAGE", + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 41, + 92 + ] + }, + { + "localized_name": "frame_count", + "name": "frame_count", + "type": "INT", + "links": null + }, + { + "localized_name": "audio", + "name": "audio", + "type": "AUDIO", + "links": null + }, + { + "localized_name": "video_info", + "name": "video_info", + "type": "VHS_VIDEOINFO", + "links": [ + 71 + ] + } + ], + "properties": { + "cnr_id": "comfyui-videohelpersuite", + "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", + "Node name for S&R": "VHS_LoadVideo" + }, + "widgets_values": { + "video": "test-sample1.mp4", + "force_rate": 0, + "custom_width": 0, + "custom_height": 0, + "frame_load_cap": 0, + "skip_first_frames": 0, + "select_every_nth": 1, + "format": "None", + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "frame_load_cap": 0, + "skip_first_frames": 0, + "force_rate": 0, + "filename": "test-sample1.mp4", + "type": "input", + "format": "video/mp4", + "select_every_nth": 1 + }, + "muted": false + } + } + }, + { + "id": 48, + "type": "Reroute", + "pos": [ + -379.6686904316001, + 257.9196253900885 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 92 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 94, + 104 + ] + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 49, + "type": "Reroute", + "pos": [ + -98.94869043160021, + 856.869625390089 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 95 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 97, + 106 + ] + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 50, + "type": "Reroute", + "pos": [ + -98.94869043160007, + 813.3096253900883 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 98 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 100, + 105 + ] + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 40, + "type": "VHS_VideoInfoLoaded", + "pos": [ + -426.499259643554, + 358.92265869140675 + ], + "size": [ + 250.4166717529297, + 106 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "localized_name": "video_info", + "name": "video_info", + "type": "VHS_VIDEOINFO", + "link": 71 + } + ], + "outputs": [ + { + "localized_name": "fps🟦", + "name": "fps🟦", + "type": "FLOAT", + "links": [ + 101 + ] + }, + { + "localized_name": "frame_count🟦", + "name": "frame_count🟦", + "type": "INT", + "links": [] + }, + { + "localized_name": "duration🟦", + "name": "duration🟦", + "type": "FLOAT", + "links": null + }, + { + "localized_name": "width🟦", + "name": "width🟦", + "type": "INT", + "links": [ + 65 + ] + }, + { + "localized_name": "height🟦", + "name": "height🟦", + "type": "INT", + "links": [ + 66 + ] + } + ], + "properties": { + "cnr_id": "comfyui-videohelpersuite", + "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", + "Node name for S&R": "VHS_VideoInfoLoaded" + }, + "widgets_values": {} + }, + { + "id": 51, + "type": "Reroute", + "pos": [ + -98.9486904316001, + 900.4296253900897 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "widget": { + "name": "value" + }, + "link": 101 + } + ], + "outputs": [ + { + "name": "", + "type": "FLOAT", + "links": [ + 102, + 103 + ] + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 46, + "type": "Reroute", + "pos": [ + 491.80946245157384, + 381.1610519552331 + ], + "size": [ + 75, + 26 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "", + "type": "*", + "link": 119 + } + ], + "outputs": [ + { + "name": "", + "type": "IMAGE", + "links": [ + 89 + ] + } + ], + "properties": { + "showOutputText": false, + "horizontal": false + } + }, + { + "id": 3, + "type": "LoadImage", + "pos": [ + -497.34781982421777, + 512.7826000976554 + ], + "size": [ + 315, + 314.0000305175781 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [ + { + "localized_name": "image", + "name": "image", + "type": "COMBO", + "widget": { + "name": "image" + }, + "link": null + }, + { + "localized_name": "choose file to upload", + "name": "upload", + "type": "IMAGEUPLOAD", + "widget": { + "name": "upload" + }, + "link": null + } + ], + "outputs": [ + { + "localized_name": "IMAGE", + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 9, + 98 + ] + }, + { + "localized_name": "MASK", + "name": "MASK", + "type": "MASK", + "links": null + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.25", + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "joker_00019.png", + "image" + ] + }, + { + "id": 39, + "type": "SolidColorBatched", + "pos": [ + -397.20913696289057, + 877.9945092773443 + ], + "size": [ + 210, + 198 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "localized_name": "batch_size", + "name": "batch_size", + "type": "INT", + "widget": { + "name": "batch_size" + }, + "link": null + }, + { + "localized_name": "height", + "name": "height", + "type": "INT", + "widget": { + "name": "height" + }, + "link": 66 + }, + { + "localized_name": "width", + "name": "width", + "type": "INT", + "widget": { + "name": "width" + }, + "link": 65 + }, + { + "localized_name": "red", + "name": "red", + "type": "INT", + "widget": { + "name": "red" + }, + "link": null + }, + { + "localized_name": "green", + "name": "green", + "type": "INT", + "widget": { + "name": "green" + }, + "link": null + }, + { + "localized_name": "blue", + "name": "blue", + "type": "INT", + "widget": { + "name": "blue" + }, + "link": null + } + ], + "outputs": [ + { + "localized_name": "solid", + "name": "solid", + "type": "IMAGE", + "links": [ + 95 + ] + } + ], + "properties": { + "cnr_id": "matanyone", + "ver": "5d2c4294dbecc0f117d994a6545fa7db7cbe256f", + "Node name for S&R": "SolidColorBatched", + "aux_id": "FuouM/ComfyUI-MatAnyone" + }, + "widgets_values": [ + 1, + 720, + 1280, + 0, + 255, + 0 + ] + }, + { + "id": 42, + "type": "VHS_VideoCombine", + "pos": [ + 66.40084289550799, + 667.9227734374999 + ], + "size": [ + 315, + 513.9375 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "localized_name": "images", + "name": "images", + "type": "IMAGE", + "link": 91 + }, + { + "localized_name": "audio", + "name": "audio", + "shape": 7, + "type": "AUDIO", + "link": null + }, + { + "localized_name": "meta_batch", + "name": "meta_batch", + "shape": 7, + "type": "VHS_BatchManager", + "link": null + }, + { + "localized_name": "vae", + "name": "vae", + "shape": 7, + "type": "VAE", + "link": null + }, + { + "localized_name": "frame_rate", + "name": "frame_rate", + "type": "FLOAT", + "widget": { + "name": "frame_rate" + }, + "link": 102 + }, + { + "localized_name": "loop_count", + "name": "loop_count", + "type": "INT", + "widget": { + "name": "loop_count" + }, + "link": null + }, + { + "localized_name": "filename_prefix", + "name": "filename_prefix", + "type": "STRING", + "widget": { + "name": "filename_prefix" + }, + "link": null + }, + { + "localized_name": "format", + "name": "format", + "type": "COMBO", + "widget": { + "name": "format" + }, + "link": null + }, + { + "localized_name": "pingpong", + "name": "pingpong", + "type": "BOOLEAN", + "widget": { + "name": "pingpong" + }, + "link": null + }, + { + "localized_name": "save_output", + "name": "save_output", + "type": "BOOLEAN", + "widget": { + "name": "save_output" + }, + "link": null + }, + { + "name": "pix_fmt", + "type": [ + "yuv420p", + "p010le" + ], + "widget": { + "name": "pix_fmt" + }, + "link": null + }, + { + "name": "bitrate", + "type": "INT", + "widget": { + "name": "bitrate" + }, + "link": null + }, + { + "name": "megabit", + "type": "BOOLEAN", + "widget": { + "name": "megabit" + }, + "link": null + }, + { + "name": "save_metadata", + "type": "BOOLEAN", + "widget": { + "name": "save_metadata" + }, + "link": null + } + ], + "outputs": [ + { + "localized_name": "Filenames", + "name": "Filenames", + "type": "VHS_FILENAMES", + "links": null + } + ], + "properties": { + "cnr_id": "comfyui-videohelpersuite", + "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", + "Node name for S&R": "VHS_VideoCombine" + }, + "widgets_values": { + "frame_rate": 8, + "loop_count": 0, + "filename_prefix": "GB", + "format": "video/nvenc_h264-mp4", + "pix_fmt": "yuv420p", + "bitrate": 10, + "megabit": true, + "save_metadata": true, + "pingpong": false, + "save_output": true, + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "GB_00007.mp4", + "subfolder": "", + "type": "output", + "format": "video/nvenc_h264-mp4", + "frame_rate": 30, + "workflow": "GB_00007.png", + "fullpath": "J:\\REAI\\ComfyUI_windows_portable_nvidia_cu128\\ComfyUI_windows_portable\\ComfyUI\\output\\GB_00007.mp4" + }, + "muted": false + } + } + }, + { + "id": 5, + "type": "VHS_VideoCombine", + "pos": [ + 407.07914184570353, + 664.3545971679687 + ], + "size": [ + 315, + 513.9375 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "localized_name": "images", + "name": "images", + "type": "IMAGE", + "link": 89 + }, + { + "localized_name": "audio", + "name": "audio", + "shape": 7, + "type": "AUDIO", + "link": null + }, + { + "localized_name": "meta_batch", + "name": "meta_batch", + "shape": 7, + "type": "VHS_BatchManager", + "link": null + }, + { + "localized_name": "vae", + "name": "vae", + "shape": 7, + "type": "VAE", + "link": null + }, + { + "localized_name": "frame_rate", + "name": "frame_rate", + "type": "FLOAT", + "widget": { + "name": "frame_rate" + }, + "link": 103 + }, + { + "localized_name": "loop_count", + "name": "loop_count", + "type": "INT", + "widget": { + "name": "loop_count" + }, + "link": null + }, + { + "localized_name": "filename_prefix", + "name": "filename_prefix", + "type": "STRING", + "widget": { + "name": "filename_prefix" + }, + "link": null + }, + { + "localized_name": "format", + "name": "format", + "type": "COMBO", + "widget": { + "name": "format" + }, + "link": null + }, + { + "localized_name": "pingpong", + "name": "pingpong", + "type": "BOOLEAN", + "widget": { + "name": "pingpong" + }, + "link": null + }, + { + "localized_name": "save_output", + "name": "save_output", + "type": "BOOLEAN", + "widget": { + "name": "save_output" + }, + "link": null + }, + { + "name": "pix_fmt", + "type": [ + "yuv420p", + "p010le" + ], + "widget": { + "name": "pix_fmt" + }, + "link": null + }, + { + "name": "bitrate", + "type": "INT", + "widget": { + "name": "bitrate" + }, + "link": null + }, + { + "name": "megabit", + "type": "BOOLEAN", + "widget": { + "name": "megabit" + }, + "link": null + }, + { + "name": "save_metadata", + "type": "BOOLEAN", + "widget": { + "name": "save_metadata" + }, + "link": null + } + ], + "outputs": [ + { + "localized_name": "Filenames", + "name": "Filenames", + "type": "VHS_FILENAMES", + "links": null + } + ], + "properties": { + "cnr_id": "comfyui-videohelpersuite", + "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", + "Node name for S&R": "VHS_VideoCombine" + }, + "widgets_values": { + "frame_rate": 8, + "loop_count": 0, + "filename_prefix": "Matte", + "format": "video/nvenc_h264-mp4", + "pix_fmt": "yuv420p", + "bitrate": 10, + "megabit": true, + "save_metadata": true, + "pingpong": false, + "save_output": true, + "videopreview": { + "hidden": false, + "paused": false, + "params": { + "filename": "Matte_00007.mp4", + "subfolder": "", + "type": "output", + "format": "video/nvenc_h264-mp4", + "frame_rate": 30, + "workflow": "Matte_00007.png", + "fullpath": "J:\\REAI\\ComfyUI_windows_portable_nvidia_cu128\\ComfyUI_windows_portable\\ComfyUI\\output\\Matte_00007.mp4" + }, + "muted": false + } + } + }, + { + "id": 15, + "type": "MatAnyone", + "pos": [ + 66.31596496582057, + 412.63909667968795 + ], + "size": [ + 236.8000030517578, + 214 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "localized_name": "src_video", + "name": "src_video", + "type": "IMAGE", + "link": 94 + }, + { + "localized_name": "foreground_mask", + "name": "foreground_mask", + "shape": 7, + "type": "IMAGE", + "link": 100 + }, + { + "localized_name": "foreground_MASK", + "name": "foreground_MASK", + "shape": 7, + "type": "MASK", + "link": null + }, + { + "localized_name": "solid_color", + "name": "solid_color", + "shape": 7, + "type": "IMAGE", + "link": 97 + }, + { + "localized_name": "mask_frame", + "name": "mask_frame", + "type": "INT", + "widget": { + "name": "mask_frame" + }, + "link": null + }, + { + "localized_name": "n_warmup", + "name": "n_warmup", + "type": "INT", + "widget": { + "name": "n_warmup" + }, + "link": null + }, + { + "localized_name": "max_internal_size", + "name": "max_internal_size", + "shape": 7, + "type": "INT", + "widget": { + "name": "max_internal_size" + }, + "link": null + }, + { + "localized_name": "max_mem_frames", + "name": "max_mem_frames", + "shape": 7, + "type": "INT", + "widget": { + "name": "max_mem_frames" + }, + "link": null + }, + { + "localized_name": "use_long_term", + "name": "use_long_term", + "shape": 7, + "type": "BOOLEAN", + "widget": { + "name": "use_long_term" + }, + "link": null + } + ], + "outputs": [ + { + "localized_name": "matte", + "name": "matte", + "type": "IMAGE", + "links": [ + 36 + ] + }, + { + "localized_name": "green_screen", + "name": "green_screen", + "type": "IMAGE", + "links": [] + } + ], + "properties": { + "cnr_id": "matanyone", + "ver": "5d2c4294dbecc0f117d994a6545fa7db7cbe256f", + "Node name for S&R": "MatAnyone", + "aux_id": "FuouM/ComfyUI-MatAnyone" + }, + "widgets_values": [ + 19, + 10, + -1, + 5, + false + ] + }, + { + "id": 52, + "type": "MatAnyone2", + "pos": [ + 19.235804248344152, + 105.08861919516241 + ], + "size": [ + 285.5999984741211, + 262 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "localized_name": "src_video", + "name": "src_video", + "type": "IMAGE", + "link": 104 + }, + { + "localized_name": "foreground_mask", + "name": "foreground_mask", + "shape": 7, + "type": "IMAGE", + "link": 105 + }, + { + "localized_name": "foreground_MASK", + "name": "foreground_MASK", + "shape": 7, + "type": "MASK", + "link": null + }, + { + "localized_name": "solid_color", + "name": "solid_color", + "shape": 7, + "type": "IMAGE", + "link": 106 + }, + { + "localized_name": "mask_frame", + "name": "mask_frame", + "type": "INT", + "widget": { + "name": "mask_frame" + }, + "link": null + }, + { + "localized_name": "n_warmup", + "name": "n_warmup", + "type": "INT", + "widget": { + "name": "n_warmup" + }, + "link": null + }, + { + "localized_name": "r_erode", + "name": "r_erode", + "shape": 7, + "type": "INT", + "widget": { + "name": "r_erode" + }, + "link": null + }, + { + "localized_name": "r_dilate", + "name": "r_dilate", + "shape": 7, + "type": "INT", + "widget": { + "name": "r_dilate" + }, + "link": null + }, + { + "localized_name": "max_internal_size", + "name": "max_internal_size", + "shape": 7, + "type": "INT", + "widget": { + "name": "max_internal_size" + }, + "link": null + }, + { + "localized_name": "max_mem_frames", + "name": "max_mem_frames", + "shape": 7, + "type": "INT", + "widget": { + "name": "max_mem_frames" + }, + "link": null + }, + { + "localized_name": "use_long_term", + "name": "use_long_term", + "shape": 7, + "type": "BOOLEAN", + "widget": { + "name": "use_long_term" + }, + "link": null + } + ], + "outputs": [ + { + "localized_name": "matte", + "name": "matte", + "type": "IMAGE", + "links": [ + 119 + ] + }, + { + "localized_name": "green_screen", + "name": "green_screen", + "type": "IMAGE", + "links": [ + 120 + ] + } + ], + "properties": { + "cnr_id": "matanyone", + "ver": "15fe8a622223dea4eaa65a8828937544b0bfbd41", + "Node name for S&R": "MatAnyone2" + }, + "widgets_values": [ + 19, + 10, + 0, + 0, + -1, + 5, + false + ] } - ], - "outputs": [ - { - "name": "fps🟦", - "type": "FLOAT", - "links": [ - 74, - 75 - ] - }, - { - "name": "frame_count🟦", - "type": "INT", - "links": [] - }, - { - "name": "duration🟦", - "type": "FLOAT", - "links": null - }, - { - "name": "width🟦", - "type": "INT", - "links": [ - 65 - ] - }, - { - "name": "height🟦", - "type": "INT", - "links": [ - 66 - ] - } - ], - "properties": { - "cnr_id": "comfyui-videohelpersuite", - "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", - "Node name for S&R": "VHS_VideoInfoLoaded" - }, - "widgets_values": {} - }, - { - "id": 5, - "type": "VHS_VideoCombine", - "pos": [ - 474.8391418457031, - 666.7745971679688 - ], - "size": [ - 315, - 533.9375 - ], - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "shape": 7, - "link": 72 - }, - { - "name": "audio", - "type": "AUDIO", - "shape": 7, - "link": null - }, - { - "name": "meta_batch", - "type": "VHS_BatchManager", - "shape": 7, - "link": null - }, - { - "name": "vae", - "type": "VAE", - "shape": 7, - "link": null - }, - { - "name": "frame_rate", - "type": "FLOAT", - "widget": { - "name": "frame_rate" - }, - "link": 75 - } - ], - "outputs": [ - { - "name": "Filenames", - "type": "VHS_FILENAMES", - "links": null - } - ], - "properties": { - "cnr_id": "comfyui-videohelpersuite", - "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", - "Node name for S&R": "VHS_VideoCombine" - }, - "widgets_values": { - "frame_rate": 8, - "loop_count": 0, - "filename_prefix": "Matte", - "format": "video/nvenc_h264-mp4", - "pix_fmt": "yuv420p", - "bitrate": 10, - "megabit": true, - "save_metadata": true, - "pingpong": false, - "save_output": false, - "videopreview": { - "hidden": false, - "paused": false, - "params": { - "filename": "Matte_00001.mp4", - "subfolder": "", - "type": "temp", - "format": "video/nvenc_h264-mp4", - "frame_rate": 30, - "workflow": "Matte_00001.png", - "fullpath": "K:\\ComfyUI_windows_portable\\ComfyUI\\temp\\Matte_00001.mp4" - }, - "muted": false - } - } - }, - { - "id": 15, - "type": "MatAnyone", - "pos": [ - 171.0359649658203, - 475.4490966796875 - ], - "size": [ - 236.8000030517578, - 142 - ], - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "src_video", - "type": "IMAGE", - "link": 42 - }, - { - "name": "foreground_mask", - "type": "IMAGE", - "shape": 7, - "link": 68 - }, - { - "name": "foreground_MASK", - "type": "MASK", - "shape": 7, - "link": null - }, - { - "name": "solid_color", - "type": "IMAGE", - "shape": 7, - "link": 64 - } - ], - "outputs": [ - { - "name": "matte", - "type": "IMAGE", - "links": [ - 36, - 72 - ] - }, - { - "name": "green_screen", - "type": "IMAGE", - "links": [ - 73 - ] - } - ], - "properties": { - "aux_id": "FuouM/ComfyUI-MatAnyone", - "ver": "5d2c4294dbecc0f117d994a6545fa7db7cbe256f", - "Node name for S&R": "MatAnyone" - }, - "widgets_values": [ - 0, - 10 - ] - }, - { - "id": 3, - "type": "LoadImage", - "pos": [ - -180.32781982421875, - 472.85260009765625 - ], - "size": [ - 315, - 314.0000305175781 - ], - "flags": {}, - "order": 0, - "mode": 0, - "inputs": [], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9, - 68 - ] - }, - { - "name": "MASK", - "type": "MASK", - "links": null - } - ], - "properties": { - "cnr_id": "comfy-core", - "ver": "0.3.25", - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "joker_00000.png", - "image" - ] - }, - { - "id": 2, - "type": "VHS_LoadVideo", - "pos": [ - -567.3414306640625, - 437.2431335449219 - ], - "size": [ - 352.79998779296875, - 511.168701171875 - ], - "flags": {}, - "order": 1, - "mode": 0, - "inputs": [ - { - "name": "meta_batch", - "type": "VHS_BatchManager", - "shape": 7, - "link": null - }, - { - "name": "vae", - "type": "VAE", - "shape": 7, - "link": null - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 41 - ] - }, - { - "name": "frame_count", - "type": "INT", - "links": null - }, - { - "name": "audio", - "type": "AUDIO", - "links": null - }, - { - "name": "video_info", - "type": "VHS_VIDEOINFO", - "links": [ - 71 - ] - } - ], - "properties": { - "cnr_id": "comfyui-videohelpersuite", - "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", - "Node name for S&R": "VHS_LoadVideo" - }, - "widgets_values": { - "video": "test-sample1.mp4", - "force_rate": 0, - "custom_width": 0, - "custom_height": 0, - "frame_load_cap": 0, - "skip_first_frames": 0, - "select_every_nth": 1, - "format": "None", - "choose video to upload": "image", - "videopreview": { - "hidden": false, - "paused": false, - "params": { - "frame_load_cap": 0, - "skip_first_frames": 0, - "force_rate": 0, - "filename": "test-sample1.mp4", - "type": "input", - "format": "video/mp4", - "select_every_nth": 1 - }, - "muted": false - } - } - }, - { - "id": 42, - "type": "VHS_VideoCombine", - "pos": [ - 134.1608428955078, - 670.3427734375 - ], - "size": [ - 315, - 533.9375 - ], - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "shape": 7, - "link": 73 - }, - { - "name": "audio", - "type": "AUDIO", - "shape": 7, - "link": null - }, - { - "name": "meta_batch", - "type": "VHS_BatchManager", - "shape": 7, - "link": null - }, - { - "name": "vae", - "type": "VAE", - "shape": 7, - "link": null - }, - { - "name": "frame_rate", - "type": "FLOAT", - "widget": { - "name": "frame_rate" - }, - "link": 74 - } - ], - "outputs": [ - { - "name": "Filenames", - "type": "VHS_FILENAMES", - "links": null - } - ], - "properties": { - "cnr_id": "comfyui-videohelpersuite", - "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", - "Node name for S&R": "VHS_VideoCombine" - }, - "widgets_values": { - "frame_rate": 8, - "loop_count": 0, - "filename_prefix": "GB", - "format": "video/nvenc_h264-mp4", - "pix_fmt": "yuv420p", - "bitrate": 10, - "megabit": true, - "save_metadata": true, - "pingpong": false, - "save_output": false, - "videopreview": { - "hidden": false, - "paused": false, - "params": { - "filename": "GB_00001.mp4", - "subfolder": "", - "type": "temp", - "format": "video/nvenc_h264-mp4", - "frame_rate": 30, - "workflow": "GB_00001.png", - "fullpath": "K:\\ComfyUI_windows_portable\\ComfyUI\\temp\\GB_00001.mp4" - }, - "muted": false - } - } - }, - { - "id": 39, - "type": "SolidColorBatched", - "pos": [ - -155.20913696289062, - 985.6845092773438 - ], - "size": [ - 210, - 198 - ], - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "width", - "type": "INT", - "widget": { - "name": "width" - }, - "link": 65 - }, - { - "name": "height", - "type": "INT", - "widget": { - "name": "height" - }, - "link": 66 - } - ], - "outputs": [ - { - "name": "solid", - "type": "IMAGE", - "links": [ - 64 - ] - } - ], - "properties": { - "aux_id": "FuouM/ComfyUI-MatAnyone", - "ver": "5d2c4294dbecc0f117d994a6545fa7db7cbe256f", - "Node name for S&R": "SolidColorBatched" - }, - "widgets_values": [ - 1, - 720, - 1280, - 0, - 255, - 0 - ] - } - ], - "links": [ - [ - 19, - 7, - 0, - 5, - 4, - "FLOAT" ], - [ - 42, - 2, - 0, - 15, - 0, - "IMAGE" - ], - [ - 49, - 7, - 0, - 33, - 4, - "FLOAT" - ], - [ - 64, - 39, - 0, - 15, - 3, - "IMAGE" - ], - [ - 65, - 40, - 3, - 39, - 0, - "INT" - ], - [ - 66, - 40, - 4, - 39, - 1, - "INT" - ], - [ - 68, - 3, - 0, - 15, - 1, - "IMAGE" - ], - [ - 71, - 2, - 3, - 40, - 0, - "VHS_VIDEOINFO" - ], - [ - 72, - 15, - 0, - 5, - 0, - "IMAGE" - ], - [ - 73, - 15, - 1, - 42, - 0, - "IMAGE" - ], - [ - 74, - 40, - 0, - 42, - 4, - "FLOAT" - ], - [ - 75, - 40, - 0, - 5, - 4, - "FLOAT" - ] - ], - "groups": [], - "config": {}, - "extra": { - "ds": { - "scale": 1, - "offset": [ - 732, - -327 - ] - }, - "linkExtensions": [ - { - "id": 19, - "parentId": 3 - }, - { - "id": 49, - "parentId": 3 - } - ], - "reroutes": [ - { - "id": 3, - "pos": [ - 1139.3179931640625, - 206.41610717773438 + "links": [ + [ + 19, + 7, + 0, + 5, + 4, + "FLOAT" ], - "linkIds": [ - 19, - 49 + [ + 49, + 7, + 0, + 33, + 4, + "FLOAT" + ], + [ + 65, + 40, + 3, + 39, + 2, + "INT" + ], + [ + 66, + 40, + 4, + 39, + 1, + "INT" + ], + [ + 71, + 2, + 3, + 40, + 0, + "VHS_VIDEOINFO" + ], + [ + 89, + 46, + 0, + 5, + 0, + "IMAGE" + ], + [ + 91, + 47, + 0, + 42, + 0, + "IMAGE" + ], + [ + 92, + 2, + 0, + 48, + 0, + "IMAGE" + ], + [ + 94, + 48, + 0, + 15, + 0, + "IMAGE" + ], + [ + 95, + 39, + 0, + 49, + 0, + "IMAGE" + ], + [ + 97, + 49, + 0, + 15, + 3, + "IMAGE" + ], + [ + 98, + 3, + 0, + 50, + 0, + "IMAGE" + ], + [ + 100, + 50, + 0, + 15, + 1, + "IMAGE" + ], + [ + 101, + 40, + 0, + 51, + 0, + "FLOAT" + ], + [ + 102, + 51, + 0, + 42, + 4, + "FLOAT" + ], + [ + 103, + 51, + 0, + 5, + 4, + "FLOAT" + ], + [ + 104, + 48, + 0, + 52, + 0, + "IMAGE" + ], + [ + 105, + 50, + 0, + 52, + 1, + "IMAGE" + ], + [ + 106, + 49, + 0, + 52, + 3, + "IMAGE" + ], + [ + 119, + 52, + 0, + 46, + 0, + "IMAGE" + ], + [ + 120, + 52, + 1, + 47, + 0, + "IMAGE" ] - } ], - "VHS_latentpreview": false, - "VHS_latentpreviewrate": 0, - "VHS_MetadataImage": true, - "VHS_KeepIntermediate": true - }, - "version": 0.4 + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 1.2100000000000013, + "offset": [ + 253.7044952835048, + -392.62431579704895 + ] + }, + "reroutes": [ + { + "id": 3, + "pos": [ + 1139.3179931640625, + 206.41610717773438 + ], + "linkIds": [ + 19, + 49 + ] + } + ], + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true, + "linkExtensions": [ + { + "id": 19, + "parentId": 3 + }, + { + "id": 49, + "parentId": 3 + } + ] + }, + "version": 0.4 } \ No newline at end of file diff --git a/workflow/workflow_mat_anyone_v2.json b/workflow/workflow_mat_anyone_v2.json deleted file mode 100644 index 876b56c..0000000 --- a/workflow/workflow_mat_anyone_v2.json +++ /dev/null @@ -1,1364 +0,0 @@ -{ - "id": "b93b71a0-0eab-4079-9e10-83b529e72423", - "revision": 0, - "last_node_id": 51, - "last_link_id": 103, - "nodes": [ - { - "id": 42, - "type": "VHS_VideoCombine", - "pos": [ - 66.40084289550799, - 667.9227734374999 - ], - "size": [ - 315, - 513.9375 - ], - "flags": {}, - "order": 13, - "mode": 0, - "inputs": [ - { - "localized_name": "images", - "name": "images", - "type": "IMAGE", - "link": 91 - }, - { - "localized_name": "audio", - "name": "audio", - "shape": 7, - "type": "AUDIO", - "link": null - }, - { - "localized_name": "meta_batch", - "name": "meta_batch", - "shape": 7, - "type": "VHS_BatchManager", - "link": null - }, - { - "localized_name": "vae", - "name": "vae", - "shape": 7, - "type": "VAE", - "link": null - }, - { - "localized_name": "frame_rate", - "name": "frame_rate", - "type": "FLOAT", - "widget": { - "name": "frame_rate" - }, - "link": 102 - }, - { - "localized_name": "loop_count", - "name": "loop_count", - "type": "INT", - "widget": { - "name": "loop_count" - }, - "link": null - }, - { - "localized_name": "filename_prefix", - "name": "filename_prefix", - "type": "STRING", - "widget": { - "name": "filename_prefix" - }, - "link": null - }, - { - "localized_name": "format", - "name": "format", - "type": "COMBO", - "widget": { - "name": "format" - }, - "link": null - }, - { - "localized_name": "pingpong", - "name": "pingpong", - "type": "BOOLEAN", - "widget": { - "name": "pingpong" - }, - "link": null - }, - { - "localized_name": "save_output", - "name": "save_output", - "type": "BOOLEAN", - "widget": { - "name": "save_output" - }, - "link": null - }, - { - "name": "pix_fmt", - "type": [ - "yuv420p", - "p010le" - ], - "widget": { - "name": "pix_fmt" - }, - "link": null - }, - { - "name": "bitrate", - "type": "INT", - "widget": { - "name": "bitrate" - }, - "link": null - }, - { - "name": "megabit", - "type": "BOOLEAN", - "widget": { - "name": "megabit" - }, - "link": null - }, - { - "name": "save_metadata", - "type": "BOOLEAN", - "widget": { - "name": "save_metadata" - }, - "link": null - } - ], - "outputs": [ - { - "localized_name": "Filenames", - "name": "Filenames", - "type": "VHS_FILENAMES", - "links": null - } - ], - "properties": { - "cnr_id": "comfyui-videohelpersuite", - "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", - "Node name for S&R": "VHS_VideoCombine" - }, - "widgets_values": { - "frame_rate": 8, - "loop_count": 0, - "filename_prefix": "GB", - "format": "video/nvenc_h264-mp4", - "pix_fmt": "yuv420p", - "bitrate": 10, - "megabit": true, - "save_metadata": true, - "pingpong": false, - "save_output": false, - "videopreview": { - "hidden": false, - "paused": false, - "params": { - "filename": "GB_00001.mp4", - "subfolder": "", - "type": "temp", - "format": "video/nvenc_h264-mp4", - "frame_rate": 30, - "workflow": "GB_00001.png", - "fullpath": "J:\\REAI\\ComfyUI_windows_portable_nvidia_cu128\\ComfyUI_windows_portable\\ComfyUI\\temp\\GB_00001.mp4" - }, - "muted": false - } - } - }, - { - "id": 47, - "type": "Reroute", - "pos": [ - 491.8094624515745, - 420.8710519552324 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 90 - } - ], - "outputs": [ - { - "name": "", - "type": "IMAGE", - "links": [ - 91 - ] - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 2, - "type": "VHS_LoadVideo", - "pos": [ - -856.5314306640627, - 408.2031335449222 - ], - "size": [ - 352.79998779296875, - 511.1687149392035 - ], - "flags": {}, - "order": 0, - "mode": 0, - "inputs": [ - { - "localized_name": "meta_batch", - "name": "meta_batch", - "shape": 7, - "type": "VHS_BatchManager", - "link": null - }, - { - "localized_name": "vae", - "name": "vae", - "shape": 7, - "type": "VAE", - "link": null - }, - { - "localized_name": "video", - "name": "video", - "type": "COMBO", - "widget": { - "name": "video" - }, - "link": null - }, - { - "localized_name": "force_rate", - "name": "force_rate", - "type": "FLOAT", - "widget": { - "name": "force_rate" - }, - "link": null - }, - { - "localized_name": "custom_width", - "name": "custom_width", - "type": "INT", - "widget": { - "name": "custom_width" - }, - "link": null - }, - { - "localized_name": "custom_height", - "name": "custom_height", - "type": "INT", - "widget": { - "name": "custom_height" - }, - "link": null - }, - { - "localized_name": "frame_load_cap", - "name": "frame_load_cap", - "type": "INT", - "widget": { - "name": "frame_load_cap" - }, - "link": null - }, - { - "localized_name": "skip_first_frames", - "name": "skip_first_frames", - "type": "INT", - "widget": { - "name": "skip_first_frames" - }, - "link": null - }, - { - "localized_name": "select_every_nth", - "name": "select_every_nth", - "type": "INT", - "widget": { - "name": "select_every_nth" - }, - "link": null - }, - { - "localized_name": "format", - "name": "format", - "shape": 7, - "type": "COMBO", - "widget": { - "name": "format" - }, - "link": null - } - ], - "outputs": [ - { - "localized_name": "IMAGE", - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 41, - 92 - ] - }, - { - "localized_name": "frame_count", - "name": "frame_count", - "type": "INT", - "links": null - }, - { - "localized_name": "audio", - "name": "audio", - "type": "AUDIO", - "links": null - }, - { - "localized_name": "video_info", - "name": "video_info", - "type": "VHS_VIDEOINFO", - "links": [ - 71 - ] - } - ], - "properties": { - "cnr_id": "comfyui-videohelpersuite", - "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", - "Node name for S&R": "VHS_LoadVideo" - }, - "widgets_values": { - "video": "test-sample1.mp4", - "force_rate": 0, - "custom_width": 0, - "custom_height": 0, - "frame_load_cap": 0, - "skip_first_frames": 0, - "select_every_nth": 1, - "format": "None", - "videopreview": { - "hidden": false, - "paused": false, - "params": { - "frame_load_cap": 0, - "skip_first_frames": 0, - "force_rate": 0, - "filename": "test-sample1.mp4", - "type": "input", - "format": "video/mp4", - "select_every_nth": 1 - }, - "muted": false - } - } - }, - { - "id": 48, - "type": "Reroute", - "pos": [ - -379.6686904316001, - 257.9196253900885 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 92 - } - ], - "outputs": [ - { - "name": "", - "type": "IMAGE", - "links": [ - 93, - 94 - ] - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 49, - "type": "Reroute", - "pos": [ - -98.94869043160021, - 856.869625390089 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 95 - } - ], - "outputs": [ - { - "name": "", - "type": "IMAGE", - "links": [ - 96, - 97 - ] - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 50, - "type": "Reroute", - "pos": [ - -98.94869043160007, - 813.3096253900883 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 98 - } - ], - "outputs": [ - { - "name": "", - "type": "IMAGE", - "links": [ - 99, - 100 - ] - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 40, - "type": "VHS_VideoInfoLoaded", - "pos": [ - -426.499259643554, - 358.92265869140675 - ], - "size": [ - 250.4166717529297, - 106 - ], - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "localized_name": "video_info", - "name": "video_info", - "type": "VHS_VIDEOINFO", - "link": 71 - } - ], - "outputs": [ - { - "localized_name": "fps🟦", - "name": "fps🟦", - "type": "FLOAT", - "links": [ - 101 - ] - }, - { - "localized_name": "frame_count🟦", - "name": "frame_count🟦", - "type": "INT", - "links": [] - }, - { - "localized_name": "duration🟦", - "name": "duration🟦", - "type": "FLOAT", - "links": null - }, - { - "localized_name": "width🟦", - "name": "width🟦", - "type": "INT", - "links": [ - 65 - ] - }, - { - "localized_name": "height🟦", - "name": "height🟦", - "type": "INT", - "links": [ - 66 - ] - } - ], - "properties": { - "cnr_id": "comfyui-videohelpersuite", - "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", - "Node name for S&R": "VHS_VideoInfoLoaded" - }, - "widgets_values": {} - }, - { - "id": 51, - "type": "Reroute", - "pos": [ - -98.9486904316001, - 900.4296253900897 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "widget": { - "name": "value" - }, - "link": 101 - } - ], - "outputs": [ - { - "name": "", - "type": "FLOAT", - "links": [ - 102, - 103 - ] - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 15, - "type": "MatAnyone", - "pos": [ - 74.78596496582053, - 474.3490966796875 - ], - "size": [ - 236.8000030517578, - 142 - ], - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "localized_name": "src_video", - "name": "src_video", - "type": "IMAGE", - "link": 94 - }, - { - "localized_name": "foreground_mask", - "name": "foreground_mask", - "shape": 7, - "type": "IMAGE", - "link": 100 - }, - { - "localized_name": "foreground_MASK", - "name": "foreground_MASK", - "shape": 7, - "type": "MASK", - "link": null - }, - { - "localized_name": "solid_color", - "name": "solid_color", - "shape": 7, - "type": "IMAGE", - "link": 97 - }, - { - "localized_name": "mask_frame", - "name": "mask_frame", - "type": "INT", - "widget": { - "name": "mask_frame" - }, - "link": null - }, - { - "localized_name": "n_warmup", - "name": "n_warmup", - "type": "INT", - "widget": { - "name": "n_warmup" - }, - "link": null - } - ], - "outputs": [ - { - "localized_name": "matte", - "name": "matte", - "type": "IMAGE", - "links": [ - 36 - ] - }, - { - "localized_name": "green_screen", - "name": "green_screen", - "type": "IMAGE", - "links": [] - } - ], - "properties": { - "cnr_id": "matanyone", - "ver": "5d2c4294dbecc0f117d994a6545fa7db7cbe256f", - "Node name for S&R": "MatAnyone", - "aux_id": "FuouM/ComfyUI-MatAnyone" - }, - "widgets_values": [ - 19, - 10 - ] - }, - { - "id": 45, - "type": "MatAnyone2", - "pos": [ - 79.7358042483442, - 240.60861919516236 - ], - "size": [ - 285.5999984741211, - 190 - ], - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "localized_name": "src_video", - "name": "src_video", - "type": "IMAGE", - "link": 93 - }, - { - "localized_name": "foreground_mask", - "name": "foreground_mask", - "shape": 7, - "type": "IMAGE", - "link": 99 - }, - { - "localized_name": "foreground_MASK", - "name": "foreground_MASK", - "shape": 7, - "type": "MASK", - "link": null - }, - { - "localized_name": "solid_color", - "name": "solid_color", - "shape": 7, - "type": "IMAGE", - "link": 96 - }, - { - "localized_name": "mask_frame", - "name": "mask_frame", - "type": "INT", - "widget": { - "name": "mask_frame" - }, - "link": null - }, - { - "localized_name": "n_warmup", - "name": "n_warmup", - "type": "INT", - "widget": { - "name": "n_warmup" - }, - "link": null - }, - { - "localized_name": "r_erode", - "name": "r_erode", - "shape": 7, - "type": "INT", - "widget": { - "name": "r_erode" - }, - "link": null - }, - { - "localized_name": "r_dilate", - "name": "r_dilate", - "shape": 7, - "type": "INT", - "widget": { - "name": "r_dilate" - }, - "link": null - } - ], - "outputs": [ - { - "localized_name": "matte", - "name": "matte", - "type": "IMAGE", - "links": [ - 88 - ] - }, - { - "localized_name": "green_screen", - "name": "green_screen", - "type": "IMAGE", - "links": [ - 90 - ] - } - ], - "properties": { - "cnr_id": "matanyone", - "ver": "15fe8a622223dea4eaa65a8828937544b0bfbd41", - "Node name for S&R": "MatAnyone2" - }, - "widgets_values": [ - 19, - 10, - 0, - 0 - ] - }, - { - "id": 46, - "type": "Reroute", - "pos": [ - 491.80946245157384, - 381.1610519552331 - ], - "size": [ - 75, - 26 - ], - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "", - "type": "*", - "link": 88 - } - ], - "outputs": [ - { - "name": "", - "type": "IMAGE", - "links": [ - 89 - ] - } - ], - "properties": { - "showOutputText": false, - "horizontal": false - } - }, - { - "id": 5, - "type": "VHS_VideoCombine", - "pos": [ - 407.07914184570353, - 664.3545971679687 - ], - "size": [ - 315, - 513.9375 - ], - "flags": {}, - "order": 12, - "mode": 0, - "inputs": [ - { - "localized_name": "images", - "name": "images", - "type": "IMAGE", - "link": 89 - }, - { - "localized_name": "audio", - "name": "audio", - "shape": 7, - "type": "AUDIO", - "link": null - }, - { - "localized_name": "meta_batch", - "name": "meta_batch", - "shape": 7, - "type": "VHS_BatchManager", - "link": null - }, - { - "localized_name": "vae", - "name": "vae", - "shape": 7, - "type": "VAE", - "link": null - }, - { - "localized_name": "frame_rate", - "name": "frame_rate", - "type": "FLOAT", - "widget": { - "name": "frame_rate" - }, - "link": 103 - }, - { - "localized_name": "loop_count", - "name": "loop_count", - "type": "INT", - "widget": { - "name": "loop_count" - }, - "link": null - }, - { - "localized_name": "filename_prefix", - "name": "filename_prefix", - "type": "STRING", - "widget": { - "name": "filename_prefix" - }, - "link": null - }, - { - "localized_name": "format", - "name": "format", - "type": "COMBO", - "widget": { - "name": "format" - }, - "link": null - }, - { - "localized_name": "pingpong", - "name": "pingpong", - "type": "BOOLEAN", - "widget": { - "name": "pingpong" - }, - "link": null - }, - { - "localized_name": "save_output", - "name": "save_output", - "type": "BOOLEAN", - "widget": { - "name": "save_output" - }, - "link": null - }, - { - "name": "pix_fmt", - "type": [ - "yuv420p", - "p010le" - ], - "widget": { - "name": "pix_fmt" - }, - "link": null - }, - { - "name": "bitrate", - "type": "INT", - "widget": { - "name": "bitrate" - }, - "link": null - }, - { - "name": "megabit", - "type": "BOOLEAN", - "widget": { - "name": "megabit" - }, - "link": null - }, - { - "name": "save_metadata", - "type": "BOOLEAN", - "widget": { - "name": "save_metadata" - }, - "link": null - } - ], - "outputs": [ - { - "localized_name": "Filenames", - "name": "Filenames", - "type": "VHS_FILENAMES", - "links": null - } - ], - "properties": { - "cnr_id": "comfyui-videohelpersuite", - "ver": "5e61bcf218fe3bb7c899bbd584bbc99a9d05fb42", - "Node name for S&R": "VHS_VideoCombine" - }, - "widgets_values": { - "frame_rate": 8, - "loop_count": 0, - "filename_prefix": "Matte", - "format": "video/nvenc_h264-mp4", - "pix_fmt": "yuv420p", - "bitrate": 10, - "megabit": true, - "save_metadata": true, - "pingpong": false, - "save_output": false, - "videopreview": { - "hidden": false, - "paused": false, - "params": { - "filename": "Matte_00001.mp4", - "subfolder": "", - "type": "temp", - "format": "video/nvenc_h264-mp4", - "frame_rate": 30, - "workflow": "Matte_00001.png", - "fullpath": "J:\\REAI\\ComfyUI_windows_portable_nvidia_cu128\\ComfyUI_windows_portable\\ComfyUI\\temp\\Matte_00001.mp4" - }, - "muted": false - } - } - }, - { - "id": 3, - "type": "LoadImage", - "pos": [ - -497.34781982421777, - 512.7826000976554 - ], - "size": [ - 315, - 314.0000305175781 - ], - "flags": {}, - "order": 1, - "mode": 0, - "inputs": [ - { - "localized_name": "image", - "name": "image", - "type": "COMBO", - "widget": { - "name": "image" - }, - "link": null - }, - { - "localized_name": "choose file to upload", - "name": "upload", - "type": "IMAGEUPLOAD", - "widget": { - "name": "upload" - }, - "link": null - } - ], - "outputs": [ - { - "localized_name": "IMAGE", - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9, - 98 - ] - }, - { - "localized_name": "MASK", - "name": "MASK", - "type": "MASK", - "links": null - } - ], - "properties": { - "cnr_id": "comfy-core", - "ver": "0.3.25", - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "joker_00019.png", - "image" - ] - }, - { - "id": 39, - "type": "SolidColorBatched", - "pos": [ - -397.20913696289057, - 877.9945092773443 - ], - "size": [ - 210, - 198 - ], - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "localized_name": "batch_size", - "name": "batch_size", - "type": "INT", - "widget": { - "name": "batch_size" - }, - "link": null - }, - { - "localized_name": "height", - "name": "height", - "type": "INT", - "widget": { - "name": "height" - }, - "link": 66 - }, - { - "localized_name": "width", - "name": "width", - "type": "INT", - "widget": { - "name": "width" - }, - "link": 65 - }, - { - "localized_name": "red", - "name": "red", - "type": "INT", - "widget": { - "name": "red" - }, - "link": null - }, - { - "localized_name": "green", - "name": "green", - "type": "INT", - "widget": { - "name": "green" - }, - "link": null - }, - { - "localized_name": "blue", - "name": "blue", - "type": "INT", - "widget": { - "name": "blue" - }, - "link": null - } - ], - "outputs": [ - { - "localized_name": "solid", - "name": "solid", - "type": "IMAGE", - "links": [ - 95 - ] - } - ], - "properties": { - "cnr_id": "matanyone", - "ver": "5d2c4294dbecc0f117d994a6545fa7db7cbe256f", - "Node name for S&R": "SolidColorBatched", - "aux_id": "FuouM/ComfyUI-MatAnyone" - }, - "widgets_values": [ - 1, - 720, - 1280, - 0, - 255, - 0 - ] - } - ], - "links": [ - [ - 19, - 7, - 0, - 5, - 4, - "FLOAT" - ], - [ - 49, - 7, - 0, - 33, - 4, - "FLOAT" - ], - [ - 65, - 40, - 3, - 39, - 2, - "INT" - ], - [ - 66, - 40, - 4, - 39, - 1, - "INT" - ], - [ - 71, - 2, - 3, - 40, - 0, - "VHS_VIDEOINFO" - ], - [ - 88, - 45, - 0, - 46, - 0, - "IMAGE" - ], - [ - 89, - 46, - 0, - 5, - 0, - "IMAGE" - ], - [ - 90, - 45, - 1, - 47, - 0, - "IMAGE" - ], - [ - 91, - 47, - 0, - 42, - 0, - "IMAGE" - ], - [ - 92, - 2, - 0, - 48, - 0, - "IMAGE" - ], - [ - 93, - 48, - 0, - 45, - 0, - "IMAGE" - ], - [ - 94, - 48, - 0, - 15, - 0, - "IMAGE" - ], - [ - 95, - 39, - 0, - 49, - 0, - "IMAGE" - ], - [ - 96, - 49, - 0, - 45, - 3, - "IMAGE" - ], - [ - 97, - 49, - 0, - 15, - 3, - "IMAGE" - ], - [ - 98, - 3, - 0, - 50, - 0, - "IMAGE" - ], - [ - 99, - 50, - 0, - 45, - 1, - "IMAGE" - ], - [ - 100, - 50, - 0, - 15, - 1, - "IMAGE" - ], - [ - 101, - 40, - 0, - 51, - 0, - "FLOAT" - ], - [ - 102, - 51, - 0, - 42, - 4, - "FLOAT" - ], - [ - 103, - 51, - 0, - 5, - 4, - "FLOAT" - ] - ], - "groups": [], - "config": {}, - "extra": { - "ds": { - "scale": 0.8264462809917354, - "offset": [ - 1075.4186904316002, - -106.66962539008848 - ] - }, - "reroutes": [ - { - "id": 3, - "pos": [ - 1139.3179931640625, - 206.41610717773438 - ], - "linkIds": [ - 19, - 49 - ] - } - ], - "VHS_latentpreview": false, - "VHS_latentpreviewrate": 0, - "VHS_MetadataImage": true, - "VHS_KeepIntermediate": true, - "linkExtensions": [ - { - "id": 19, - "parentId": 3 - }, - { - "id": 49, - "parentId": 3 - } - ] - }, - "version": 0.4 -} \ No newline at end of file