RUM FLUX.2 Native Match Reference Encode
Turn a reference image into edit latents RUM can attend to
- image
- vae
- reference_latents
- status
RUM isn't just a text-to-image model. The RUM edit checkpoint (model-checkpoint-1202000.safetensors) does instruction-style editing - you give it a reference image and a sentence like "change clothes to school uniform, short sleeves" and it edits the image to match. RUMFlux2NativeMatchReferenceEncode is the node that feeds the reference into that pipeline: it takes an image and the FLUX.2 VAE and produces the RUM_REFERENCE_LATENTS the CFG guider injects into sampling.
This is the node that makes the edit workflow in the README work. In examples/diffusers_match_edit_workflow.json, the reference image loads via a normal LoadImage, this node encodes it, and its reference_latents output connects to RUMFlux2DiffusersCFGuider. That optional input is the whole edit path.
How it works
It replicates what upstream's Flux2KleinPipeline(image=...) does, which the TECH doc lays out:
- Scale the reference so its max dimension is 1024×1024.
- Crop to the multiples the FLUX.2 latent needs.
- Normalize pixels to [-1, 1].
- VAE-encode to latents, then batch-normalize (the BN step is specific to RUM's reference handling).
- Pack the reference tokens so they get appended to the denoise tokens during sampling.
The output is a RUM_REFERENCE_LATENTS object plus a status string. That custom type is what lets the guider treat reference tokens specially - it can't be concatenated like ordinary conditioning, and the pack enforces that with clear errors rather than silent nonsense.
Inputs and wiring
image- any IMAGE tensor. Droprum_reference.jpginComfyUI/input/and pointLoadImageat it, or use your own.vae- the FLUX.2 VAE (flux2-vae.safetensorsinmodels/vae/).
Outputs: reference_latents → RUMFlux2DiffusersCFGuider, plus status.
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 --include-edit-checkpoint
Restart. The edit checkpoint is the one extra model beyond the T2I set.
Gotchas
- The sampler rule.
reference_latentsonly works onRUMFlux2DiffusersEulerSampler. Connect the guider to a stock sampler and you get the pack's helpful error. If your edit produces an unchanged image, check that wiring first. - The VAE must be FLUX.2. An SDXL VAE will encode into the wrong latent space and the edit will be garbage. The README's model table is explicit about
flux2-vae.safetensors. - Run without
--cpu-vaeif you want results to match the reference - the README flags CPU VAE float differences as a "same seed, different result" cause.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| vae | VAE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| reference_latents | RUM_REFERENCE_LATENTS | — |
| status | STRING | — |