Nodes/ComfyUI_NAIDGenerator/Character Reference βœ’οΈπŸ…πŸ…πŸ…˜
ComfyUI Node

Character Reference βœ’οΈπŸ…πŸ…πŸ…˜

NovelAI's 'Precise Reference' Is Now a ComfyUI Node

By bedovyyΒ·Created 3 years agoΒ·Updated 21 days agoΒ· 117
Character Reference βœ’οΈπŸ…πŸ…πŸ…˜
  • image
  • option
  • NAID_OPTION
β—„style_awaretrueβ–Ί
β—„fidelity1.00β–Ί

Keeping a character consistent across generations is the thing that drives people to NovelAI in the first place. There's a recurring thread on the StableDiffusion subs of people asking whether any local frontend can match NovelAI's "precise reference tool" - and the honest answer from most commenters is still "not really." CharacterReferenceOptionNAID puts that exact feature inside your ComfyUI graph: give it one image of a character, and the next generation adheres to that identity. You can finally use your local workflow for masking, compositing, and upscaling while the actual generation borrows a closed model's best trick.

Before you wire it up, get the three identity tools straight: this node is identity from an image. CharacterPromptOptionNAID is identity from text (multi-character captions). And VibeTransferOptionNAID copies style and feel, not a person. If you want "that character, in this art style, from that reference," you chain this node with a vibe transfer - the pack was built for that.

How it works

The node stuffs your image and two settings into the pack's internal NAID_OPTION, and GenerateNAID does the heavy lifting at request time. The image gets letterboxed to the nearest accepted NovelAI reference canvas - the code picks whichever of 1024Γ—1536, 1536Γ—1024, or 1472Γ—1472 has the closest aspect ratio - with black padding so your character isn't squashed. It then sends the result as a director_reference_image with a description caption of character&style when style_aware is on, or just character when it's off.

The one setting worth understanding is fidelity. The pack keeps the primary reference strength pinned at 1.0 and sets the secondary strength to 1.0 βˆ’ fidelity. In practice: crank it to 1 for a strict match, or back it off toward 0 when you want the character recognizably present but the model given room to interpret. The default is 1.0, and that's the right place to start.

Inputs and outputs

Three inputs, all of which you'll actually touch:

  • image (IMAGE) - your reference. Feed it from a Load Image node, or from anything else that outputs an image tensor.
  • style_aware (default true) - copies the art style along with the identity. Turn it off when you want the same character but are changing the aesthetic, say going from a screenshot to a painterly render.
  • fidelity (0–1, default 1) - how strictly to match. See above.

The optional option input lets you chain it with other option nodes, and the single NAID_OPTION output goes into GenerateNAID's option input. That's the whole wiring: Load Image β†’ Character Reference β†’ Generate β†’ Save.

Install and the catches

Same pack, same install as the rest: search "ComfyUI_NAIDGenerator" in ComfyUI Manager, or git clone https://github.com/bedovyy/ComfyUI_NAIDGenerator into ComfyUI/custom_nodes and restart. No models to download - inference happens on NovelAI's servers, and you need a token in ComfyUI/.env (NAI_ACCESS_TOKEN=... from User Settings > Account > Get Persistent API Token). Dependencies are just python-dotenv and argon2-cffi.

Two things to know going in. First, the letterboxing preserves your aspect ratio, but it also means non-matching reference shapes get black bars - the model doesn't care, but you're renting canvas you're not using, so a reference near 3:2 or 2:3 (or square) gets the most out of the accepted sizes. Second, the reference is uploaded to NovelAI's servers along with your prompt. That's the nature of any API node - your input leaves the machine, and NovelAI's content policy applies whether you like it or not. If that's a dealbreaker, this whole pack isn't for you; if it isn't, this is the closest thing to a "make it look like this person" button that reliably works.

CategoryNovelAI

Inputs (4)

NameTypeDefaultDescription
imageIMAGEβ€”
style_awareBOOLEANtrueCopy style along with identity.
fidelityFLOAT1.000–1How strictly to match the character (and style if enabled).
optionoptNAID_OPTIONβ€”

Outputs (1)

NameTypeDescription
NAID_OPTIONNAID_OPTIONβ€”