ComfyUI Node

H3MD Loop Options

Advanced switches for H3MD Loop Sampler: low-res prefix (Alpha/Beta), drift handoff, seams, reference windows, tiling, VRAM/cache details.

By 1113800942·Created 4 days ago·Updated about 7 hours ago· 11
H3MD Loop Options
    • options
    ◄ref_image_sizematch►
    ◄continue_audiotrue►
    ◄drift_strength0.60►
    ◄drift_lock_tokens2►
    ◄audio_crossfade_ms0►
    ◄release_vram_between_segmentstrue►
    ◄tiling_axisauto►
    ◄tiling_overlap8►
    ◄ff_chunk_rows0►
    ◄release_upscalertrue►
    ◄unload_idle_modelstrue►
    ◄cache_dtypefp16►
    ◄cache_dir►
    ◄unload_models_before_mergetrue►
    ◄continue_lowres_prefixnative_lowres_carry►
    ◄merge_overlap_sourcenext►
    ◄seam_tone_matchoff►
    ◄seam_tone_strength1.00►
    ◄seam_tone_global0.00►
    ◄seam_decode_context0►
    ◄vram_releasedeep►
    ◄slow_step_guardstop►
    ◄lowres_anchor0.00►
    CategoryMiniMax H3/H3MD

    Inputs (23)

    NameTypeDefaultDescription
    ref_image_sizeCOMBOmatch2 options: match, max
    continue_audioBOOLEANtrue—
    drift_strengthFLOAT0.600–1Drift: peak re-noise weight for the overlap prefix token farthest from the seam (the prefix is restored exactly at the end). 0 = prefix kept unchanged during sampling too (the former static_lock).
    drift_lock_tokensINT20–64Prefix tokens nearest the seam that stay locked (1 token = 3.4 frames).
    audio_crossfade_msINT00–2000—
    release_vram_between_segmentsBOOLEANtrueUnload idle models (text encoder, VAEs, upscaler leftovers) + soft_empty_cache between segments. The shared base UNet stays.
    tiling_axisCOMBOautoHigh-res tiling: split direction. auto = the longer side; width = left/right strips; height = top/bottom strips. Audio and time are never split.
    tiling_overlapINT82–32High-res tiling: overlap between neighbouring strips in latent pixels (x16 image pixels); the strip predictions are feather-blended over it.
    ff_chunk_rowsINT00–262144Low VRAM: run the DiT feed-forward on this many sequence rows at a time (both passes). Same result, lower peak memory, a little slower. 0 = off (the high-res tiling still switches it on by itself after an out-of-memory retry at the most strips).
    release_upscalerBOOLEANtrueDrop the learned upscaler from RAM right after the lift.
    unload_idle_modelsBOOLEANtrueBetween the passes: unload text encoder / VAEs / other idle models + empty the cache. The diffusion models stay loaded.
    cache_dtypeCOMBOfp16Cached frame format. fp16 ~= lossless (2 B/value); uint8 = half the disk, 8-bit like the saved video.
    cache_dirSTRINGEmpty = auto: <drive>/H3MD_cache on the local fixed drive with the most free space (an existing H3MD_cache holding resume_* runs is reused first, so resume survives restarts). Falls back to ComfyUI temp/h3md_cache with a warning if nothing is writable.
    unload_models_before_mergeBOOLEANtrueAfter the last segment: unload all models (incl. the base UNet) + empty cache before the merge and downstream RIFE/Save.
    continue_lowres_prefixCOMBOnative_lowres_carryContinued segments, low-res pass: pixel_reencode (Alpha) = the overlap frames are downscaled in pixel space and VAE-encoded (fixes the hazy/ghosted continuation); latent_resize = the engine's latent-space resize; native_lowres_carry (default) = the previous segment's own low-res stage latent tail (unresized) pins the low-res prefix, the high-res final latent pins the high-res prefix; falls back to pixel_reencode when no matching carry exists.
    merge_overlap_sourceCOMBOnextContinuation joins: which decoded copy of the overlap frames is kept. next = the new segment's copy (decoded WITH following frames as VAE context; the previous segment's last frames are decoded without it); prev = old behaviour. Hard cuts, frame count, audio and the joined latent are unchanged.
    seam_tone_matchCOMBOoffContinuation joins, after decode: measure the low-frequency brightness (luma) or colour (color) difference of the two overlap copies near the seam and add a small, clamped offset to the new segment that eases out over ~18 frames. off = unchanged.
    seam_tone_strengthFLOAT1.000–1Fraction of the measured seam delta corrected (clamped to +-0.04).
    seam_tone_globalFLOAT0.000–1Optional whole-segment luma offset = this * measured luma delta (clamped to +-0.015); the seam offset eases to it instead of to 0.
    seam_decode_contextINT00–2Continued segments: decode with this many 17-frame clips of the previous segment's final latent in front (VAE context), then drop them, so the new segment does not start the VAE cold at the seam. 0 = off (old behaviour).
    vram_releaseCOMBOdeepBetween segments. deep: unload idle models, reset ComfyUI's cast/staging buffers, empty the CUDA cache and log memory before/after; if PyTorch still keeps > 2 GB idle or the GPU is nearly full, unload ALL models (the base UNet reloads, ~0.5-1 min). basic: the old idle-model unload only.
    slow_step_guardCOMBOstopWatches the sampler's step times. A step >= 4x the usual time of that stage (and >= 120 s) means VRAM ran out (weights streamed every step). stop: interrupt the run (disk cache kept; restart ComfyUI and queue again with resume_from_cache on). warn: log only. off: no watch.
    lowres_anchorFLOAT0.000–1ONE continuous scene only (motion copy, a long take). After each continued segment's low-res pass, pull the new frames' 24 latent channels (mean and spread) back to the first segment of the shot, before the upscale; the low-res carry is corrected too, so colour / contrast drift cannot pile up segment after segment. 0 = off, 1 = full. Needs continue_lowres_prefix = native_lowres_carry. Do not use for a story whose colours should change. 只用于单一场景的长视频(动作复刻、长镜头):每个续接段低清跑完、放大前,把新画面 24 个通道的均值和幅度拉回本镜头第一段,低清接续数据也一起校正,颜色不会一段段越漂越深。0 = 关,1 = 全量。需要 continue_lowres_prefix = native_lowres_carry。场景本该变色的叙事视频不要开。

    Outputs (1)

    NameTypeDescription
    optionsH3MD_LOOP_OPTIONS—