π― Z2J Camera Focus
Telling the model where to look β Z2J Camera Focus
- text
Every image has a subject, but not every image tells the model where to put the eye. Z2J Camera Focus is the ComfyUI-Zero2JSON node that writes the "what's in focus / where attention lands" line for you - deterministically, which matters more than it sounds: attention is one of the few prompt dimensions you can actually calibrate once you can reproduce it. It's the fourth member of the camera family, completing the rig alongside angle, distance and depth of field.
In the FLUX2-JSON workflow it feeds the focus field of the camera rig. A generated line bundles a focus target (subject's eyes, hands, an objectβ¦), the sharpness character, and an attention cue. So you get "sharp focus on the subject's eyes, tack sharp, drawing the eye to the face" - the kind of direction that keeps a portrait's face crisp even when the prompt around it is chaotic.
How it works
Position-as-seed, same core as the whole pack: (seed, prompt_index, slot) hashed with xxhash32, hash picks a template and one option per pool. The camera_focus_default.json profile has 4 templates over three pools - focus_target (12), sharpness (9), attention (8) - about 3,500 combinations. Modest vocabulary, and again that's the right call: attention words are about precision, not variety.
The inputs that matter
seed- world seed.prompt_index- position coordinate; bump to walk focus variants.profile- dropdown ofcamera_focus_*.jsonfiles; custom ones appear after restart.prefix/suffix- anchors around the focus phrase.
No filter dropdown - just the base inputs plus profile. Output is a single text string.
Install
One repo, seventeen nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/MushroomFleet/ComfyUI-Zero2JSON
cd ComfyUI-Zero2JSON
pip install -r requirements.txt
Restart ComfyUI. Only dependency: xxhash>=3.0.0 - no models, no keys. Manager users: search "ComfyUI-Zero2JSON".
Where people get burned
Focus words are the easiest to overrule: if the subject description is crowded with detail, the model's attention scatters no matter what the focus node says. Give the focus node a clean target - name one thing - and don't stack it against a subject line that's already shouting about three different features. And remember the determinism contract cuts both ways: the same seed and prompt_index give the same attention cue forever, so when a focus phrase nails the look, write down the pair. That's the whole point of this pack - reproducibility as a feature rather than an accident.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00β4294967295 | World seed for deterministic generation |
| prompt_index | INT | 00β4294967295 | Position in infinite prompt space |
| profileopt | COMBO | camera_focus_default.json | Select vocabulary profile |
| prefixopt | STRING | Text to prepend to generated prompt | |
| suffixopt | STRING | Text to append to generated prompt |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | β |