ComfyUI Node

Prompt Styler Focus

Depth of field and bokeh presets for SDXL

By wolfden·Created 3 years ago·Updated about a year ago· 105
Prompt Styler Focus
    • positive_prompt_text_g
    • negative_prompt_text_g
    text_positive
    text_negative
    style
    log_promptNo

    This is the photography-nerd node of the pack, and quietly one of the more useful ones. Its dropdown - 89 options deep - is all about focus and depth of field: Extreme Shallow Depth of Field, Very Shallow Depth of Field, Moderate Depth of Field, Deep Depth of Field, Hyperfocal Distance, Selective Focus, Bokeh Effect, Night Photography Depth of Field, and dozens more. Pick your focus character, keep your subject, and the node appends the optical language that pushes SDXL toward it.

    Why care? Because naming concrete optical facts is one of the highest-leverage things you can put in a photorealism prompt - far more than piling on "realistic, detailed, high quality." "Shallow depth of field, creamy bokeh, subject in sharp focus" reads to the model as a real camera setup, and it drops the image out of flat, everything-in-focus mode. This node is a menu of exactly that kind of phrasing.

    How it works

    Each focus style is a template in a JSON file: a prompt field with a {prompt} placeholder and a negative_prompt. Your positive text fills the placeholder, the focus wording wraps it, and out comes the finished string. Empty negative uses the template's; a typed one merges with it. No GPU, no download, no API - it's text assembly, and your checkpoint does the actual rendering.

    The 89-item list is granular on purpose. There's a real difference between "extreme shallow" (a sliver of the eye in focus, everything else melted) and "moderate" (subject crisp, background soft but readable), and having both as presets beats guessing at f-stop language.

    The inputs and outputs that matter

    • style - the depth-of-field look. This is the node; 89 to explore.
    • text_positive - your subject. Portraits and macro benefit most from shallow focus; landscapes want the deep end.
    • text_negative - optional; blank inherits the template's negative, or add your own.

    log_prompt (No/Yes) prints the assembled prompt to the console so you can see precisely how a preset like Bokeh Effect was phrased.

    Outputs: positive_prompt_text_g and negative_prompt_text_g, two strings, into your positive and negative CLIP Text Encode nodes.

    Installing it

    ComfyUI Manager: search SDXL Prompt Styler (wolfden), install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/wolfden/ComfyUi_PromptStylers
    

    Restart ComfyUI. No dependencies, no models to download. The styler nodes appear under a Style Prompts submenu.

    Common issues

    Match the focus to the subject. Extreme Shallow Depth of Field on a sweeping landscape fights the scene - you're asking for a blurred vista. Shallow for portraits and close-ups, deep for landscapes and architecture.

    none is a passthrough. The first entry, none byFocus, applies nothing. Check it if the node seems inert.

    It's a bias, not a lens. SDXL leans toward the look; it doesn't simulate a physical aperture. Extreme presets sometimes over-blur or put focus on the wrong plane. Nudge to a milder preset if it overshoots.

    SDXL-family tool. These templates were written for SDXL and its tag-style prompting plus a live negative. Focus language still helps a little on newer models - it's a physical descriptor - but the negative half is dead at CFG 1 on Flux/Z-Image, so run this where it was designed to run: SDXL checkpoints.

    CategoryStyle Prompts

    Inputs (4)

    NameTypeDefaultDescription
    text_positiveSTRING
    text_negativeSTRING
    styleCOMBO89 options: none byFocus, Extreme Shallow Depth of Field, Very Shallow Depth of Field, Night Photography Depth of Field, Moderate Shallow Depth of Field, Moderate Depth of Field, +83
    log_promptCOMBONo2 options: No, Yes

    Outputs (2)

    NameTypeDescription
    positive_prompt_text_gSTRING
    negative_prompt_text_gSTRING