π Z2J Camera DoF
Bokeh you can reproduce β Z2J Camera DoF writes the depth-of-field line
- text
Depth of field is a photography term most prompters ignore until they notice every image has the same default focus. Z2J Camera DoF is the ComfyUI-Zero2JSON node that writes the DoF line for you - deterministically, so a shallow-focus look you like is one you can get back. It's the "how much is sharp" member of the camera family, sitting alongside angle (how the camera looks), distance (how far) and focus (what the eye lands on).
It feeds the depth-of-field field of the FLUX2-CameraRig in the FLUX2-JSON workflow. A generated line bundles a DoF type (shallow, deep, macroβ¦), the bokeh character, how the focus transitions, and a plane description - so you get "shallow depth of field, creamy bokeh, smooth focus falloff, subject's face in sharp focus" instead of a bare "bokeh" tag.
How it works
Position-as-seed, standard for the pack: (seed, prompt_index, slot) hashed with xxhash32, hash selects a template and one option per pool. The camera_dof_default.json profile has 4 templates over four pools - dof_type (9), bokeh (9), transition (6), plane_description (8) - about 15,500 combinations. The bokeh pool is the fun one: creamy, swirly, busy, smooth - the character of the blur, not just its presence.
The inputs that matter
seed- world seed.prompt_index- position coordinate; farm it to walk DoF variants.profile- dropdown ofcamera_dof_*.jsonfiles; custom profiles show up after restart.prefix/suffix- anchors around the DoF phrase.dof_style- a filter dropdown (shallow / moderate / deep / bokeh_heavy / everything_sharp). Fine print: in v1.0.0 as shipped this is declared but ignored by the generator. It doesn't filter yet - check for a newer release.
Output is a single text string.
Install
All seventeen nodes in one repo:
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 API keys. Manager users: search "ComfyUI-Zero2JSON".
Where people get burned
DoF and focus are easy to over-specify together. "Shallow depth of field" plus a separate focus node saying "background in focus" is a contradiction the model resolves by picking the louder phrase - usually the bokeh, which is why you sometimes get a foreground subject blurring into mush. Let DoF own the blur and let the focus node own the target; don't have both negotiating sharpness. Also worth knowing: deep-focus and everything-sharp outputs are essentially a style choice, and on FLUX2 models they lean on the LLM encoder's understanding of photographic terms - which is exactly why these read so cleanly.
Inputs (6)
| 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_dof_default.json | Select vocabulary profile |
| prefixopt | STRING | Text to prepend to generated prompt | |
| suffixopt | STRING | Text to append to generated prompt | |
| dof_styleopt | COMBO | any | Depth of field style hint |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | β |