Nodes/H3MD Director (H3MD 导演台)/H3MD Save Video Face Refine And Interp
ComfyUI Node

H3MD Save Video Face Refine And Interp

H3MD Save Video Interp with face refinement: pass 1 tracks the face over the whole long video (H3 Face Track + Crop logic), pass 2 crops, restores with TE-Speed VOSR2 and pastes back (H3 Face Stitch Back) chunk by chunk, then RIFE-interpolates and encodes like Save Video Interp.

By 1113800942·Created 4 days ago·Updated about 7 hours ago· 11
H3MD Save Video Face Refine And Interp
  • segments
  • vosr2_model
  • vosr2_settings
  • seedvr2_model
  • seedvr2_vae
  • identity_reference
  • video_path
  • frame_count
  • video
  • report
  • preview
◄filename_prefixvideo/H3MD►
◄output_folder►
◄interpolatefalse►
◄target_fps24.0►
◄scale1.00►
◄model_nameflownet.pkl►
◄batch_size8►
◄use_fp16true►
◄formatvideo/h264-mp4►
◄pix_fmtyuv420p►
◄crf19►
◄loop_count0►
◄trim_to_audiofalse►
◄save_metadatatrue►
◄save_outputtrue►
◄delete_cache_after_savefalse►
◄face_refinetrue►
◄detector▾►
◄confidence0.35►
◄crop_factor2.5►
◄canvas_width512►
◄canvas_height512►
◄canvas_modemanual►
◄smooth_window21►
◄size_smooth_window51►
◄smooth_methodgaussian►
◄size_modeper_frame►
◄paste_regionface_only►
◄mask_dilation16►
◄feather6►
◄colour_match1.00►
◄blend1.00►
◄undetected_framesfade_out►
◄vosr2_seed42►
◄identity_tracktrue►
◄identity_threshold0.28►
◄selectlargest_face►
◄fallback_detectornone►
◄fallback_head_frac0.50►
◄select_index0►
◄identity_modelinsightface►
◄cut_detectionnone►
◄cut_threshold3.0►
◄absent_shotsoff►
◄X0►
◄Y0►
◄frame_index0►
◄feather_scales_with_cropfalse►
◄refine_modelVOSR2►
CategoryMiniMax H3/H3MD

Inputs (55)

NameTypeDefaultDescription
segmentsH3MD_SEGMENTSlong video: H3MD Loop Sampler output 'long video'.
filename_prefixSTRINGvideo/H3MDLike SaveVideo: <prefix>_00001_.mp4 (subfolders allowed, %date% vars).
output_folderSTRINGEmpty = ComfyUI's output folder. Otherwise an absolute folder.
interpolateBOOLEANfalseOn: RIFE frame interpolation (ComfyUI-VFI's model) 24 fps -> target_fps. Off: the H3MD frames are written unchanged (the RIFE options below are greyed out).
target_fpsFLOAT24.01–240Frame rate of the saved file. interpolate on: RIFE target (e.g. 30, 48, 60). interpolate off: the file is still written at this rate - anything but 24 plays faster/slower than real time and the audio no longer matches (warned in the log).
scaleFLOAT1.000.25–4RIFE flow processing scale. Lower values process faster but may reduce quality (output size is unchanged).
model_nameCOMBOflownet.pklRIFE model (ComfyUI-VFI's list / locations / auto download).
batch_sizeINT81–32Frames interpolated in parallel (VRAM).
use_fp16BOOLEANtrueHalf precision RIFE (CUDA only).
formatCOMBOvideo/h264-mp4h264/h265-mp4: video + AAC audio. gif / webp: animated image, no audio. png-sequence: a folder of numbered PNGs, no audio. Every format is written chunk by chunk.
pix_fmtCOMBOyuv420ph264/h265-mp4 only. yuv420p = plays everywhere; yuv420p10le = 10 bit (less banding, not every player).
crfINT190–51h264/h265-mp4 only. Quality (default 19 like Video Combine; lower = better/larger).
loop_countINT00–100gif / webp only: 0 = loop forever, n = play n more times (like Video Combine).
trim_to_audioBOOLEANfalseh264/h265-mp4 only: end the video with the audio (like Video Combine).
save_metadataBOOLEANtrueEmbed the prompt + workflow (like Video Combine): mp4 tags, first PNG of a sequence; gif / webp: an extra <file>.png first frame carries them.
save_outputBOOLEANtrueOn: save into the output folder (or output_folder). Off: ComfyUI's temp folder (cleared on restart) - still previewable below.
delete_cache_after_saveBOOLEANfalseDelete the H3MD segment cache after the video file was fully written. Off (default): keep it, e.g. to re-render single segments with resume_from_cache or to save again. The folder is shown below.
face_refineBOOLEANtrueOn: track the face over the whole video, restore it with VOSR2 and paste it back, chunk by chunk, before interpolation. Off: exactly H3MD Save Video Interp.
detectorCOMBO1 options: none
confidenceFLOAT0.350.05–0.95—
crop_factorFLOAT2.51.2–8—
canvas_widthINT512128–1344—
canvas_heightINT512128–1344—
canvas_modeCOMBOmanual3 options: manual, auto_no_downscale, auto_capped_768
smooth_windowINT211–201—
size_smooth_windowINT511–201—
smooth_methodCOMBOgaussian3 options: gaussian, savgol, moving_average
size_modeCOMBOper_frame2 options: max_of_clip, per_frame
paste_regionCOMBOface_only3 options: face_only, face_ellipse, full_crop
mask_dilationINT160–256—
featherINT60–256—
colour_matchFLOAT1.000–1—
blendFLOAT1.000–1—
undetected_framesCOMBOfade_out3 options: fade_out, skip, composite_anyway
vosr2_seedINT420–18446744073709550000VOSR2 / SeedVR2 seed, the same for every chunk (scale is fixed at 1).
vosr2_modeloptTE_SPEED_VOSR2_MODELTE-Speed VOSR2 model (its model loader), used when refine_model = VOSR2.
vosr2_settingsoptTE_SPEED_VOSR2_SETTINGSOptional TE-Speed VOSR2 settings.
seedvr2_modeloptMODELTE-Speed SeedVR2 Loader 'model', used when refine_model = SeedVR2. Its other parameters run at that node's own defaults.
seedvr2_vaeoptVAETE-Speed SeedVR2 Loader 'vae' (with seedvr2_model).
identity_referenceoptIMAGEOptional: a picture of the person to follow (H3 Face Track + Crop identity_reference).
identity_trackoptBOOLEANtrue—
identity_thresholdoptFLOAT0.280–1—
selectoptCOMBOlargest_face1 options: largest_face
fallback_detectoroptCOMBOnone1 options: none
fallback_head_fracoptFLOAT0.500–1.5—
select_indexoptINT00–63—
identity_modeloptCOMBOinsightface1 options: insightface
cut_detectionoptCOMBOnone1 options: none
cut_thresholdoptFLOAT3.00.5–20—
absent_shotsoptCOMBOoff2 options: off, by_identity
XoptINT00–16384—
YoptINT00–16384—
frame_indexoptINT00–999999—
feather_scales_with_cropoptBOOLEANfalse—
refine_modeloptCOMBOVOSR2Face restore path: VOSR2 uses vosr2_model (+ vosr2_settings); SeedVR2 uses seedvr2_model + seedvr2_vae. The other inputs are ignored.

Outputs (5)

NameTypeDescription
video_pathSTRING—
frame_countINT—
videoVIDEO—
reportSTRING—
previewH3MD_VIDEO_PREVIEW—