Nodes/CoMPaSS-ComfyUI/CoMPaSS for FLUX.1-dev
ComfyUI Node

CoMPaSS for FLUX.1-dev

The node that tries to teach FLUX where things actually go

By blurgyy·Created 12 months ago·Updated 12 months ago· 3
CoMPaSS for FLUX.1-dev
  • model
  • MODEL

Prompt FLUX.1-dev for "a photo of a sheep below a sink" and you have a coin flip on whether the sheep ends up under the sink, on top of it, or having somehow fused with it. That failure - models that choke on "above", "below", "left of", "right of" - is exactly what CoMPaSS targets. It's a research trick from an ICCV 2025 paper (arXiv 2412.13195) that adds positional information to the text side of the model's attention, and this node is the ComfyUI port. It is not a ControlNet, not a new checkpoint, and it has no image input: it's a surgical patch on the model's architecture, plus a 52MB LoRA that supplies what the model learned.

How it works

FLUX's transformer is built from DoubleStreamBlocks where image and text tokens attend to each other. CoMPaSS's single change: inside each block, it adds a learned 1D sinusoidal positional encoding to the text tokens' queries and keys, leaving values untouched. The idea is that text tokens get an implicit sense of "where in the sequence I am", which helps the model keep "sheep" and "below the sink" in the right relational order instead of treating them as a bag of words.

Read the source and the mechanism is delightfully small. convert() deep-copies your model patcher, verifies it's actually a FLUX model, then replaces every DoubleStreamBlock.forward with a wrapped version that injects the encoding. Because ComfyUI's comfy.ldm.flux.layers already ships DoubleStreamBlock, Modulation, attention and friends, the node needs zero extra pip dependencies - no requirements.txt in the repo, just torch and whatever ComfyUI already has.

Two things to notice. First, the node itself only adds a sinusoidal encoding - the learned part lives in the CoMPaSS LoRA, so you must load that too. The author is blunt about it in the example workflow: loading the LoRA without the patch node has "some beneficial impact" but is undefined behavior. Load both. Second, the deepcopy means the full diffusion model gets duplicated in memory while it patches - fine on a 24GB card, worth knowing on a 12GB one.

Wiring it in

The node has exactly one input and one output: model (MODEL) in, model (MODEL) out. There are no knobs, no strength slider, nothing to tune. The canonical chain, straight from the repo's example workflow:

CheckpointLoaderSimple (flux1-dev) 
  → LoraLoaderModelOnly (CoMPaSS-FLUX.1-comfyui.safetensors, strength 1) 
    → CoMPaSS for FLUX.1-dev 
      → FluxGuidance (3.5) → KSampler (euler / simple, 20 steps, CFG 1.0)

Use LoraLoaderModelOnly (not the regular LoraLoader) since the CoMPaSS LoRA is pure model weights. And remember this is FLUX, so no negative prompt - CFG stays at 1.0 and you steer with the FluxGuidance node.

Installing

Clone it in, restart, and grab the weights:

cd ComfyUI/custom_nodes/
git clone https://github.com/blurgyy/CoMPaSS-FLUX.1-dev-ComfyUI.git
# restart ComfyUI, then download the LoRA:
# https://huggingface.co/blurgy/CoMPaSS-FLUX.1 → CoMPaSS-FLUX.1-comfyui.safetensors
# into ComfyUI/models/loras/

ComfyUI Manager finds it under "CoMPaSS-ComfyUI" too. The repo ships an example-comfyui-workflow.json with a with/without comparison built in - worth loading just to see whether it does anything for you.

Honest expectations

The community reception when the weights dropped in August 2025 was split: the initial HF release "does not work in comfyui", someone had to convert it - this pack is that conversion. And the thread has the other half of the story: users who got it working and reported "zero actual difference in the images". That's not the node lying; it's that the effect is only visible on spatial prompts, and even then it's subtle. If you never prompt for layouts, this does nothing for you. If you're fighting "the vase on the left keeps becoming the vase on the right", it's one of the few real fixes, and at 52MB it costs you nothing to test.

One more gotcha: the node raises a ValueError if the model isn't a FLUX-type model, and the LoRA is trained for dev specifically. Don't point it at a schnell checkpoint and expect magic.

CategoryConditioning

Inputs (1)

NameTypeDefaultDescription
modelMODEL

Outputs (1)

NameTypeDescription
MODELMODEL