Skip to content

One-click character swap for videos: an open-source, local Higgsfield Genjutsu alternative built on ComfyUI and MiniMax H3, with FLUX.3 Klein relighting.

10.0 KB
Raw Blame
{
  "1": {
    "inputs": {
      "video": "",
      "force_rate": 24,
      "custom_width": 0,
      "custom_height": 0,
      "frame_load_cap": 0,
      "skip_first_frames": 0,
      "select_every_nth": 1,
      "format": "None"
    },
    "class_type": "VHS_LoadVideo",
    "_meta": {
      "title": "Video to fix"
    }
  },
  "2": {
    "inputs": {
      "image": ""
    },
    "class_type": "LoadImage",
    "_meta": {
      "title": "Picture 1"
    }
  },
  "3": {
    "inputs": {
      "upscale_method": "area",
      "largest_size": 768,
      "image": [
        "2",
        0
      ]
    },
    "class_type": "ImageScaleToMaxDimension",
    "_meta": {
      "title": "Shrink for the describer"
    }
  },
  "4": {
    "inputs": {
      "clip_name": "qwen3vl_8b_int8_convrot.safetensors",
      "type": "stable_diffusion",
      "device": "default"
    },
    "class_type": "CLIPLoader",
    "_meta": {
      "title": "Describer: Qwen3-VL 8B"
    }
  },
  "5": {
    "inputs": {
      "prompt": "Describe this person's face for a casting sheet, in one sentence of about 30 words: apparent age and gender, face shape, skin tone, eyebrows, facial hair and any glasses. No preamble, no clothing, no background.",
      "max_length": 90,
      "sampling_mode": "off",
      "thinking": false,
      "use_default_template": true,
      "mtp": "auto",
      "clip": [
        "4",
        0
      ],
      "image": [
        "3",
        0
      ]
    },
    "class_type": "TextGenerate",
    "_meta": {
      "title": "Describe the face in picture 1"
    }
  },
  "6": {
    "inputs": {
      "images": [
        "1",
        0
      ],
      "identity_reference": [
        "2",
        0
      ],
      "fallback_detector": "segm\\person_yolov8m-seg.pt",
      "detector": "bbox\\face_yolov8m.pt",
      "confidence": 0.35,
      "crop_factor": 2.5,
      "canvas_width": 512,
      "canvas_height": 512,
      "canvas_mode": "manual",
      "smooth_window": 21,
      "size_smooth_window": 51,
      "smooth_method": "gaussian",
      "size_mode": "per_frame",
      "identity_track": true,
      "identity_threshold": 0.28,
      "select": "largest",
      "fallback_head_frac": 0.5
    },
    "class_type": "H3FaceTrackCrop",
    "_meta": {
      "title": "Track + crop the face"
    }
  },
  "7": {
    "inputs": {
      "images": [
        "2",
        0
      ],
      "fallback_detector": "none",
      "detector": "bbox\\face_yolov8m.pt",
      "confidence": 0.35,
      "crop_factor": 2.5,
      "canvas_width": 512,
      "canvas_height": 512,
      "canvas_mode": "manual",
      "smooth_window": 21,
      "size_smooth_window": 51,
      "smooth_method": "gaussian",
      "size_mode": "per_frame",
      "identity_track": true,
      "identity_threshold": 0.28,
      "select": "largest",
      "fallback_head_frac": 0.5
    },
    "class_type": "H3FaceTrackCrop",
    "_meta": {
      "title": "Face from picture 1"
    }
  },
  "8": {
    "inputs": {
      "model_name": "sam_vit_b_01ec64.pth",
      "device_mode": "AUTO"
    },
    "class_type": "SAMLoader",
    "_meta": {
      "title": "SAM (face masks)"
    }
  },
  "9": {
    "inputs": {
      "crops": [
        "6",
        0
      ],
      "sam_model": [
        "8",
        0
      ],
      "transform": [
        "6",
        1
      ],
      "threshold": 0.93,
      "dilation": 24,
      "temporal_smooth": 5
    },
    "class_type": "H3FaceMaskSAM",
    "_meta": {
      "title": "Face mask (regenerated)"
    }
  },
  "10": {
    "inputs": {
      "crops": [
        "6",
        0
      ],
      "sam_model": [
        "8",
        0
      ],
      "transform": [
        "6",
        1
      ],
      "threshold": 0.93,
      "dilation": 8,
      "temporal_smooth": 5
    },
    "class_type": "H3FaceMaskSAM",
    "_meta": {
      "title": "Face mask (pasted back)"
    }
  },
  "11": {
    "inputs": {
      "image": [
        "6",
        0
      ],
      "blur_radius": 9,
      "sigma": 3.0
    },
    "class_type": "ImageBlur",
    "_meta": {
      "title": "Blurred face (follow the mouth)"
    }
  },
  "12": {
    "inputs": {
      "crops": [
        "6",
        0
      ],
      "masks": [
        "9",
        0
      ],
      "audio": [
        "1",
        2
      ],
      "transform": [
        "6",
        1
      ],
      "chunk_seconds": 6.5,
      "skip_faces_above": 0.2,
      "follow_mouth": [
        "11",
        0
      ],
      "picture_text": [
        "5",
        0
      ]
    },
    "class_type": "H3FaceChunks",
    "_meta": {
      "title": "Face Fix Chunks"
    }
  },
  "13": {
    "inputs": {
      "unet_name": "minimax_h3_ref2va_pruned_int8_convrot.safetensors",
      "weight_dtype": "default"
    },
    "class_type": "UNETLoader",
    "_meta": {
      "title": "H3 Diffusion Model"
    }
  },
  "14": {
    "inputs": {
      "lora_name": "minimax_h3_DMAD_4step_full_lora_avg_rank_39_bf16.safetensors",
      "strength_model": 1,
      "model": [
        "13",
        0
      ]
    },
    "class_type": "LoraLoaderModelOnly",
    "_meta": {
      "title": "DMAD LoRA"
    }
  },
  "15": {
    "inputs": {
      "attention": "comfy kitchen attention",
      "model": [
        "14",
        0
      ]
    },
    "class_type": "ModelAttentionBackend",
    "_meta": {
      "title": "Comfy Kitchen Attention"
    }
  },
  "16": {
    "inputs": {
      "clip_name": "qwen3vl_32b_minimax_h3_int4_convrot.safetensors",
      "type": "minimax",
      "device": "default"
    },
    "class_type": "CLIPLoader",
    "_meta": {
      "title": "H3 Text Encoder"
    }
  },
  "17": {
    "inputs": {
      "vae_name": "minimax_h3_video_vae_int8_convrot.safetensors"
    },
    "class_type": "VAELoader",
    "_meta": {
      "title": "Video VAE"
    }
  },
  "18": {
    "inputs": {
      "vae_name": "minimax_h3_audio_vae_fp32.safetensors"
    },
    "class_type": "VAELoader",
    "_meta": {
      "title": "Audio VAE"
    }
  },
  "19": {
    "inputs": {
      "grow": 0,
      "keep_audio": true,
      "megapixels": 0,
      "vae": [
        "17",
        0
      ],
      "images": [
        "12",
        0
      ],
      "mask": [
        "12",
        1
      ],
      "audio_vae": [
        "18",
        0
      ],
      "audio": [
        "12",
        3
      ]
    },
    "class_type": "MiniMaxH3FantasticVideoEditLatent",
    "_meta": {
      "title": "Edit latent (face + audio)"
    }
  },
  "20": {
    "inputs": {
      "mask_meaning": "white = generate",
      "audio_mode": "preserve source audio",
      "mask_conversion": "H3 exact (causal/token max)",
      "target_latent": [
        "19",
        0
      ],
      "mask": [
        "12",
        1
      ]
    },
    "class_type": "MiniMaxH3ContexMaskedTarget",
    "_meta": {
      "title": "Masked target"
    }
  },
  "21": {
    "inputs": {
      "prompt": [
        "12",
        4
      ],
      "width": [
        "19",
        1
      ],
      "height": [
        "19",
        2
      ],
      "length": [
        "19",
        3
      ],
      "ref_image_size": "match",
      "clip": [
        "16",
        0
      ],
      "vae": [
        "17",
        0
      ],
      "audio_vae": [
        "18",
        0
      ],
      "ref_images.ref_image_0": [
        "7",
        0
      ],
      "ref_videos.ref_video_0": [
        "12",
        2
      ]
    },
    "class_type": "MiniMaxH3ReferenceToVideo",
    "_meta": {
      "title": "Reference Conditioning"
    }
  },
  "22": {
    "inputs": {
      "model": [
        "15",
        0
      ],
      "conditioning": [
        "21",
        0
      ]
    },
    "class_type": "BasicGuider",
    "_meta": {
      "title": "Guider"
    }
  },
  "23": {
    "inputs": {
      "sampler_name": "euler"
    },
    "class_type": "KSamplerSelect",
    "_meta": {
      "title": "Sampler"
    }
  },
  "24": {
    "inputs": {
      "noise_seed": 0
    },
    "class_type": "RandomNoise",
    "_meta": {
      "title": "Seed"
    }
  },
  "25": {
    "inputs": {
      "scheduler": "simple",
      "steps": 6,
      "denoise": 1,
      "model": [
        "15",
        0
      ]
    },
    "class_type": "BasicScheduler",
    "_meta": {
      "title": "Schedule"
    }
  },
  "26": {
    "inputs": {
      "noise": [
        "24",
        0
      ],
      "guider": [
        "22",
        0
      ],
      "sampler": [
        "23",
        0
      ],
      "sigmas": [
        "25",
        0
      ],
      "latent_image": [
        "20",
        0
      ]
    },
    "class_type": "SamplerCustomAdvanced",
    "_meta": {
      "title": "Sample face"
    }
  },
  "27": {
    "inputs": {
      "samples": [
        "26",
        0
      ],
      "vae": [
        "17",
        0
      ]
    },
    "class_type": "VAEDecode",
    "_meta": {
      "title": "Decode face"
    }
  },
  "28": {
    "inputs": {
      "images": [
        "27",
        0
      ],
      "plan": [
        "12",
        5
      ],
      "crops": [
        "6",
        0
      ],
      "transform": [
        "6",
        1
      ]
    },
    "class_type": "H3FaceJoin",
    "_meta": {
      "title": "Face Fix Join"
    }
  },
  "29": {
    "inputs": {
      "paste_region": "face_only",
      "mask_dilation": 0,
      "feather": 8,
      "colour_match": 1.0,
      "blend": 1.0,
      "undetected_frames": "fade_out",
      "feather_scales_with_crop": false,
      "base_images": [
        "1",
        0
      ],
      "refined_crops": [
        "28",
        0
      ],
      "transform": [
        "28",
        1
      ],
      "masks": [
        "10",
        0
      ]
    },
    "class_type": "H3FaceStitch",
    "_meta": {
      "title": "Paste the face back"
    }
  },
  "30": {
    "inputs": {
      "frame_rate": 24,
      "loop_count": 0,
      "filename_prefix": "openjutsu_face/face",
      "format": "video/h264-mp4",
      "pix_fmt": "yuv420p",
      "crf": 16,
      "save_metadata": false,
      "trim_to_audio": false,
      "pingpong": false,
      "save_output": true,
      "images": [
        "29",
        0
      ],
      "audio": [
        "1",
        2
      ]
    },
    "class_type": "VHS_VideoCombine",
    "_meta": {
      "title": "Fixed video"
    }
  }
}