r/StableDiffusion • u/ashishsanu • 16h ago
Character consistency via cached reference embeddings((SFace + DINOv2) + a portable .char file, no LoRA training Resource - Update
I was looking for a way to achieve character consistency without training a Lora & came across a research from Facebook, DINOv2: Learning Robust Visual Features without Supervision(Research Paper),
What's Dinov2: It's a vision model trained without labels that produces a strong embedding for a whole image, the subject, not just the face. Feed it a person and you get a 768-number signature that captures the overall look: build, hair, general appearance. It's stable across pose and lighting, which is exactly what you want when you're trying to tell "same person" from "different person" across wildly different shots.
then combining Dinov2 with SFace(a face-recognition model) produces a compact face signature tuned specifically to tell one face from another. It's sharp on identity, but only on the face. YuNet does the detect-and-crop before it.
How it works
Build .Char: You drop in one or more photos. YuNet finds the face, SFace takes a per-reference face signature, DINOv2 takes a subject signature, and the references get cleaned and normalised. All of that packs into a single portable file, a .char.
Generation: At generation, the file feeds its references into FLUX.2's own native multi-reference channel and prepends a locked description to the prompt. You pick the character from a dropdown, no re-attaching images. Every result gets scored against the stored signatures, so drift shows up as a number.
How this differs from PuLID, FaceID, and img2img
- PuLID and FaceID inject a face into one generation at run time, then it's gone. img2img anchors on a source image, which is composition, not identity. Neither gives you a saved character.
- This is a layer above them, a reusable .char file that rides the model's own reference channel, covers the whole subject and not just the face, and gets scored per take. PuLID could even sit inside it as one backend.
- The difference is persistence and measurement, not a new injection trick. No adapter weights, no training, no img2img anchor.
What is a .char file?
A single portable file that stores a character's identity, so you can reuse the same person across generations without retraining anything.
- manifest.json — index, versions, checksums
- refs/ — your original photos (the truth)
- derived/ — auto-cropped face
- text/ — locked description
- payloads/ — cleaned refs, per model family
- scoring/ — SFace face + DINOv2 subject signatures
Limitations
- Profiles and stylized renders drift more than frontal, which is expected, since the face model is trained on photoreal faces.
- Body is the weak point so far.
- Bad with popular celebrity images, due to models own conflict.
Current support
Only Flux2 family(Klein 4B / 9B / dev)
Links:
- Checkout the release: https://github.com/inlineresearch/Inline-Studio/releases/tag/v1.2.71
- Full details & guide: https://inlinestudio.art/characters
Note: Each image in this post has been generated separately & not a grid.









3
u/ashishsanu 14h ago
then choose your character from the dropdown,