RUM FLUX.2 Diffusers Match Model Patch
The token-policy patch that keeps the diffusers match honest
- model
- model
- status
Every RUM diffusers-match workflow runs through this node, and it does something that sounds boring and isn't: it tells the model how to slice its conditioning during cross-attention. RUMFlux2DiffusersMatchModelPatch wraps your loaded RUM model with the token policy that RUM was actually trained with - 200 Qwen tokens as the base, 77 SDXL teacher tokens as the extra - so the transformer attends to exactly the conditioning stream it saw in training.
The context: RUM's conditioning isn't a single stream. It's Qwen tokens concatenated with SDXL teacher CLIP tokens. When ComfyUI runs the model, the attention blocks need to know which chunk is which and how far to read. That's the "match" in the name - matching the diffusers reference pipeline's token cropping instead of whatever ComfyUI's default FLUX.2 path assumes.
The inputs
model- the RUM model fromRUMFlux2LoadNativeModel. (In the shipped T2I workflow, loader → this node → the CFG guider.)base_text_tokens(200) - the Qwen base length. The tooltip is unambiguous: it must match the loader and the text-encode node, and a mismatch raises an error before sampling. That validation is a later-pack addition - earlier versions would just silently hand you corrupted images.extra_text_tokens(77) - the SDXL teacher chunk length.disable_guidance(true) - suppresses the model's own guidance handling so guidance is applied only by the CFG guider. Leave it on for the match path.
Outputs: the wrapped model and a status string confirming the token policy (base=200, extra=77, guidance=disabled).
How it works, briefly
The wrapper installs RUMDiffusersMatchTokenPolicy, which knows three slicing modes - positive branch, negative branch, and legacy - so the guider's two branches each crop the combined conditioning to the right shape. It also validates that the conditioning meta matches the configured token counts; mismatch now fails loudly instead of decaying into a wrong picture. Guidance, when disabled, is simply not double-applied inside the model.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Rinne414/ComfyUI-RUM
cd ComfyUI-RUM
pip install -r requirements.txt
python scripts/download_models.py --comfy-root /path/to/ComfyUI --include-teacher-clip
Restart after the pip install. You need a ComfyUI recent enough for SamplerCustomAdvanced and nested latents (v0.26.2+ per the README).
Gotchas
- The 200/200/200 agreement. Loader, this node, and
RUMFlux2NativeMatchTextEncodemust all say 200 for the diffusers-match workflow. The pack now validates it, but if you hand-edit a workflow from an older version, check all three. - This node is match-path-only. On the plain native path (512 tokens, standard sampler) you don't use it - that path uses
RUMFlux2ApplyModelPatchinstead. Mixing the two paths is the classic way to end up with conditioning that's neither one. - It pairs with the RUM noise, scheduler, Euler sampler, and CFG guider as a set. Use the set, or use none of it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| base_text_tokens | INT | 2001–4096 | 必须与 RUMFlux2LoadNativeModel 和 text encode 节点的 base_text_tokens 一致;不一致会直接报错。 |
| extra_text_tokens | INT | 771–512 | — |
| disable_guidance | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| status | STRING | — |