Nodes/ComfyUI_StarNodes/⭐ Star Ref Mod Option
ComfyUI Node

⭐ Star Ref Mod Option

H3 reference controls that actually reach the sampler

By Starnodes2024·Created 2 years ago·Updated 2 days ago· 106
⭐ Star Ref Mod Option
  • mods
  • ref_mod_settings
  • curve graph
overridefalse
retention1.00
curve_directionconstant
curve_shapelinear
curve_value1.00
scramble_seed-1
graph_preset(none)
scramble_modeshuffle
scramble_keep1
max_total_tokens0
save_preset_as

The gap this fills

MiniMax H3's whole pitch is reference-to-video, and the pack that made those references tunable is ComfyUI-MiniMaxH3Mod. Its RefMods decide whether H3 copies your reference's identity, its style, or just a vague resemblance - retention, a per-frame weighting curve, ref scrambling, a token budget. The stock way to use them is Load H3 RefModsApply H3 RefMod, which returns conditioning you then feed onward.

Except ⭐ Star Minimax All In One builds its conditioning inside the node. There's no positive-conditioning socket on it to run Apply H3 RefMod through, so anyone who moved to the all-in-one quietly lost access to their RefMods.

⭐ Star Ref Mod Option is the bridge. It takes the same H3_REF_MODS bundle and, instead of emitting conditioning, emits a settings bundle the all-in-one folds into its internal conditioning - appended after the native reference blocks, and carried into the latent-upscale refine pass so your settings survive pass two.

How it works

It doesn't reimplement anything. At runtime the node finds the loaded ComfyUI-MiniMaxH3Mod module and calls that pack's own functions - the same reference-block builder, graph-preset loader and debug-grid renderer - and reads the curve dropdown lists from that pack's constants when they're available. Resolution order is widget curve → graph preset → the mod's saved config, precisely what Apply H3 RefMod does. Which means the one hard requirement is real: ComfyUI-MiniMaxH3Mod must be installed. Without it the node raises a RuntimeError naming the pack. The dropdowns still populate from built-in fallback lists so the UI looks sane, but it will not run.

The inputs that matter

mods is the H3_REF_MODS bundle from Load H3 RefMods, Load H3 RefMod Axis or Extract H3 RefMod. Everything else is a knob.

retention - master reference strength, multiplied with each loader row's own strength. The MiniMax levels are worth memorising: 1.0 fully preserved, 0.7 partially preserved, 0.4 attribute transfer (style and attributes, not identity), 0.15 weak reference, 0 no reference. Beginners crank this to 1.0 expecting a photocopy and get a stiff, over-constrained render. For "same vibe, new subject", 0.4 is the number.

curve_direction, curve_shape, curve_value - the weighting envelope across the mod's own ref frames. Read the tooltip on curve_direction before you touch it, because it kills the most common misconception: the curve decides which reference content dominates, not where the concept appears in the output video. Ref tokens aren't bound to output time; for timing over the denoise trajectory there's a separate H3 RefMod Step Curve node in the dependency pack. Note too that constant is the current default, and the old default (concept_at_end) faded early stack frames toward blur, roughly halving average strength on multi-frame mods - so a saved workflow's sticky old value may be quietly costing you reference strength.

scramble_seed - -1 is off, refs in saved order. With two or more refs in the bundle, a seed of 0 or above shuffles the order and keeps a random subset, so a different reference leads each run. Set this widget's control-after-generate to randomize if that's what you want per run; leaving it on fixed with a chosen seed is how you make a good result repeatable.

graph_preset / save_preset_as - curves are shareable as a PNG with the graph embedded in its metadata, stored in models/refmods/graph_presets/. Type a name and run to save one; new presets only appear in the dropdown after a restart.

max_total_tokens - a budget on reference tokens after copies, 0 disables it. When you're stacking several refs into a long clip, context is the cost you're actually paying.

override - off by default, so your widgets win. Turn it on and the node uses the config frozen into the mods themselves (the one Fix H3 RefMod Config writes) - the honest way to share mods whose settings took real tuning. With no saved config in the bundle it falls back to your widgets and prints a note in the console instead of failing.

Two outputs. ref_mod_settings goes to the ref_mod_settings input of ⭐ Star Minimax All In One. curve graph is a 1024×1024 render of the envelope with the concept zone shaded - wire it to a Preview Image node and you can see the curve you're about to apply, which beats guessing what bump and elastic actually do from their names. Leave it unconnected and it isn't shown.

Installing

Both packs, and this is the one place the order matters. StarNodes first:

cd ComfyUI/custom_nodes
git clone https://github.com/Starnodes2024/ComfyUI_StarNodes
cd ComfyUI_StarNodes && pip install -r requirements.txt

Then ComfyUI-MiniMaxH3Mod - StarNodes only names it, so install that one through ComfyUI Manager (search MiniMaxH3Mod) so you get its dependencies too. Restart once, and if you add graph presets later, restart again to see them in the dropdown.

Traps

"It says it needs ComfyUI-MiniMaxH3Mod." Accurate, not a broken install. Install the pack and restart; the StarNodes node found nothing to delegate to.

Outdated dependency, mismatched menus. The dropdown values come from the MiniMaxH3Mod version you have loaded. If its curve lists grew since your clone, update the dependency pack.

Two retention numbers. The loader rows carry their own strengths and retention multiplies them - if a reference feels weaker than the number you set, check the loader row first.

Category⭐StarNodes/Video

Inputs (12)

NameTypeDefaultDescription
modsH3_REF_MODSBundle from Load H3 RefMods / Load H3 RefMod Axis / Extract H3 RefMod.
overrideBOOLEANfalseUse the config fixed into the mods' own metadata (by 'Fix H3 RefMod Config') instead of the widgets below: retention + curve come from the first mod in the bundle that carries one. Handy for sharing mods whose magic settings took real tuning. Off (default) = use the manual parameters. If no mod has a saved config it falls back to the manual parameters and prints a note.
retentionFLOAT1.000–1Master reference strength, multiplied with each loader row's strength. MiniMax retention levels: 1.0 = fully_preserved, 0.7 = partially_preserved, 0.4 = attribute_transfer (keep style/attributes, not identity), 0.15 = weak_reference. 0 = no reference.
curve_directionCOMBOconstantWeighting envelope across THIS MOD'S OWN ref frames (stacked images / video-ref latent frames) - i.e. WHICH reference content dominates, NOT where the concept appears in the output video (ref tokens are not bound to output time; for output-timing control use the 'H3 RefMod Step Curve' node instead, which runs over the denoise timeline). 'constant' (default) = every ref frame at full strength (official-ref parity). The old default 'concept_at_end' fades early stack frames toward blur, roughly HALVING average strength on multi-frame mods. Old saved workflows keep their saved values.
curve_shapeCOMBOlinearHow the weighting travels between its endpoints: 'linear', 'ease' (smoothstep), 'sigmoid'/'tanh' (S-curves, tanh with a steeper knee), 'quadratic', 'cubic', 'exponential', 'stair' (stepped), 'elastic' (overshoots), 'bump'/'dip' (peak/trough mid-stack). Only matters when curve_direction != constant.
curve_valueFLOAT1.000–1Endpoint weight ('user input'): both endpoints for 'constant' and 'concept_at_ends', the start for 'concept_at_start', the end for 'concept_at_end', the mid peak for 'concept_at_middle'. On single-image ('image'-kind) mods this acts as a simple STRENGTH CAP (directions are meaningless on one frame): 0.4 = the ref blends 40% toward its blurred self.
scramble_seedINT-1-1–2147483647Ref scrambling seed. -1 (default) = off: all refs in saved order. With 2+ refs in the bundle, a seed >= 0 shuffles the ref order and keeps a random subset, so a different ref leads each run (a multi-ref mod 'pops' a different video/image per seed). Same seed = same scramble; set this widget's control-after-generate to 'randomize' for per-run variation.
graph_presetCOMBO(none)Optional shared graph preset - leave on '(none)' to use the curve widgets above. Selecting one loads direction/shape/value from a saved debug-grid PNG (graph embedded in its metadata) or a legacy .json, in models/refmods/graph_presets/. Share the preset PNG itself to share a curve. New presets appear after a restart.
scramble_modeCOMBOshuffle'shuffle' reorders all refs, 'subset' keeps the first 'scramble_keep' of the shuffled refs, 'legacy_subset' keeps a random-sized subset (the original behavior).
scramble_keepINT11–80Refs retained in subset mode; shuffle keeps all refs.
max_total_tokensINT00–1048576Total reference token budget after copies; 0 disables the limit.
save_preset_asSTRINGOptional: type a name and run to save the current (resolved) curve as a PNG preset - the curve graph itself with the graph embedded in its metadata - in models/refmods/graph_presets/. Share that image to share the curve. Leave empty to skip.

Outputs (2)

NameTypeDescription
ref_mod_settingsREF_MOD_SETTINGSSettings bundle for the 'ref_mod_settings' input of ⭐ Star Minimax All In One.
curve graphIMAGE1024x1024 curve graph: the strength envelope (direction/shape/value) with the concept zone shaded. Leave unconnected to skip the preview.