Extensions/ComfyUI-ShiftClockSampler
ComfyUI Extension

ComfyUI-ShiftClockSampler

Shift Clock Sampler: dual-clock Euler/res_multistep for MiniMax-H3 video and audio at any step count.

By cicalooo·Created 2 months ago·Updated 2 months ago· 2
cicalooo/ComfyUI-ShiftClockSampler
Nodes1
On cloudLocal install
Categorysampling/custom_sampling/samplers
Stars2
Updated2 months ago
Readme

Shift Clock Sampler

ComfyUI sampler for MiniMax-H3 joint video + audio generation.

The UI name is Shift Clock. Under the hood this is dual-clock / dual-axis sampling: H3 is one transformer, but video and audio denoise on different rectified-flow shifts (defaults 12 and 3). A stock single-clock sampler walks both packed streams with the video delta, so audio is over-stepped — worst at 4 Turbo steps (blown, clipped, noise-like audio), still the wrong ODE at 8, 20, or 50.

This node turns native audio carry off (audio_scale = 1.0) and Euler-blends each stream on its own sigma clock, matching the official two-scheduler MiniMax loop. It is not a LoRA. Use it with a Turbo LoRA upstream, or with the base model.

Do not stack this on top of ComfyUI-MiniMaxH3-DualAxis. That pack assumes the pre-ModelSamplingAV protocol and will double-scale audio on current ComfyUI.

Install

cd ComfyUI/custom_nodes

Place this folder at ComfyUI/custom_nodes/ComfyUI-ShiftClockSampler, then fully restart ComfyUI. Search for:

Shift Clock Sampler

Node type: ShiftClockSampler.

Wiring

Start from an official MiniMax-H3 advanced workflow (SamplerCustomAdvanced). Replace KSamplerSelect:

Load Diffusion Model → [Turbo LoRA, optional] → Shift Clock Sampler
  model  → BasicGuider and BasicScheduler
  sampler → SamplerCustomAdvanced.sampler
BasicScheduler (simple, any steps, any denoise) → sigmas

The model output must feed the guider. A sampler-only swap is not enough: Comfy would still carry audio onto the video clock before the loop starts.

To keep this wiring while using stock Comfy sampling, set sampling_mode to comfy_native. That mode returns the input model unchanged and returns Comfy's normal euler or res_multistep sampler. It is a complete native-mode bypass, not a partial bypass: the dual-clock model patch is applied only in dual_clock mode.

BasicScheduler keeps control of step count. Incoming sigmas are the video clock; audio sigmas are mapped with time_shift_sigma.

Controls

| Input | Default | Notes | |---|---|---| | sampling_mode | dual_clock | dual_clock patches H3 and samples video/audio on separate clocks. comfy_native returns the original model and Comfy's stock sampler. | | integrator | euler | In dual_clock mode, the list shows euler and res_multistep. In comfy_native mode, it switches live to every native ComfyUI KSampler. | | shift_video | 12 | Official H3 video flow shift. 768p Turbo recipes sometimes use 6. | | shift_audio | 3 | Official H3 audio flow shift. |

Suggested defaults

| Use | Integrator | Scheduler | Steps | |---|---|---|---| | Turbo LoRA | euler | simple | 4–8 | | Base H3 | euler or res_multistep | simple | 20 | | Fast base | res_multistep | simple | 12–21 |

CFG 1.0, denoise can be less than 1 (img2vid / continuation). Partial starts rebase the audio slice onto the audio clock so it is not initialized at sigma_video.

Why not stock Euler on current ComfyUI?

Since commit bdcb886, ComfyUI ModelSamplingAV carries audio at a constant shift_video / shift_audio and converts velocity inside the DiT so any stock sampler can run. That is a compatibility layer.

Shift Clock does what the official pipeline does: two clocks, no carry, Euler (or res_multistep) on each axis. Native AV carry and this sampler must not run together; the node patches audio_scale to 1.0 so they do not.

On older ComfyUI the model returned audio velocity pre-scaled by dσ_audio / dσ_video. The sampler detects that protocol and divides the slope out.

Not in this pack

  • Turbo LoRA loading or key-prefix conversion
  • Rebuilding a fixed 4-step sigma grid (the scheduler you connect is used as-is)
  • MiniMax-Creator sampling-row integration

License

Apache-2.0.