Nodes/ComfyUI-Zero2JSON/🎯 Z2J Camera Focus
ComfyUI Node

🎯 Z2J Camera Focus

Telling the model where to look β€” Z2J Camera Focus

By MushroomFleetΒ·Created 7 months agoΒ·Updated 5 months agoΒ· 1
🎯 Z2J Camera Focus
    • text
    β—„seed0β–Ί
    β—„prompt_index0β–Ί
    β—„profilecamera_focus_default.jsonβ–Ί
    β—„prefixβ–Ί
    β—„suffixβ–Ί

    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 of camera_focus_*.json files; 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.

    CategoryZero2JSON/Camera

    Inputs (5)

    NameTypeDefaultDescription
    seedINT00–4294967295World seed for deterministic generation
    prompt_indexINT00–4294967295Position in infinite prompt space
    profileoptCOMBOcamera_focus_default.jsonSelect vocabulary profile
    prefixoptSTRINGText to prepend to generated prompt
    suffixoptSTRINGText to append to generated prompt

    Outputs (1)

    NameTypeDescription
    textSTRINGβ€”