Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

ComfyUI: a mask composite that puts only the swapped character back over the original footage

Claude20df64028cad
diff --git a/scripts/comfy/build-library.mjs b/scripts/comfy/build-library.mjs
index d9cc9686..72b2ce95 100644
--- a/scripts/comfy/build-library.mjs
+++ b/scripts/comfy/build-library.mjs
@@ -155,6 +155,8 @@ export const BINDING_KEYS = new Set([
'preset',
// Open-H3 Regenerate (n7-3): the pack's output size and draft size (its combo strings) and the refine's start noise
'resolution', 'draftSize', 'startSigma',
+ // Character swap in 2K (n7-4): the mask composite's window starts, the two layers' places and the mask's soft edge
+ 'takeStart', 'maskStart', 'takeX', 'takeY', 'regionWidth', 'regionHeight', 'regionX', 'regionY', 'feather',
// Clean up voice (ComfyUI-RE-USE): the RE-USE file, the rate it runs at, room tone, level and the music & effects bed's level
'reuseModel', 'rate', 'roomToneDb', 'level', 'bedDb',
]);
diff --git a/scripts/comfy/hand-built/video-composite-mask.json b/scripts/comfy/hand-built/video-composite-mask.json
new file mode 100644
index 00000000..9495031b
--- /dev/null
+++ b/scripts/comfy/hand-built/video-composite-mask.json
@@ -0,0 +1,132 @@
+{
+ "source": {
+ "class_type": "LoadVideo",
+ "inputs": { "file": "source.mp4" },
+ "_meta": { "title": "The original footage (24 fps, the film's size)" }
+ },
+ "source_slice": {
+ "class_type": "Video Slice",
+ "inputs": { "video": ["source", 0], "start_time": 0.0, "duration": 0.0, "strict_duration": false },
+ "_meta": { "title": "This window of the footage" }
+ },
+ "source_parts": {
+ "class_type": "GetVideoComponents",
+ "inputs": { "video": ["source_slice", 0] },
+ "_meta": { "title": "Footage frames, sound and rate" }
+ },
+ "take": {
+ "class_type": "LoadVideo",
+ "inputs": { "file": "take.mp4" },
+ "_meta": { "title": "The 768p swap (H3's canvas)" }
+ },
+ "take_slice": {
+ "class_type": "Video Slice",
+ "inputs": { "video": ["take", 0], "start_time": 0.0, "duration": 0.0, "strict_duration": false },
+ "_meta": { "title": "This window of the swap" }
+ },
+ "take_parts": {
+ "class_type": "GetVideoComponents",
+ "inputs": { "video": ["take_slice", 0] },
+ "_meta": { "title": "Swap frames" }
+ },
+ "regen": {
+ "class_type": "LoadVideo",
+ "inputs": { "file": "regen.mp4" },
+ "_meta": { "title": "The regenerated swap (1080p / 2K / 4K, 16:9 or 9:16)" }
+ },
+ "regen_slice": {
+ "class_type": "Video Slice",
+ "inputs": { "video": ["regen", 0], "start_time": 0.0, "duration": 0.0, "strict_duration": false },
+ "_meta": { "title": "This window of the regenerate" }
+ },
+ "regen_parts": {
+ "class_type": "GetVideoComponents",
+ "inputs": { "video": ["regen_slice", 0] },
+ "_meta": { "title": "Regenerated frames" }
+ },
+ "mask": {
+ "class_type": "LoadVideo",
+ "inputs": { "file": "mask.mp4" },
+ "_meta": { "title": "Who was swapped: the approved mask (white = the person, H3's canvas)" }
+ },
+ "mask_slice": {
+ "class_type": "Video Slice",
+ "inputs": { "video": ["mask", 0], "start_time": 0.0, "duration": 0.0, "strict_duration": false },
+ "_meta": { "title": "This window of the mask" }
+ },
+ "mask_parts": {
+ "class_type": "GetVideoComponents",
+ "inputs": { "video": ["mask_slice", 0] },
+ "_meta": { "title": "Mask frames" }
+ },
+ "take_scaled": {
+ "class_type": "ImageScale",
+ "inputs": { "image": ["take_parts", 0], "upscale_method": "lanczos", "width": 320, "height": 180, "crop": "disabled" },
+ "_meta": { "title": "Swap to its place in the footage" }
+ },
+ "take_mask_img": {
+ "class_type": "ImageScale",
+ "inputs": { "image": ["mask_parts", 0], "upscale_method": "bilinear", "width": 320, "height": 180, "crop": "disabled" },
+ "_meta": { "title": "Mask to the swap's place" }
+ },
+ "take_mask": {
+ "class_type": "ImageToMask",
+ "inputs": { "image": ["take_mask_img", 0], "channel": "red" },
+ "_meta": { "title": "Mask (red channel)" }
+ },
+ "take_grow": {
+ "class_type": "GrowMask",
+ "inputs": { "mask": ["take_mask", 0], "expand": 8, "tapered_corners": true },
+ "_meta": { "title": "Grow the mask" }
+ },
+ "take_feather": {
+ "class_type": "FeatherMask",
+ "inputs": { "mask": ["take_grow", 0], "left": 12, "top": 12, "right": 12, "bottom": 12 },
+ "_meta": { "title": "Soft edge" }
+ },
+ "base": {
+ "class_type": "ImageCompositeMasked",
+ "inputs": { "destination": ["source_parts", 0], "source": ["take_scaled", 0], "x": 0, "y": 0, "resize_source": false, "mask": ["take_feather", 0] },
+ "_meta": { "title": "Your character from the 768p swap over the footage (fills in where the regenerate's frame doesn't reach)" }
+ },
+ "regen_scaled": {
+ "class_type": "ImageScale",
+ "inputs": { "image": ["regen_parts", 0], "upscale_method": "lanczos", "width": 320, "height": 180, "crop": "disabled" },
+ "_meta": { "title": "Regenerate to its place in the footage" }
+ },
+ "regen_mask_img": {
+ "class_type": "ImageScale",
+ "inputs": { "image": ["mask_parts", 0], "upscale_method": "bilinear", "width": 320, "height": 180, "crop": "center" },
+ "_meta": { "title": "Mask to the regenerate's place (the centre the regenerate kept)" }
+ },
+ "regen_mask": {
+ "class_type": "ImageToMask",
+ "inputs": { "image": ["regen_mask_img", 0], "channel": "red" },
+ "_meta": { "title": "Mask (red channel)" }
+ },
+ "regen_grow": {
+ "class_type": "GrowMask",
+ "inputs": { "mask": ["regen_mask", 0], "expand": 8, "tapered_corners": true },
+ "_meta": { "title": "Grow the mask" }
+ },
+ "regen_feather": {
+ "class_type": "FeatherMask",
+ "inputs": { "mask": ["regen_grow", 0], "left": 12, "top": 12, "right": 12, "bottom": 12 },
+ "_meta": { "title": "Soft edge" }
+ },
+ "composite": {
+ "class_type": "ImageCompositeMasked",
+ "inputs": { "destination": ["base", 0], "source": ["regen_scaled", 0], "x": 0, "y": 0, "resize_source": false, "mask": ["regen_feather", 0] },
+ "_meta": { "title": "Only your character from the regenerate, over the footage" }
+ },
+ "create": {
+ "class_type": "CreateVideo",
+ "inputs": { "images": ["composite", 0], "audio": ["source_parts", 1], "fps": ["source_parts", 2], "bit_depth": "auto", "color_space": "sRGB", "codec": "none" },
+ "_meta": { "title": "The footage's own sound and rate" }
+ },
+ "save": {
+ "class_type": "SaveVideo",
+ "inputs": { "video": ["create", 0], "filename_prefix": "fuobe/video-composite-mask", "format": "auto", "format.codec": "auto", "codec": "auto" },
+ "_meta": { "title": "Save video" }
+ }
+}
diff --git a/scripts/comfy/library.spec.mjs b/scripts/comfy/library.spec.mjs
index 9e94bc8e..3c1d2e7e 100644
--- a/scripts/comfy/library.spec.mjs
+++ b/scripts/comfy/library.spec.mjs
@@ -4449,6 +4449,38 @@ export const SPEC = [
'length, which CreateVideo muxes back at 24 fps. Measured by the pack\'s author: about 3 min per 5 s at 2K on a 72 GB RTX PRO 5000 (9.5 min with dense attention); 22 s on a B200 (NVIDIA); ' +
'a community run reached about 1080p on 32 GB with a lossy LoRA. The packs were tested by their author on ComfyUI 0.42.0.',
},
+ // ---- Character swap in 2K (package n7-4-character-swap-2k; docs/research/new-models-7.md §2.10 rows 4-5): only the swapped
+ // character comes from the regenerate, over the original footage, with the footage's own sound.
+ {
+ id: 'video-composite-mask',
+ title: 'Put only the swapped character back over the original footage: the 768p swap, then the regenerated one, each through the approved mask (grown, feathered), with the footage\'s sound (core nodes, no model)',
+ capability: 'overlay',
+ handBuilt: 'hand-built/video-composite-mask.json',
+ bindings: {
+ video: [b('source', 'file')], video2: [b('regen', 'file')], video3: [b('take', 'file')], mask: [b('mask', 'file')],
+ startTime: [b('source_slice', 'start_time')], windowStart: [b('regen_slice', 'start_time')], takeStart: [b('take_slice', 'start_time')], maskStart: [b('mask_slice', 'start_time')],
+ duration: [b('source_slice', 'duration'), b('regen_slice', 'duration'), b('take_slice', 'duration'), b('mask_slice', 'duration')],
+ canvasWidth: [b('take_scaled', 'width'), b('take_mask_img', 'width')], canvasHeight: [b('take_scaled', 'height'), b('take_mask_img', 'height')],
+ takeX: [b('base', 'x')], takeY: [b('base', 'y')],
+ regionWidth: [b('regen_scaled', 'width'), b('regen_mask_img', 'width')], regionHeight: [b('regen_scaled', 'height'), b('regen_mask_img', 'height')],
+ regionX: [b('composite', 'x')], regionY: [b('composite', 'y')],
+ maskGrow: [b('take_grow', 'expand'), b('regen_grow', 'expand')],
+ feather: [b('take_feather', 'left'), b('take_feather', 'top'), b('take_feather', 'right'), b('take_feather', 'bottom'), b('regen_feather', 'left'), b('regen_feather', 'top'), b('regen_feather', 'right'), b('regen_feather', 'bottom')],
+ filenamePrefix: [b('save', 'filename_prefix')],
+ },
+ outputs: [{ node: 'save', kind: 'video' }],
+ defaults: { startTime: 0, windowStart: 0, takeStart: 0, maskStart: 0, duration: 3, canvasWidth: 320, canvasHeight: 180, takeX: 0, takeY: 0, regionWidth: 316, regionHeight: 180, regionX: 2, regionY: 0, maskGrow: 8, feather: 12 },
+ vramGb: 0,
+ license: 'n/a (no model; ComfyUI core)',
+ notes:
+ 'Character Swap Studio\'s Sharpen and Genjutsu\'s Character swap at 1080p / 2K / 4K on your GPU: a swap was redrawn by video-regenerate-h3, and only the character goes back over the footage, so the background and the sound stay as filmed. ' +
+ 'video = the footage at 24 fps and the film\'s size (the studio\'s 24 fps copy, or Genjutsu\'s part fitted by video-fit-clip), video3 = the 768p swap (H3\'s canvas), video2 = its regenerate, mask = the approved whole-shot mask from video-mask-h3-relay (H3\'s canvas, white = the person). ' +
+ 'Each LoadVideo goes through a Video Slice of the same duration (one composite window of at most 3 s, because every stream is decoded as float32, about 25 MB a frame at 1080p) from its own start (startTime, takeStart, windowStart, maskStart). ' +
+ 'Two layers, each through the mask scaled to it, grown (maskGrow) and feathered (feather): first the swap stretched back over the region of the footage its canvas covers (canvasWidth x canvasHeight at takeX, takeY), ' +
+ 'then the regenerate over the centre region its 16:9 / 9:16 draft kept (regionWidth x regionHeight at regionX, regionY; the mask is centre-cropped to it), so a character reaching past that region keeps the 768p swap there rather than the original person. ' +
+ 'The regions come from src/lib/catalog/sharpen.ts (compositeGeometry). CreateVideo takes the footage\'s own sound and rate (a silent clip stays silent). ' +
+ 'Tested end to end on the CPU ComfyUI (0.41.0): a 320x180 24 fps clip with sound, a 224x128 swap, a 384x216 regenerate and a 224x128 box mask, a 1.5 s window from 0.5 s: 36 frames and 1.5 s of AAC, the regenerate only inside the feathered box; the same with a silent clip gives video only.',
+ },
{
id: 'video-sdr-to-hdr-exr',
title: 'SDR to HDR as OpenEXR frames (scene-linear Rec.2020, half float) plus a 10-bit HLG preview (core, no model)',
diff --git a/scripts/comfy/validation-state.json b/scripts/comfy/validation-state.json
index 2875cdfa..676d9365 100644
--- a/scripts/comfy/validation-state.json
+++ b/scripts/comfy/validation-state.json
@@ -647,6 +647,12 @@
"error": "HTTP 400: missing_node_type: Node 'H3RelayAppendWindow' not found. The custom node may not be installed. (Node ID '#append')",
"at": "2026-10-27T11:01:36.134Z"
},
+ "video-composite-mask": {
+ "sha256": "60029601ea38976c1095bb50c56f0f11c7a86e14aec844f0c1ed400205dd2522",
+ "validated": true,
+ "error": null,
+ "at": "2026-11-01T20:08:39.633Z"
+ },
"video-concat-2": {
"sha256": "3d08966f5a3c2da662dc112df537ad4245bcd5dbb90e0451a0beb5c54d8db581",
"validated": true,
diff --git a/workflows/comfyui/manifest.json b/workflows/comfyui/manifest.json
index 2e60c335..247df415 100644
--- a/workflows/comfyui/manifest.json
+++ b/workflows/comfyui/manifest.json
@@ -20152,6 +20152,225 @@
"notes": "rdh9616's \"Open-H3 Regenerate 2K - Draft Video\" example (ComfyUI-Open-H3-Regenerate at 9b686c5) without the note, the three PreviewAny nodes and OpenH3VideoToPrompt: the prompt goes straight into CLIPTextEncode 16, so nothing calls a server from inside the graph. curve_name \"none\" (the tensors of the Sharp curve branches are zero in the blocks checked), so the curve table is never read (\"(model's own table)\": no 21 GB ref2va file needed). A Video Slice (29) in front cuts the 15 s window a longer clip is regenerated in (startTime, duration; 0 = the whole clip). Prepare Draft (11) resamples to 24 fps, cover-crops to draftSize (768p for H3 drafts, 576p for other models; a portrait clip gets the preset turned, and any other shape is cropped to 16:9, since the upscale always targets 16:9 or 9:16) and cuts frames (round(seconds x 24), at most 360 = 15 s per pass); Save Refined Latent (24) and Finish (26) read its frame count. The LBH upscaler puts the latent on the target grid (resolution: 1080p (1920x1080) | 2k (2560x1440) | 4k (3840x2160), 4K via 2K), the refine re-noises it to startSigma (0 = the release 0.909 grid; Close 0.7, Balanced 0.8) and runs steps (3, or 2 = Faster) Euler steps at CFG 1 with Sol-Attn sparse attention and the audio held as encoded silence; the refined latent is saved before decoding (output/open_h3_latents/, redo a failed decode with rdh's \"Decode Saved Latent\" graph) and decoded by the fast H3 VAE decoder (tiled H3 VAE fallback). Finish trims the padding, crops 1088 -> 1080 and 2176 -> 2160 and cuts the draft's own sound to length, which CreateVideo muxes back at 24 fps. Measured by the pack's author: about 3 min per 5 s at 2K on a 72 GB RTX PRO 5000 (9.5 min with dense attention); 22 s on a B200 (NVIDIA); a community run reached about 1080p on 32 GB with a lossy LoRA. The packs were tested by their author on ComfyUI 0.42.0.",
"validationError": "HTTP 400: missing_node_type: Node 'Open-H3 Regenerate LoRA (curve branches off)' not found. The custom node may not be installed. (Node ID '#3')"
},
+ {
+ "id": "video-composite-mask",
+ "title": "Put only the swapped character back over the original footage: the 768p swap, then the regenerated one, each through the approved mask (grown, feathered), with the footage's sound (core nodes, no model)",
+ "capability": "overlay",
+ "file": "video-composite-mask.json",
+ "source": "hand-built (scripts/comfy/hand-built/video-composite-mask.json)",
+ "bindings": {
+ "video": [
+ {
+ "node": "source",
+ "input": "file"
+ }
+ ],
+ "video2": [
+ {
+ "node": "regen",
+ "input": "file"
+ }
+ ],
+ "video3": [
+ {
+ "node": "take",
+ "input": "file"
+ }
+ ],
+ "mask": [
+ {
+ "node": "mask",
+ "input": "file"
+ }
+ ],
+ "startTime": [
+ {
+ "node": "source_slice",
+ "input": "start_time"
+ }
+ ],
+ "windowStart": [
+ {
+ "node": "regen_slice",
+ "input": "start_time"
+ }
+ ],
+ "takeStart": [
+ {
+ "node": "take_slice",
+ "input": "start_time"
+ }
+ ],
+ "maskStart": [
+ {
+ "node": "mask_slice",
+ "input": "start_time"
+ }
+ ],
+ "duration": [
+ {
+ "node": "source_slice",
+ "input": "duration"
+ },
+ {
+ "node": "regen_slice",
+ "input": "duration"
+ },
+ {
+ "node": "take_slice",
+ "input": "duration"
+ },
+ {
+ "node": "mask_slice",
+ "input": "duration"
+ }
+ ],
+ "canvasWidth": [
+ {
+ "node": "take_scaled",
+ "input": "width"
+ },
+ {
+ "node": "take_mask_img",
+ "input": "width"
+ }
+ ],
+ "canvasHeight": [
+ {
+ "node": "take_scaled",
+ "input": "height"
+ },
+ {
+ "node": "take_mask_img",
+ "input": "height"
+ }
+ ],
+ "takeX": [
+ {
+ "node": "base",
+ "input": "x"
+ }
+ ],
+ "takeY": [
+ {
+ "node": "base",
+ "input": "y"
+ }
+ ],
+ "regionWidth": [
+ {
+ "node": "regen_scaled",
+ "input": "width"
+ },
+ {
+ "node": "regen_mask_img",
+ "input": "width"
+ }
+ ],
+ "regionHeight": [
+ {
+ "node": "regen_scaled",
+ "input": "height"
+ },
+ {
+ "node": "regen_mask_img",
+ "input": "height"
+ }
+ ],
+ "regionX": [
+ {
+ "node": "composite",
+ "input": "x"
+ }
+ ],
+ "regionY": [
+ {
+ "node": "composite",
+ "input": "y"
+ }
+ ],
+ "maskGrow": [
+ {
+ "node": "take_grow",
+ "input": "expand"
+ },
+ {
+ "node": "regen_grow",
+ "input": "expand"
+ }
+ ],
+ "feather": [
+ {
+ "node": "take_feather",
+ "input": "left"
+ },
+ {
+ "node": "take_feather",
+ "input": "top"
+ },
+ {
+ "node": "take_feather",
+ "input": "right"
+ },
+ {
+ "node": "take_feather",
+ "input": "bottom"
+ },
+ {
+ "node": "regen_feather",
+ "input": "left"
+ },
+ {
+ "node": "regen_feather",
+ "input": "top"
+ },
+ {
+ "node": "regen_feather",
+ "input": "right"
+ },
+ {
+ "node": "regen_feather",
+ "input": "bottom"
+ }
+ ],
+ "filenamePrefix": [
+ {
+ "node": "save",
+ "input": "filename_prefix"
+ }
+ ]
+ },
+ "outputs": [
+ {
+ "node": "save",
+ "kind": "video"
+ }
+ ],
+ "defaults": {
+ "duration": 3,
+ "startTime": 0,
+ "maskGrow": 8,
+ "windowStart": 0,
+ "canvasWidth": 320,
+ "canvasHeight": 180,
+ "takeStart": 0,
+ "maskStart": 0,
+ "takeX": 0,
+ "takeY": 0,
+ "regionWidth": 316,
+ "regionHeight": 180,
+ "regionX": 2,
+ "regionY": 0,
+ "feather": 12
+ },
+ "limits": {},
+ "models": [],
+ "customNodes": [],
+ "vramGb": 0,
+ "license": "n/a (no model; ComfyUI core)",
+ "validated": true,
+ "notes": "Character Swap Studio's Sharpen and Genjutsu's Character swap at 1080p / 2K / 4K on your GPU: a swap was redrawn by video-regenerate-h3, and only the character goes back over the footage, so the background and the sound stay as filmed. video = the footage at 24 fps and the film's size (the studio's 24 fps copy, or Genjutsu's part fitted by video-fit-clip), video3 = the 768p swap (H3's canvas), video2 = its regenerate, mask = the approved whole-shot mask from video-mask-h3-relay (H3's canvas, white = the person). Each LoadVideo goes through a Video Slice of the same duration (one composite window of at most 3 s, because every stream is decoded as float32, about 25 MB a frame at 1080p) from its own start (startTime, takeStart, windowStart, maskStart). Two layers, each through the mask scaled to it, grown (maskGrow) and feathered (feather): first the swap stretched back over the region of the footage its canvas covers (canvasWidth x canvasHeight at takeX, takeY), then the regenerate over the centre region its 16:9 / 9:16 draft kept (regionWidth x regionHeight at regionX, regionY; the mask is centre-cropped to it), so a character reaching past that region keeps the 768p swap there rather than the original person. The regions come from src/lib/catalog/sharpen.ts (compositeGeometry). CreateVideo takes the footage's own sound and rate (a silent clip stays silent). Tested end to end on the CPU ComfyUI (0.41.0): a 320x180 24 fps clip with sound, a 224x128 swap, a 384x216 regenerate and a 224x128 box mask, a 1.5 s window from 0.5 s: 36 frames and 1.5 s of AAC, the regenerate only inside the feathered box; the same with a silent clip gives video only."
+ },
{
"id": "video-sdr-to-hdr-exr",
"title": "SDR to HDR as OpenEXR frames (scene-linear Rec.2020, half float) plus a 10-bit HLG preview (core, no model)",
diff --git a/workflows/comfyui/object_info.subset.json b/workflows/comfyui/object_info.subset.json
index 6e7b932d..a98a3508 100644
--- a/workflows/comfyui/object_info.subset.json
+++ b/workflows/comfyui/object_info.subset.json
@@ -6270,6 +6270,93 @@
"has_intermediate_output": false,
"search_aliases": []
},
+ "FeatherMask": {
+ "input": {
+ "required": {
+ "mask": [
+ "MASK",
+ {}
+ ],
+ "left": [
+ "INT",
+ {
+ "default": 0,
+ "min": 0,
+ "max": 16384,
+ "step": 1
+ }
+ ],
+ "top": [
+ "INT",
+ {
+ "default": 0,
+ "min": 0,
+ "max": 16384,
+ "step": 1
+ }
+ ],
+ "right": [
+ "INT",
+ {
+ "default": 0,
+ "min": 0,
+ "max": 16384,
+ "step": 1
+ }
+ ],
+ "bottom": [
+ "INT",
+ {
+ "default": 0,
+ "min": 0,
+ "max": 16384,
+ "step": 1
+ }
+ ]
+ }
+ },
+ "input_order": {
+ "required": [
+ "mask",
+ "left",
+ "top",
+ "right",
+ "bottom"
+ ]
+ },
+ "is_input_list": false,
+ "output": [
+ "MASK"
+ ],
+ "output_is_list": [
+ false
+ ],
+ "output_name": [
+ "MASK"
+ ],
+ "output_tooltips": [
+ null
+ ],
+ "output_matchtypes": null,
+ "name": "FeatherMask",
+ "display_name": "Feather Mask",
+ "description": "",
+ "python_module": "comfy_extras.nodes_mask",
+ "category": "image/mask",
+ "output_node": false,
+ "deprecated": false,
+ "experimental": false,
+ "dev_only": false,
+ "api_node": false,
+ "price_badge": null,
+ "search_aliases": [
+ "soft edge mask",
+ "blur mask edges",
+ "gradient mask edge"
+ ],
+ "essentials_category": null,
+ "has_intermediate_output": false
+ },
"Flux2Scheduler": {
"input": {
"required": {
@@ -20773,7 +20860,7 @@
"default": 0.7,
"min": 0.01,
"max": 2,
- "step": 0.000001
+ "step": 1e-06
}
],
"top_k": [
@@ -24910,7 +24997,7 @@
"default": 0.5,
"min": 0,
"max": 1,
- "step": 1e-9
+ "step": 1e-09
}
],
"fy": [
@@ -24920,7 +25007,7 @@
"default": 0.5,
"min": 0,
"max": 1,
- "step": 1e-9
+ "step": 1e-09
}
],
"cx": [
diff --git a/workflows/comfyui/requirements.json b/workflows/comfyui/requirements.json
index 9731951d..a81d2c41 100644
--- a/workflows/comfyui/requirements.json
+++ b/workflows/comfyui/requirements.json
@@ -1,6 +1,6 @@
{
"v": 1,
- "hash": "1deb3ec72877403a2486f4d6bafb46be1965d1174c173237974df225e37212a2",
+ "hash": "9443b6e5a9d2bc0a6ab67e07a5ba4367975096076e726fc84dfc6f93a9500eb6",
"comfyui": {"min":"0.42.0","testedCommit":"5841c187"},
"folders": ["audio_encoders","background_removal","checkpoints","clip_vision","dbs","diffusion_models","facerestore_models","foley","frame_interpolation","geometry_estimation","insightface","latent_upscale_models","loras","mmaudio","model_patches","optical_flow","reuse","text_encoders","thinksound","upscale_models","vae"],
"sentinels": ["AILab_Qwen3ASRSubtitle","AUSBOSS_NODES_CropForInpaint","AUSBOSS_NODES_ImageCropRotatePad","AUSBOSS_NODES_StitchInpaint","Add Subtitles To Frames","Apply Whisper","CFGOverride","ClothesSegment","ComfyMathExpression","CropFuobeLive","DBSLoader","DBSSeparate","DownloadAndLoadWav2VecModel","DualModelGuider","FL_ChatterboxDialogTTS","FL_ChatterboxMultilingualTTS","FL_ChatterboxVC","GetImageRangeFromBatch","GetImageSizeAndCount","GrowMaskWithBlur","H3AdaLNLoRAFix","H3CharacterSwapAssemble","H3CharacterSwapController","H3CharacterSwapExpandMask","H3CharacterSwapModels","H3CharacterSwapPrepareVideo","H3CharacterSwapRecoverMasks","H3CharacterSwapSelectSubject","H3CharacterSwapSettings","H3CharacterSwapShot","H3CharacterSwapWindowPlan","H3RelayAppendWindow","H3RelayApplyEditMask","H3RelayApplyHistory","H3RelayExpandMask","H3RelayFinishWindows","H3RelayPrepareSource","H3RelayRecoverMasks","H3RelayReviewWindows","H3RelaySamplingMemory","H3RelaySelectMask","H3RelayTextMemory","H3RelayWindowInputs","H3RelayWindowPlan","H3SLAAttention","HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader","INTConstant","Ideogram4Scheduler","ImageBatchExtendWithOverlap","ImageGridtoBatch","ImageResizeKJv2","IndexTTS2Simple","Krea2EditGroundedEncode","Krea2EditModelPatch","Krea2OstrisEditModelPatch","LTXAVTextEncoderLoader","LTXAddVideoICLoRAGuide","LTXICLoRALoaderModelOnly","LTXVAddGuide","LTXVAudioVAEDecode","LTXVAudioVAELoader","LTXVConcatAVLatent","LTXVConditioning","LTXVCropGuides","LTXVDualCFGGuider","LTXVEmptyLatentAudio","LTXVImgToVideoInplace","LTXVLatentUpsampler","LTXVPreprocess","LTXVScheduler","LTXVSeparateAVLatent","LTXVTiledFusionSampler","LatentSyncNode","LoadBackgroundRemovalModel","LoadImageFuobeLive","LoadVideoDepthAnythingModel","MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler","MelBandRoFormerModelLoader","MelBandRoFormerSampler","MiniMaxH3TurboLoRA","MiniMaxH3TurboSampler","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","OpenH3RegenFastVAEDecode","OpenH3RegenFinish","OpenH3RegenLora","OpenH3RegenPrepareDraft","OpenH3RegenRefineLatent","OpenH3RegenSigmas","OpenH3RegenUpscale","OpenH3SaveRefinedLatent","PasteBackFuobeLive","Qwen21EncodeFuobeLive","Qwen21ReferenceFuobeLive","QwenImage21Cache","REUSEEnhance","REUSELoader","RIFE VFI","RMBG","ReActorFaceSwap","RemoveBackground","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SaveImageFuobeLive","SeedVR2Conditioning","SeedVR2PostProcessing","SeedVR2Preprocess","TS_ImageToSVGStringColor_Vtracer","TS_SVGStringToSVGBytesIO","TextEncodeFibo2","TextEncodeKrea2OstrisEdit","TextEncodeQwenImage21","ThinkSoundFeatureUtilsLoader","ThinkSoundModelLoader","ThinkSoundSampler","Trellis2Conditioning","Trellis2ShapeStage","Trellis2TextureStage","Trellis2UpsampleStage","VHS_BatchManager","VHS_LoadAudioUpload","VHS_LoadVideo","VHS_SelectEveryNthImage","VHS_VideoCombine","VHS_VideoInfo","VHS_VideoInfoLoaded","VideoDepthAnythingOutput","VideoDepthAnythingProcess","VideoLengthAdjuster","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoDecode","WanVideoEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoPassImagesFromSamples","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader"],
@@ -370,6 +370,7 @@
"video-character-swap-h3": {"core":["CLIPLoader","CLIPTextEncode","CheckpointLoaderSimple","CreateVideo","ImageFromBatch","ImageScale","LoadImage","LoadVideo","LoraLoaderModelOnly","MiniMaxH3SigmaShift","ModelAttentionBackend","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SaveVideo","SelectCLIPDevice","UNETLoader","VAELoader","Video Slice"],"packs":{"h3_character_swap":["H3CharacterSwapAssemble","H3CharacterSwapController","H3CharacterSwapExpandMask","H3CharacterSwapModels","H3CharacterSwapPrepareVideo","H3CharacterSwapRecoverMasks","H3CharacterSwapSelectSubject","H3CharacterSwapSettings","H3CharacterSwapShot","H3CharacterSwapWindowPlan"]},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors","diffusion_models/minimax_h3_ref2va_pruned_int8_convrot.safetensors","loras/h3_character_swap_v1.5.safetensors","loras/minimax_h3_fl2v_turbo_8step_v1.0_768p_comfyui_bf16.safetensors","text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors","vae/minimax_h3_audio_vae_fp32.safetensors","vae/minimax_h3_video_vae_fp16.safetensors"],"optional":["loras/h3_character_swap_pro4500_1000.safetensors"],"vramGb":24,"isolated":false,"firstRun":[]},
"video-character-swap-h3-relay": {"core":["BasicScheduler","CFGGuider","CLIPLoader","CLIPTextEncode","CheckpointLoaderSimple","CreateVideo","EndLoop","GetImageSize","ImageFromBatch","KSamplerSelect","LTXVSeparateAVLatent","LoadImage","LoadVideo","LoraLoaderModelOnly","MiniMaxH3AddGuide","MiniMaxH3ReferenceToVideo","MiniMaxH3SigmaShift","ModelAttentionBackend","RandomNoise","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SamplerCustomAdvanced","SaveVideo","SelectCLIPDevice","StartLoop","UNETLoader","VAEDecode","VAEEncode","VAELoader","Video Slice"],"packs":{"h3-relay":["H3RelayAppendWindow","H3RelayApplyEditMask","H3RelayApplyHistory","H3RelayExpandMask","H3RelayFinishWindows","H3RelayPrepareSource","H3RelayRecoverMasks","H3RelaySamplingMemory","H3RelaySelectMask","H3RelayTextMemory","H3RelayWindowInputs","H3RelayWindowPlan"]},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors","diffusion_models/minimax_h3_ref2va_pruned_int8_convrot.safetensors","loras/h3_character_swap_v1.5.safetensors","loras/minimax_h3_fl2v_turbo_8step_v1.0_768p_comfyui_bf16.safetensors","text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors","vae/minimax_h3_audio_vae_fp32.safetensors","vae/minimax_h3_video_vae_fp16.safetensors"],"optional":["loras/h3_character_swap_pro4500_1000.safetensors"],"vramGb":24,"isolated":false,"firstRun":[]},
"video-character-swap-h3-segment": {"core":["BasicScheduler","CFGGuider","CLIPLoader","CLIPTextEncode","CheckpointLoaderSimple","CreateVideo","EndLoop","GetImageSize","GetVideoComponents","ImageFromBatch","ImageScale","KSamplerSelect","LTXVSeparateAVLatent","LoadImage","LoadVideo","LoraLoaderModelOnly","MiniMaxH3AddGuide","MiniMaxH3ReferenceToVideo","MiniMaxH3SigmaShift","ModelAttentionBackend","RandomNoise","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SamplerCustomAdvanced","SaveVideo","SelectCLIPDevice","StartLoop","UNETLoader","VAEDecode","VAEEncode","VAELoader","Video Slice"],"packs":{"ComfyUI-VideoHelperSuite":["VHS_VideoCombine"],"h3-relay":["H3RelayAppendWindow","H3RelayApplyEditMask","H3RelayApplyHistory","H3RelayExpandMask","H3RelayFinishWindows","H3RelayPrepareSource","H3RelayRecoverMasks","H3RelaySamplingMemory","H3RelaySelectMask","H3RelayTextMemory","H3RelayWindowInputs","H3RelayWindowPlan"]},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors","diffusion_models/minimax_h3_ref2va_pruned_int8_convrot.safetensors","loras/h3_character_swap_v1.5.safetensors","loras/minimax_h3_fl2v_turbo_8step_v1.0_768p_comfyui_bf16.safetensors","text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors","vae/minimax_h3_audio_vae_fp32.safetensors","vae/minimax_h3_video_vae_fp16.safetensors"],"optional":["loras/h3_character_swap_pro4500_1000.safetensors"],"vramGb":24,"isolated":false,"firstRun":[]},
+ "video-composite-mask": {"core":["CreateVideo","FeatherMask","GetVideoComponents","GrowMask","ImageCompositeMasked","ImageScale","ImageToMask","LoadVideo","SaveVideo","Video Slice"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},
"video-concat-2": {"core":["BatchImagesNode","CreateVideo","GetVideoComponents","ImageScale","LoadVideo","SaveVideo"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},
"video-concat-3": {"core":["BatchImagesNode","CreateVideo","GetVideoComponents","ImageScale","LoadVideo","SaveVideo"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},
"video-concat-4": {"core":["BatchImagesNode","CreateVideo","GetVideoComponents","ImageScale","LoadVideo","SaveVideo"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},
diff --git a/workflows/comfyui/video-composite-mask.json b/workflows/comfyui/video-composite-mask.json
new file mode 100644
index 00000000..a67f582b
--- /dev/null
+++ b/workflows/comfyui/video-composite-mask.json
@@ -0,0 +1,381 @@
+{
+ "base": {
+ "class_type": "ImageCompositeMasked",
+ "inputs": {
+ "destination": [
+ "source_parts",
+ 0
+ ],
+ "source": [
+ "take_scaled",
+ 0
+ ],
+ "x": 0,
+ "y": 0,
+ "resize_source": false,
+ "mask": [
+ "take_feather",
+ 0
+ ]
+ },
+ "_meta": {
+ "title": "Your character from the 768p swap over the footage (fills in where the regenerate's frame doesn't reach)"
+ }
+ },
+ "composite": {
+ "class_type": "ImageCompositeMasked",
+ "inputs": {
+ "destination": [
+ "base",
+ 0
+ ],
+ "source": [
+ "regen_scaled",
+ 0
+ ],
+ "x": 0,
+ "y": 0,
+ "resize_source": false,
+ "mask": [
+ "regen_feather",
+ 0
+ ]
+ },
+ "_meta": {
+ "title": "Only your character from the regenerate, over the footage"
+ }
+ },
+ "create": {
+ "class_type": "CreateVideo",
+ "inputs": {
+ "images": [
+ "composite",
+ 0
+ ],
+ "audio": [
+ "source_parts",
+ 1
+ ],
+ "fps": [
+ "source_parts",
+ 2
+ ],
+ "bit_depth": "auto",
+ "color_space": "sRGB",
+ "codec": "none"
+ },
+ "_meta": {
+ "title": "The footage's own sound and rate"
+ }
+ },
+ "mask": {
+ "class_type": "LoadVideo",
+ "inputs": {
+ "file": "mask.mp4"
+ },
+ "_meta": {
+ "title": "Who was swapped: the approved mask (white = the person, H3's canvas)"
+ }
+ },
+ "mask_parts": {
+ "class_type": "GetVideoComponents",
+ "inputs": {
+ "video": [
+ "mask_slice",
+ 0
+ ]
+ },
+ "_meta": {
+ "title": "Mask frames"
+ }
+ },
+ "mask_slice": {
+ "class_type": "Video Slice",
+ "inputs": {
+ "video": [
+ "mask",
+ 0
+ ],
+ "start_time": 0,
+ "duration": 0,
+ "strict_duration": false
+ },
+ "_meta": {
+ "title": "This window of the mask"
+ }
+ },
+ "regen": {
+ "class_type": "LoadVideo",
+ "inputs": {
+ "file": "regen.mp4"
+ },
+ "_meta": {
+ "title": "The regenerated swap (1080p / 2K / 4K, 16:9 or 9:16)"
+ }
+ },
+ "regen_feather": {
+ "class_type": "FeatherMask",
+ "inputs": {
+ "mask": [
+ "regen_grow",
+ 0
+ ],
+ "left": 12,
+ "top": 12,
+ "right": 12,
+ "bottom": 12
+ },
+ "_meta": {
+ "title": "Soft edge"
+ }
+ },
+ "regen_grow": {
+ "class_type": "GrowMask",
+ "inputs": {
+ "mask": [
+ "regen_mask",
+ 0
+ ],
+ "expand": 8,
+ "tapered_corners": true
+ },
+ "_meta": {
+ "title": "Grow the mask"
+ }
+ },
+ "regen_mask": {
+ "class_type": "ImageToMask",
+ "inputs": {
+ "image": [
+ "regen_mask_img",
+ 0
+ ],
+ "channel": "red"
+ },
+ "_meta": {
+ "title": "Mask (red channel)"
+ }
+ },
+ "regen_mask_img": {
+ "class_type": "ImageScale",
+ "inputs": {
+ "image": [
+ "mask_parts",
+ 0
+ ],
+ "upscale_method": "bilinear",
+ "width": 320,
+ "height": 180,
+ "crop": "center"
+ },
+ "_meta": {
+ "title": "Mask to the regenerate's place (the centre the regenerate kept)"
+ }
+ },
+ "regen_parts": {
+ "class_type": "GetVideoComponents",
+ "inputs": {
+ "video": [
+ "regen_slice",
+ 0
+ ]
+ },
+ "_meta": {
+ "title": "Regenerated frames"
+ }
+ },
+ "regen_scaled": {
+ "class_type": "ImageScale",
+ "inputs": {
+ "image": [
+ "regen_parts",
+ 0
+ ],
+ "upscale_method": "lanczos",
+ "width": 320,
+ "height": 180,
+ "crop": "disabled"
+ },
+ "_meta": {
+ "title": "Regenerate to its place in the footage"
+ }
+ },
+ "regen_slice": {
+ "class_type": "Video Slice",
+ "inputs": {
+ "video": [
+ "regen",
+ 0
+ ],
+ "start_time": 0,
+ "duration": 0,
+ "strict_duration": false
+ },
+ "_meta": {
+ "title": "This window of the regenerate"
+ }
+ },
+ "save": {
+ "class_type": "SaveVideo",
+ "inputs": {
+ "video": [
+ "create",
+ 0
+ ],
+ "filename_prefix": "fuobe/video-composite-mask",
+ "format": "auto",
+ "format.codec": "auto",
+ "codec": "auto"
+ },
+ "_meta": {
+ "title": "Save video"
+ }
+ },
+ "source": {
+ "class_type": "LoadVideo",
+ "inputs": {
+ "file": "source.mp4"
+ },
+ "_meta": {
+ "title": "The original footage (24 fps, the film's size)"
+ }
+ },
+ "source_parts": {
+ "class_type": "GetVideoComponents",
+ "inputs": {
+ "video": [
+ "source_slice",
+ 0
+ ]
+ },
+ "_meta": {
+ "title": "Footage frames, sound and rate"
+ }
+ },
+ "source_slice": {
+ "class_type": "Video Slice",
+ "inputs": {
+ "video": [
+ "source",
+ 0
+ ],
+ "start_time": 0,
+ "duration": 0,
+ "strict_duration": false
+ },
+ "_meta": {
+ "title": "This window of the footage"
+ }
+ },
+ "take": {
+ "class_type": "LoadVideo",
+ "inputs": {
+ "file": "take.mp4"
+ },
+ "_meta": {
+ "title": "The 768p swap (H3's canvas)"
+ }
+ },
+ "take_feather": {
+ "class_type": "FeatherMask",
+ "inputs": {
+ "mask": [
+ "take_grow",
+ 0
+ ],
+ "left": 12,
+ "top": 12,
+ "right": 12,
+ "bottom": 12
+ },
+ "_meta": {
+ "title": "Soft edge"
+ }
+ },
+ "take_grow": {
+ "class_type": "GrowMask",
+ "inputs": {
+ "mask": [
+ "take_mask",
+ 0
+ ],
+ "expand": 8,
+ "tapered_corners": true
+ },
+ "_meta": {
+ "title": "Grow the mask"
+ }
+ },
+ "take_mask": {
+ "class_type": "ImageToMask",
+ "inputs": {
+ "image": [
+ "take_mask_img",
+ 0
+ ],
+ "channel": "red"
+ },
+ "_meta": {
+ "title": "Mask (red channel)"
+ }
+ },
+ "take_mask_img": {
+ "class_type": "ImageScale",
+ "inputs": {
+ "image": [
+ "mask_parts",
+ 0
+ ],
+ "upscale_method": "bilinear",
+ "width": 320,
+ "height": 180,
+ "crop": "disabled"
+ },
+ "_meta": {
+ "title": "Mask to the swap's place"
+ }
+ },
+ "take_parts": {
+ "class_type": "GetVideoComponents",
+ "inputs": {
+ "video": [
+ "take_slice",
+ 0
+ ]
+ },
+ "_meta": {
+ "title": "Swap frames"
+ }
+ },
+ "take_scaled": {
+ "class_type": "ImageScale",
+ "inputs": {
+ "image": [
+ "take_parts",
+ 0
+ ],
+ "upscale_method": "lanczos",
+ "width": 320,
+ "height": 180,
+ "crop": "disabled"
+ },
+ "_meta": {
+ "title": "Swap to its place in the footage"
+ }
+ },
+ "take_slice": {
+ "class_type": "Video Slice",
+ "inputs": {
+ "video": [
+ "take",
+ 0
+ ],
+ "start_time": 0,
+ "duration": 0,
+ "strict_duration": false
+ },
+ "_meta": {
+ "title": "This window of the swap"
+ }
+ }
+}