Nodes/ComfyUI-DiffAid-Patches/MiniMax H3 Diff-Aid Sparse Patch
ComfyUI Node

MiniMax H3 Diff-Aid Sparse Patch

A text-adherence dial for ComfyUI's MiniMax H3 (experimental, so start low)

By xmarre·Created 5 months ago·Updated 23 days ago· 17
MiniMax H3 Diff-Aid Sparse Patch
  • model
  • model
  • summary
enabledtrue
block_indices1,13,25,37,50
strength0.20
sigma_start0.000
sigma_end1.000
sigma_ramp0.000
token_weight_modenone
token_tail0.35
cond_onlytrue

MiniMax H3 landed in ComfyUI as an open-weight, multimodal text-to-video-and-audio model in late July 2026, and within a couple of weeks somebody was already trying to make its text conditioning hit harder. This node is that attempt. It's an inference-time patch, from the xmarre/ComfyUI-DiffAid-Patches pack, that amplifies the text rows inside MiniMax H3's transformer at selected blocks. Think of it as a prompt-adherence knob that costs nothing at runtime and requires no retraining - with the honest caveat that it is experimental and has no published results behind it.

Where it sits

The node is a MODEL -> MODEL patch with a bonus STRING output. Wire it like this:

Load Diffusion Model (MiniMax H3)
  -> MiniMax H3 Diff-Aid Sparse Patch
  -> guider / scheduler

It goes after the model loader, before the sampler. Everything downstream just sees a cloned, patched model. The summary string is diagnostics - handy the first time you run it, ignorable after.

How it works

MiniMax H3 is a packed-sequence transformer: text, vision, audio, and video tokens all live in one 2D tensor shaped [rows, hidden_size]. Each block receives mod_segments metadata - (start_row, stop_row, modulation_index) tuples - telling it what each row range is. The trick this node exploits: modulation_index % 3 gives you the modality, where class 1 is genuine language, 0 is visual, and 2 is audio.

The node installs replacement patches on selected blocks and, per block, modulates only the class-1 (language) rows:

text_rows' = text_rows + text_rows * α

where α = strength × time_gain × branch_gain × token_gain. No trained Aid network from the paper (arXiv 2602.13585) is involved - this is a hand-built approximation of Diff-Aid's sparse-enhancement idea. time_gain comes from a normalized sigma window (1.0 = the first, high-noise model call, 0.0 = the low-noise end), branch_gain zeroes out unconditional rows when cond_only is on, and token_gain optionally decays toward the later tokens.

Two things make this node worth reading about rather than assuming it's a toy. First, it treats mod_segments as authoritative: vision pads, reference rows, audio, and target video are all left untouched. Only genuine text gets boosted. Second, it refuses to guess - if the metadata is missing or malformed it raises a hard compatibility error instead of silently modulating the wrong rows.

The inputs that matter

  • block_indices - comma-separated 1-based transformer blocks to patch. Default 1,13,25,37,50 (an evenly spaced exploratory set for the 50-block native model; not paper-derived, treat it as a starting point).
  • strength - the modulation magnitude, -1.0 to 1.0. Start at 0.20 and creep up. Negative values de-emphasize text, which is a thing you can do even if you'll rarely want to.
  • sigma_start / sigma_end / sigma_ramp - the normalized-sigma window. The full 0 → 1 window means "modulate the whole run." A high-noise-only taper like start 0.55, end 1.0, ramp 0.10 is a reasonable first experiment.
  • token_weight_mode - none, linear, or exponential. none scales every token equally; the decay modes push the emphasis toward the earlier tokens, which is where prompts usually carry their meaning.
  • cond_only - keep this True unless you deliberately want to mess with the unconditional branch.

Outputs: the patched MODEL and the summary string.

Installing

Clone into ComfyUI/custom_nodes, no extra pip dependencies beyond a stock ComfyUI install:

cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-DiffAid-Patches

Restart ComfyUI, or search "ComfyUI-DiffAid-Patches" in ComfyUI Manager if you'd rather let it handle things.

First run and gotchas

  • You need the native ComfyUI MiniMax H3 path. The node checks the inner model structure and raises ValueError if you feed it something else - a WAN model or a Kijai-style wrapper won't work.
  • sigma_start > sigma_end throws. Keep the window sane.
  • The mod_segments requirement means a reasonably recent ComfyUI build; an older one that doesn't pass that metadata through will error on first block call.
  • Be skeptical of your own results. The README is refreshingly direct about this: the H3 block list is unvalidated, there are no H3 ablations, and the Diff-Aid paper itself only evaluates FLUX and SD 3.5. If you want to claim it works, hold seed, prompt, model, and settings fixed and actually A/B it.
  • If you also run Spectrum's H3 node, the pack publishes a small compatibility descriptor so both nodes agree on block indices and the sigma coordinate. Nice touch, not something you need to configure.

My take: this is a genuinely interesting idea in a very fresh space, but it's seasoning, not a fix. A text-adherence problem on H3 is more likely a prompt or conditioning-embeddings issue than something a patch solves. Still, at strength 0.2 on a couple of blocks it's cheap to try - and "cheap to try" is exactly what an inference-time patch should be.

Categorymodel_patches/diffaid

Inputs (10)

NameTypeDefaultDescription
modelMODEL
enabledBOOLEANtrue
block_indicesSTRING1,13,25,37,50
strengthFLOAT0.20-1–1
sigma_startFLOAT0.0000–1
sigma_endFLOAT1.0000–1
sigma_rampFLOAT0.0000–0.5
token_weight_modeCOMBOnone3 options: none, linear, exponential
token_tailFLOAT0.350–1
cond_onlyBOOLEANtrue

Outputs (2)

NameTypeDescription
modelMODEL
summarySTRING