Nodes/ComfyUI-Cosmos-Reference/Apply Cosmos Reference Latent
ComfyUI Node

Apply Cosmos Reference Latent

Giving Cosmos and Anima a reference image, the blunt way

By Mirumo0u0·Created 4 months ago·Updated 2 months ago· 39
Apply Cosmos Reference Latent
  • model
  • ref_latents
  • MODEL

Here's the gap this node exists to plug: if you're running Anima (or anything else built on NVIDIA's Cosmos-Predict2), you don't have a real ControlNet to lean on. Anima's official ControlNet story is one maintainer's experimental LLLite weights, and the model card itself calls them "references rather than strong production-grade ControlNets" - the pose model in particular is deliberately weak. So when you want to hand the model a reference image and say "generate something that respects this," you're mostly out of luck through the usual channels. ApplyCosmosReferenceLatent is a small, single-purpose node that gives you a way to do it anyway.

What it actually does

The mechanism is dead simple, and the README is upfront about the tradeoff: it concatenates your reference image's latent onto the working latent space. No embedding extraction, no cross-attention injection, no fancy adapter math - it's the crudest possible way to say "keep this information around," which is also why it works. Concatenation doesn't compress anything through a bottleneck the way an IP-Adapter-style embedding does, so detail from the reference survives. The cost is that it's a heavier, clumsier way to steer generation, which is why the author calls the performance "poor" in the same breath as praising how well it preserves the reference. You're trading elegance for fidelity. If you know Flux Kontext's trick of literally putting reference images in the model's context window at the architecture level, this is the same family of idea, hand-fitted onto Cosmos.

The node itself is a model patch, not a conditioning node, despite living in the "conditioning" category. You load your Cosmos or Anima checkpoint as usual, run it through ApplyCosmosReferenceLatent, and the MODEL that comes out the other end is the one you plug into your KSampler - it's wrapped so that sampling now factors in the reference latent you gave it.

Inputs and outputs

Only two required inputs, and they're both worth understanding before you hook anything up:

  • model - your Cosmos-family MODEL (Anima checkpoint, Cosmos-Predict2, or another derivative). Feed it the checkpoint loader's model output, same as always.
  • ref_latents - the reference latent(s) for the generation. Note it's latent, not image: you need a VAE Encode (or whatever gets you a LATENT from your reference picture) upstream of this. The tooltip is explicit that it currently supports up to one latent, even though the widget itself is an "autogrow" slot - don't go chaining three reference images into it expecting a montage.

The single output is MODEL. That's it - no conditioning to wire up separately, no extra sampler settings. You drop the patched model straight into your normal sampling chain, exactly where the raw checkpoint model would've gone.

Installing it

There's no dependency list or model download in the README - this is genuinely just a node, no extra weights required beyond the Cosmos/Anima checkpoint you already need for generation. Two ways in:

  • ComfyUI Manager - search "ComfyUI-Cosmos-Reference" and install.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/Mirumo0u0/ComfyUI-Cosmos-Reference, then restart ComfyUI.

Either way, no extra Python packages, no HuggingFace pulls specific to this node.

Where people get tripped up

Wrong model family. The README's own scope is "the Cosmos model or models based on it, such as the Anima model" - it's not a general-purpose reference-image node. Wire it up in front of an SDXL or Flux checkpoint and you're not getting what you think you're getting; this only makes sense in a Cosmos-Predict2/Anima pipeline.

Feeding it an image instead of a latent. ref_latents wants a LATENT, and it's easy to forget the VAE Encode step when you're used to reference-image nodes that just take an IMAGE directly. If nothing seems to be happening, check that a real encoded latent is landing on that input.

Expecting IP-Adapter-grade identity lock. This is concatenation, not an identity encoder. It's good at "keep this composition/structure/detail roughly intact" and not built for "put this exact face on a new body." If you need tight face fidelity, this isn't the tool - and given Anima's thin ControlNet story, there isn't a great local alternative yet either. Temper expectations accordingly and treat this as the rough-but-honest option until Anima's ecosystem catches up.

It's a young, single-author pack. Built off levzzz5154's ref-latents-support fork of ComfyUI core with optimization help from pamparamm, this is a small utility with no version history to speak of and no wider community troubleshooting threads to lean on. If something breaks, the GitHub issues on the repo itself are your best bet - don't expect a Reddit thread to already have your answer.

Categoryconditioning

Inputs (2)

NameTypeDefaultDescription
modelMODEL
ref_latentsCOMFY_AUTOGROW_V3Reference latent(s) for generation. Up to 1 latents.

Outputs (1)

NameTypeDescription
MODELMODEL