Nodes/RUM FLUX.2-Klein Native/RUM FLUX.2 Native Match Reference Encode
ComfyUI Node

RUM FLUX.2 Native Match Reference Encode

Turn a reference image into edit latents RUM can attend to

By Rinne414·Created 5 months ago·Updated 2 months ago· 8
RUM FLUX.2 Native Match Reference Encode
  • 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:

  1. Scale the reference so its max dimension is 1024×1024.
  2. Crop to the multiples the FLUX.2 latent needs.
  3. Normalize pixels to [-1, 1].
  4. VAE-encode to latents, then batch-normalize (the BN step is specific to RUM's reference handling).
  5. 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. Drop rum_reference.jpg in ComfyUI/input/ and point LoadImage at it, or use your own.
  • vae - the FLUX.2 VAE (flux2-vae.safetensors in models/vae/).

Outputs: reference_latentsRUMFlux2DiffusersCFGuider, 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_latents only works on RUMFlux2DiffusersEulerSampler. 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-vae if you want results to match the reference - the README flags CPU VAE float differences as a "same seed, different result" cause.
CategoryRUM/native

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
vaeVAE

Outputs (2)

NameTypeDescription
reference_latentsRUM_REFERENCE_LATENTS
statusSTRING