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.

20.3 KB
Raw Blame
{
  "2": {
    "inputs": {
      "image": ""
    },
    "class_type": "LoadImage",
    "_meta": {
      "title": "Picture 1",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "3": {
    "inputs": {
      "upscale_method": "area",
      "largest_size": 768,
      "image": [
        "2",
        0
      ]
    },
    "class_type": "ImageScaleToMaxDimension",
    "_meta": {
      "title": "Shrink for the describer",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "4": {
    "inputs": {
      "prompt": "Describe the main subject of this picture in one sentence of about 40 words: what it is (an outfit, a hairstyle, an object or a place), its shape, colours, materials, patterns and details. No preamble, and nothing about anything else in the picture.",
      "max_length": 120,
      "sampling_mode": "off",
      "thinking": false,
      "use_default_template": true,
      "mtp": "auto",
      "clip": [
        "8",
        0
      ],
      "image": [
        "3",
        0
      ]
    },
    "class_type": "TextGenerate",
    "_meta": {
      "title": "Describe picture 1",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "5": {
    "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": "Source video",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "6": {
    "inputs": {
      "start_index": 0,
      "duration": 2048,
      "audio": [
        "5",
        2
      ]
    },
    "class_type": "TrimAudioDuration",
    "_meta": {
      "title": "Soundtrack (whole video)",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "7": {
    "inputs": {
      "mode": "change",
      "target": "hair",
      "change_to": "short bright pink hair",
      "clip_seconds": 6,
      "overlap_frames": 39,
      "resolution": "736p",
      "steps": 6,
      "seed": 0,
      "source_frames": [
        "5",
        0
      ],
      "picture_1": [
        "2",
        0
      ],
      "picture_1_text": [
        "4",
        0
      ]
    },
    "class_type": "H3ObjectSwapPlan",
    "_meta": {
      "title": "Object Swap Plan (what to change)",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "8": {
    "inputs": {
      "clip_name": "qwen3vl_8b_int8_convrot.safetensors",
      "type": "stable_diffusion",
      "device": "default"
    },
    "class_type": "CLIPLoader",
    "_meta": {
      "title": "Describer: Qwen3-VL 8B",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "9": {
    "inputs": {
      "unet_name": "minimax_h3_ref2va_pruned_int8_convrot.safetensors",
      "weight_dtype": "default"
    },
    "class_type": "UNETLoader",
    "_meta": {
      "title": "H3 Diffusion Model",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "10": {
    "inputs": {
      "lora_name": "minimax_h3_DMAD_4step_full_lora_avg_rank_39_bf16.safetensors",
      "strength_model": 1,
      "model": [
        "9",
        0
      ]
    },
    "class_type": "LoraLoaderModelOnly",
    "_meta": {
      "title": "DMAD LoRA",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "11": {
    "inputs": {
      "attention": "comfy kitchen attention",
      "model": [
        "10",
        0
      ]
    },
    "class_type": "ModelAttentionBackend",
    "_meta": {
      "title": "Comfy Kitchen Attention",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "12": {
    "inputs": {
      "shift_video": 12,
      "shift_audio": 2,
      "model": [
        "11",
        0
      ]
    },
    "class_type": "MiniMaxH3SigmaShift",
    "_meta": {
      "title": "Sigma Shift",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "13": {
    "inputs": {
      "clip_name": "qwen3vl_32b_minimax_h3_int4_convrot.safetensors",
      "type": "minimax",
      "device": "default"
    },
    "class_type": "CLIPLoader",
    "_meta": {
      "title": "H3 Text Encoder",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "14": {
    "inputs": {
      "vae_name": "minimax_h3_video_vae_int8_convrot.safetensors"
    },
    "class_type": "VAELoader",
    "_meta": {
      "title": "Video VAE",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "15": {
    "inputs": {
      "vae_name": "minimax_h3_audio_vae_fp32.safetensors"
    },
    "class_type": "VAELoader",
    "_meta": {
      "title": "Audio VAE",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "16": {
    "inputs": {
      "sampler_name": "euler"
    },
    "class_type": "KSamplerSelect",
    "_meta": {
      "title": "Sampler",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "17": {
    "inputs": {
      "ckpt_name": "sam3.1_multiplex_fp16.safetensors"
    },
    "class_type": "CheckpointLoaderSimple",
    "_meta": {
      "title": "SAM 3.1",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "18": {
    "inputs": {
      "text": "hair",
      "clip": [
        "17",
        1
      ]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "SAM: what to change",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "19": {
    "inputs": {
      "scene_continuity": "Hard picture + protected audio",
      "audio_profile": "Generate audio"
    },
    "class_type": "MiniMaxH3GenerationProfile",
    "_meta": {
      "title": "Generation Profile",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "20": {
    "inputs": {
      "plan_json": "{\n  \"shots\": [\n    {\n      \"id\": \"intro\",\n      \"prompt\": \"Describe the opening shot.\"\n    },\n    {\n      \"id\": \"continuation\",\n      \"prompt\": \"Continue the same take.\"\n    }\n  ]\n}",
      "run_name": [
        "7",
        3
      ],
      "generation_fingerprint": "",
      "width": [
        "7",
        1
      ],
      "height": [
        "7",
        2
      ],
      "encode_mode": "video",
      "crop": "center",
      "default_duration_seconds": 15,
      "default_steps": 6,
      "base_seed": 0,
      "segment_crf": 16,
      "video_blend_frames": 0,
      "chain_policy": [
        "19",
        0
      ],
      "plan_json_input": [
        "7",
        0
      ]
    },
    "class_type": "MiniMaxH3ChainPlanModern",
    "_meta": {
      "title": "Production Plan (filled by Object Swap Plan)",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "21": {
    "inputs": {
      "video_path": "",
      "audio_path": "",
      "embedded_audio": "auto",
      "skip_first_frames": 0,
      "source_audio": [
        "6",
        0
      ]
    },
    "class_type": "MiniMaxH3SourceTimeline",
    "_meta": {
      "title": "Source soundtrack",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "22": {
    "inputs": {
      "start_clip": 1,
      "scene_range": "",
      "verify_resume_history": true,
      "plan": [
        "20",
        0
      ],
      "source_timeline": [
        "21",
        0
      ]
    },
    "class_type": "MiniMaxH3ChainLoopStart",
    "_meta": {
      "title": "Loop Start",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "23": {
    "inputs": {
      "align_audio_reference": false,
      "state": [
        "22",
        1
      ]
    },
    "class_type": "MiniMaxH3ChainCurrent",
    "_meta": {
      "title": "Current Clip",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "24": {
    "inputs": {
      "prompt": [
        "39",
        0
      ],
      "width": [
        "23",
        8
      ],
      "height": [
        "23",
        9
      ],
      "length": [
        "23",
        6
      ],
      "ref_image_size": "match",
      "clip": [
        "13",
        0
      ],
      "vae": [
        "14",
        0
      ],
      "audio_vae": [
        "15",
        0
      ],
      "ref_images.ref_image_0": [
        "2",
        0
      ],
      "ref_videos.ref_video_0": [
        "35",
        0
      ],
      "ref_video_audios.ref_video_audio_0": [
        "23",
        12
      ]
    },
    "class_type": "MiniMaxH3ReferenceToVideo",
    "_meta": {
      "title": "Reference Conditioning",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "25": {
    "inputs": {
      "source_fps": 24,
      "crop": "center",
      "state": [
        "23",
        0
      ],
      "latent": [
        "24",
        1
      ],
      "audio_vae": [
        "15",
        0
      ],
      "source_frames": [
        "5",
        0
      ],
      "source_audio": [
        "6",
        0
      ]
    },
    "class_type": "H3SourceSlice",
    "_meta": {
      "title": "Source clip (frames + audio)",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "26": {
    "inputs": {
      "upscale_method": "area",
      "largest_size": 512,
      "image": [
        "5",
        0
      ]
    },
    "class_type": "ImageScaleToMaxDimension",
    "_meta": {
      "title": "Motion reference video (~512 px)",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "27": {
    "inputs": {
      "expression": "round(a * 24)",
      "values.a": [
        "23",
        10
      ]
    },
    "class_type": "ComfyMathExpression",
    "_meta": {
      "title": "Clip start frame",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "28": {
    "inputs": {
      "batch_index": [
        "27",
        1
      ],
      "length": [
        "23",
        6
      ],
      "image": [
        "26",
        0
      ]
    },
    "class_type": "ImageFromBatch",
    "_meta": {
      "title": "Motion reference for this clip",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "29": {
    "inputs": {
      "upscale_method": "area",
      "largest_size": 1008,
      "image": [
        "5",
        0
      ]
    },
    "class_type": "ImageScaleToMaxDimension",
    "_meta": {
      "title": "SAM video (1008 px, SAM's own size)",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "30": {
    "inputs": {
      "batch_index": [
        "27",
        1
      ],
      "length": [
        "23",
        6
      ],
      "image": [
        "29",
        0
      ]
    },
    "class_type": "ImageFromBatch",
    "_meta": {
      "title": "SAM frames for this clip",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "31": {
    "inputs": {
      "noise_seed": [
        "23",
        5
      ]
    },
    "class_type": "RandomNoise",
    "_meta": {
      "title": "Clip Seed",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "32": {
    "inputs": {
      "detection_threshold": 0.35,
      "max_objects": 0,
      "detect_interval": 1,
      "images": [
        "30",
        0
      ],
      "model": [
        "17",
        0
      ],
      "conditioning": [
        "18",
        0
      ]
    },
    "class_type": "SAM3_VideoTrack",
    "_meta": {
      "title": "SAM 3.1 track it",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "33": {
    "inputs": {
      "headroom": 0,
      "hold_frames": 2,
      "max_people": 0,
      "track_data": [
        "32",
        0
      ]
    },
    "class_type": "H3PeopleMask",
    "_meta": {
      "title": "Tracked area",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "34": {
    "inputs": {
      "headroom": 0,
      "hold_frames": 1,
      "max_people": 0,
      "track_data": [
        "32",
        0
      ]
    },
    "class_type": "H3PeopleMask",
    "_meta": {
      "title": "Tracked area, tight (for the grey shape)",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "35": {
    "inputs": {
      "blur": 0.04,
      "face_blur": 0.05,
      "images": [
        "28",
        0
      ],
      "mask": [
        "34",
        0
      ],
      "size": [
        "34",
        1
      ]
    },
    "class_type": "H3GreyMannequins",
    "_meta": {
      "title": "Turn it grey (shape and movement only)",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "36": {
    "inputs": {
      "expand": 20,
      "incremental_expandrate": 0,
      "tapered_corners": true,
      "flip_input": false,
      "blur_radius": 0,
      "lerp_alpha": 1,
      "decay_factor": 1,
      "fill_holes": true,
      "mask": [
        "33",
        0
      ]
    },
    "class_type": "GrowMaskWithBlur",
    "_meta": {
      "title": "Grow mask",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "37": {
    "inputs": {
      "cut_threshold": 40,
      "images": [
        "28",
        0
      ],
      "shot_prompt": [
        "7",
        4
      ]
    },
    "class_type": "H3ClipShots",
    "_meta": {
      "title": "Find this clip's cuts",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "38": {
    "inputs": {
      "prompt": [
        "37",
        1
      ],
      "max_length": 500,
      "sampling_mode": "off",
      "thinking": false,
      "use_default_template": true,
      "mtp": "auto",
      "clip": [
        "8",
        0
      ],
      "image": [
        "37",
        0
      ]
    },
    "class_type": "TextGenerate",
    "_meta": {
      "title": "Write this clip's shot list (Qwen3-VL)",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "39": {
    "inputs": {
      "prompt": [
        "23",
        4
      ],
      "shots": [
        "38",
        0
      ]
    },
    "class_type": "H3FillShots",
    "_meta": {
      "title": "Insert shot list into prompt",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "40": {
    "inputs": {
      "source": [
        "39",
        0
      ]
    },
    "class_type": "PreviewAny",
    "_meta": {
      "title": "Clip prompt (what H3 gets)",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "41": {
    "inputs": {
      "cell_selection": "runtime exact (latent max)",
      "cell_adjust": 0,
      "preview_frame": 0,
      "overlay_opacity": 0.38,
      "show_grid": true,
      "show_source_outline": true,
      "mask_meaning": "white = generate",
      "image": [
        "25",
        0
      ],
      "mask": [
        "36",
        0
      ]
    },
    "class_type": "MiniMaxH3ContexMaskGridPreview",
    "_meta": {
      "title": "Mask preview",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "42": {
    "inputs": {
      "images": [
        "41",
        1
      ]
    },
    "class_type": "PreviewImage",
    "_meta": {
      "title": "Mask preview (white = regenerated)",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "43": {
    "inputs": {
      "grow": 0,
      "keep_audio": true,
      "megapixels": 0,
      "vae": [
        "14",
        0
      ],
      "images": [
        "25",
        0
      ],
      "mask": [
        "36",
        0
      ],
      "audio_vae": [
        "15",
        0
      ],
      "audio": [
        "25",
        1
      ]
    },
    "class_type": "MiniMaxH3FantasticVideoEditLatent",
    "_meta": {
      "title": "Edit latent (source + mask + audio)",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "44": {
    "inputs": {
      "mask_meaning": "white = generate",
      "audio_mode": "preserve source audio",
      "mask_conversion": "H3 exact (causal/token max)",
      "target_latent": [
        "43",
        0
      ],
      "mask": [
        "36",
        0
      ]
    },
    "class_type": "MiniMaxH3ContexMaskedTarget",
    "_meta": {
      "title": "Masked target",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "45": {
    "inputs": {
      "state": [
        "23",
        0
      ],
      "conditioning": [
        "24",
        0
      ],
      "vae": [
        "14",
        0
      ],
      "latent": [
        "44",
        0
      ],
      "audio_vae": [
        "15",
        0
      ]
    },
    "class_type": "MiniMaxH3ChainContext",
    "_meta": {
      "title": "Apply Clip Context",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "46": {
    "inputs": {
      "model": [
        "12",
        0
      ],
      "conditioning": [
        "45",
        0
      ]
    },
    "class_type": "BasicGuider",
    "_meta": {
      "title": "Guider",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "47": {
    "inputs": {
      "scheduler": "simple",
      "steps": [
        "23",
        7
      ],
      "denoise": 1,
      "model": [
        "12",
        0
      ]
    },
    "class_type": "BasicScheduler",
    "_meta": {
      "title": "Schedule",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "48": {
    "inputs": {
      "noise": [
        "31",
        0
      ],
      "guider": [
        "46",
        0
      ],
      "sampler": [
        "16",
        0
      ],
      "sigmas": [
        "47",
        0
      ],
      "latent_image": [
        "45",
        3
      ]
    },
    "class_type": "SamplerCustomAdvanced",
    "_meta": {
      "title": "Sample Video + Audio",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "49": {
    "inputs": {
      "samples": [
        "48",
        0
      ],
      "vae": [
        "14",
        0
      ]
    },
    "class_type": "VAEDecode",
    "_meta": {
      "title": "Decode Video",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "50": {
    "inputs": {
      "samples": [
        "48",
        0
      ],
      "vae": [
        "15",
        0
      ]
    },
    "class_type": "VAEDecodeAudio",
    "_meta": {
      "title": "Decode Audio",
      "cnr_id": "comfy-core",
      "ver": "0.42.0"
    }
  },
  "51": {
    "inputs": {
      "trim_frames": [
        "45",
        1
      ],
      "fps": 24,
      "match_tail": true,
      "audio_trim_mode": "sync_with_video",
      "images": [
        "49",
        0
      ],
      "audio": [
        "50",
        0
      ],
      "state": [
        "23",
        0
      ]
    },
    "class_type": "MiniMaxH3LoopTrim",
    "_meta": {
      "title": "Trim Overlap",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "52": {
    "inputs": {
      "state": [
        "23",
        0
      ],
      "images": [
        "51",
        0
      ],
      "sampled_latent": [
        "48",
        0
      ],
      "audio": [
        "51",
        1
      ],
      "images_with_overlap": [
        "51",
        2
      ]
    },
    "class_type": "MiniMaxH3ChainSegmentSave",
    "_meta": {
      "title": "Save Clip + Checkpoint",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "53": {
    "inputs": {
      "enabled": false,
      "play_notification_sound": false,
      "auto_continue_timeout_minutes": 0,
      "unload_models_while_waiting": false,
      "assemble_partial_on_stop": true,
      "partial_audio_source": "checkpointed",
      "candidate_count": 1,
      "review_each_candidate": false,
      "state": [
        "23",
        0
      ],
      "segment": [
        "52",
        0
      ],
      "audio": [
        "51",
        1
      ]
    },
    "class_type": "MiniMaxH3ChainReview",
    "_meta": {
      "title": "Review (off = no pause)",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "54": {
    "inputs": {
      "between_scene_cleanup": "off",
      "execution_mode": "recursive",
      "flow": [
        "22",
        0
      ],
      "state": [
        "23",
        0
      ],
      "images": [
        "51",
        0
      ],
      "sampled_latent": [
        "48",
        0
      ],
      "segment": [
        "53",
        0
      ]
    },
    "class_type": "MiniMaxH3ChainLoopEnd",
    "_meta": {
      "title": "Loop End",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  },
  "55": {
    "inputs": {
      "audio_source": "source",
      "filename": "edit_%date:yyyy-MM-dd%",
      "audio_bitrate": 256,
      "copy_to_output": true,
      "output_subfolder": "h3_oneclick_edit",
      "blend_schedule": "plan",
      "boundary_tone_match": "off",
      "color_stabilization": "off",
      "delete_checkpoints_after_assembly": false,
      "generated_audio_join": "av_overlap",
      "manifest": [
        "54",
        0
      ]
    },
    "class_type": "MiniMaxH3ChainAssemble",
    "_meta": {
      "title": "Final Video",
      "cnr_id": "comfyui-workflow-encrypt",
      "ver": "1.0.0"
    }
  }
}