JoyLTX Refs by Name
Cast your shots by folder name — no reference images in the prompt, no LoRA
- ref_images
- ref_mask
- report
- prompts
The classic multi-shot failure is two-fold: you can't keep the same face across shots, and you can't keep two characters from being the same face. LoRAs fix the first but need training; IP-Adapter-style injection was yesterday's answer. Refs by Name takes a different route: it reads your shot prompts, finds the character names that have a photo folder, and attaches one reference photo per shot as an in-context keyframe. No LoRA, no captions, no voice cloning - the person in the folder is the person in the shot.
Setup is one folder per character under ComfyUI/input/joyecho_refs/ (the default refs_root). Folder names are the character names, matched case-insensitively against the shot prompts - so alice/ and "Alice" in the prompt are the same person. Then name your characters in the premise exactly that way and the writer does the casting for you, writing "looks exactly as in the reference photographs" instead of inventing a face. That's why refs_attached exists upstream on StorySource: it's the switch that tells the writer to point at your photos rather than describe people.
How the matching works matters. Each shot gets one reference: the most-mentioned character with a folder wins, ties go to the earliest mention. You can force a pick with [ref: alice] or @alice in the shot text - the marker gets stripped from the output prompts, so it's a casting instruction the render model never sees. There's even a safety net: if a shot says someone "looks exactly as in the reference photographs" but that character has no folder, the node strips the sentence and tells you in the report, because pointing the model at photos that aren't attached only costs the character their real description.
The outputs are ref_images (one photo per shot, fit to your width/height render size), ref_mask (a comma list of character names per shot the sampler uses for per-character identity and voice locks), report (who got cast from where - always worth a glance before a long render), and prompts (the cleaned prompts with any [ref:] markers removed). Wire ref_images + ref_mask into the Multishot sampler and you're done.
pick controls which photo of a character gets used: the default "one per character (by seed)" uses the same photo for a character in every shot, which the tooltip calls best identity - and it's right. crop defaults to portrait, keeping the central upper part of each photo so the reference carries the face and not the room. A full-scene photo drags its set into the shot; keep it portrait unless you want the location.
One thing to know before you start: folders you add won't show in the dropdown until you refresh ComfyUI, and the sampler's ref_strength (0.85 default) is where you tune how hard the reference pulls. The README's honest calibration: below ~0.75 you get the hair and clothes but a different face; 0.85–0.9 carries the face and small details like glasses; 1.0 starts dragging the photo's own room in. Also - the photo does not carry age. The prompt has to say it.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| prompts | STRING | The writer's shot prompts (JSON or --- list). Normally wired from the writer or Prompts from File. | |
| refs_root | COMBO | Folder under ComfyUI/input holding one sub-folder per character (the folder NAME is the name the node looks for in each shot prompt, case-insensitive). Restart or refresh ComfyUI to see folders you just added. | |
| pick | COMBO | one per character (by seed) | one per character = the SAME photo for a character in every shot (best identity). |
| seed | INT | 00–2147483647 | — |
| width | INT | 96064–4096 | Render size (pass 1); the photos are fit to it. |
| height | INT | 54464–4096 | — |
| cropopt | COMBO | portrait (keep the person, drop the set) | portrait = the central upper part of each photo, so the reference carries the face and not the room (a full scene photo drags its set into the shot). |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| ref_images | IMAGE | — |
| ref_mask | STRING | — |
| report | STRING | — |
| prompts | STRING | — |