Nodes/TBG’s ComfyUI Development Takeaways/FLUX.2 JSON Prompt Generator
ComfyUI Node

FLUX.2 JSON Prompt Generator

FLUX.2 speaks JSON — this node writes the prompt for you

By Ltamann·Created about a year ago·Updated 7 months ago· 20
FLUX.2 JSON Prompt Generator
    • json_prompt
    • formatted_prompt
    • camera_settings
    • json_to_clip_prompt
    camera_presetSony A7IV - 85mm f/5.6 ISO200 (Product/Portrait)
    scene_presetProfessional studio product photography setup with polished concrete surface
    scene
    subject_count1
    subject_1_descriptionMinimalist ceramic coffee mug with steam rising from hot coffee inside
    subject_1_positionCenter foreground on polished concrete surface
    subject_1_actionStationary on surface
    subject_1_pose
    subject_1_color_palette
    style_presetUltra-realistic product photography with commercial quality
    style_text_override
    lighting_presetStudio three-point lighting - professional setup, key fill rim lights
    lighting_text_override
    mood_presetClean, professional, minimalist
    mood_text_override
    background_presetPolished concrete surface with studio backdrop
    background
    composition_presetRule of thirds (classic balanced)
    composition_text_override
    camera_model_presetSony A7IV
    camera_model_text_override
    camera_angle_presetHigh angle (looking down)
    camera_angle_text_override
    camera_distance_presetMedium shot (waist up)
    camera_distance_text_override
    focus_presetSharp focus on steam rising from coffee and mug details
    focus_text_override
    lens_preset85mm portrait lens
    lens_text_override
    f_number_presetf/5.6 (product standard)
    f_number_text_override
    iso_preset200 (studio/outdoors)
    iso_text_override
    lens_mm0
    shutter_speed
    color_hex_1
    color_hex_2
    color_hex_3
    color_hex_4
    color_hex_5
    include_shot_on_prefixtrue
    enable_prompt_expansionfalse
    subject_2_description
    subject_2_position
    subject_2_action
    subject_2_pose
    subject_2_color_palette
    subject_3_description
    subject_3_position
    subject_3_action
    subject_3_pose
    subject_3_color_palette
    subject_4_description
    subject_4_position
    subject_4_action
    subject_4_pose
    subject_4_color_palette
    subject_5_description
    subject_5_position
    subject_5_action
    subject_5_pose
    subject_5_color_palette
    additional_json_fields

    FLUX.2 moved away from the single free-text prompt your SD1.5 habits expect - it wants a structured JSON prompt with camera, scene, subject, style, lighting, and composition as separate fields. Typing that by hand every run is misery. This node is a giant form that assembles it for you, and here's the part that surprises people: it calls no API and needs no key. The name sounds like an LLM wrapper, but it's pure offline string assembly with a big pile of curated presets.

    Open it and you'll see a long list of dropdowns - camera_preset, style_preset, lighting_preset, mood_preset, background_preset, composition_preset, focus_preset, lens_preset, f_number_preset, iso_preset, camera angle/distance/model - each with genuinely curated options, from "Kodachrome 1960s" film looks to "DJI Inspire 3 aerial" to "2000s digicam style." The defaults even ship a full sample product shot: a ceramic coffee mug with steam, studio three-point lighting, f/5.6, Sony A7IV.

    How it's structured

    Every preset has a matching *_text_override field, and the rule is consistent: a non-empty override wins over its preset. So you can lean on presets for 90% of a shot and hand-type the one thing that matters - scene, style_text_override, background, whatever.

    • subject_count - number of subjects (0–10), parsed as int. Only subject_1_* is required; subjects 2–5 are optional inputs you add as needed, each with description, position, action, pose, and color palette.
    • color_hex_1 through color_hex_5 - exact hex colors for the palette.
    • include_shot_on_prefix - whether to prepend "Shot on [camera]" to the natural-language version.
    • enable_prompt_expansion - this one is a trap in the fun way: the tooltip itself admits it's a no-op, "reserved for future auto-expansion." Leave it off.

    Four outputs, and which you want depends on where the prompt goes:

    • json_prompt - the structured JSON, pretty-printed.
    • formatted_prompt - a readable natural-language version of the same shot.
    • camera_settings - just the camera block, e.g. Sony A7IV | 85mm | f/5.6 | ISO 200.
    • json_to_clip_prompt - a flattened version meant for the CLIP/text-encoder input when your workflow expects a plain string.

    Wire json_prompt (or json_to_clip_prompt) into your FLUX.2 conditioning/text-encode node. That's the whole loop.

    Install

    Same as every node in this pack - Manager, search TBG Takeaways, install, restart:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Ltamann/ComfyUI-TBG-Takeaways
    

    Restart, find it under TBG/Takeaways. No dependencies, no downloads.

    Reach for this if you're building FLUX.2 product/editorial shots and want the structured prompt without memorizing the schema. Skip it if you're on FLUX.1 or SD-class models - the JSON prompt schema is FLUX.2's thing. And fair warning: it's a Patreon side-project, so the huge preset list is the polish and there's no doc beyond the tooltips. But for offline, schema-safe FLUX.2 prompting, it does exactly what it says.

    CategoryTBG/Takeaways

    Inputs (63)

    NameTypeDefaultDescription
    camera_presetCOMBOSony A7IV - 85mm f/5.6 ISO200 (Product/Portrait)Camera presets with model, lens, f-number, ISO.
    scene_presetCOMBOProfessional studio product photography setup with polished concrete surfacePre-made scene descriptions or Custom.
    sceneSTRINGScene description. Overrides scene_preset when non-empty.
    subject_countSTRING1Number of subjects (0-10). Parsed as int; invalid values default to 1.
    subject_1_descriptionSTRINGMinimalist ceramic coffee mug with steam rising from hot coffee insideSubject 1 description.
    subject_1_positionSTRINGCenter foreground on polished concrete surfaceSubject 1 position in frame.
    subject_1_actionSTRINGStationary on surfaceSubject 1 action.
    subject_1_poseSTRINGSubject 1 pose (optional).
    subject_1_color_paletteSTRINGSubject 1 colors (#hex, comma-separated).
    style_presetCOMBOUltra-realistic product photography with commercial qualityStyle preset.
    style_text_overrideSTRINGCustom style text. Overrides style_preset when non-empty.
    lighting_presetCOMBOStudio three-point lighting - professional setup, key fill rim lightsLighting preset.
    lighting_text_overrideSTRINGCustom lighting. Overrides lighting_preset.
    mood_presetCOMBOClean, professional, minimalistMood preset.
    mood_text_overrideSTRINGCustom mood. Overrides mood_preset.
    background_presetCOMBOPolished concrete surface with studio backdropBackground preset.
    backgroundSTRINGBackground description. Overrides background_preset.
    composition_presetCOMBORule of thirds (classic balanced)Composition preset.
    composition_text_overrideSTRINGCustom composition. Overrides preset.
    camera_model_presetCOMBOSony A7IVCamera model preset.
    camera_model_text_overrideSTRINGCustom camera model. Overrides preset.
    camera_angle_presetCOMBOHigh angle (looking down)Camera angle preset.
    camera_angle_text_overrideSTRINGCustom camera angle. Overrides preset.
    camera_distance_presetCOMBOMedium shot (waist up)Camera distance preset.
    camera_distance_text_overrideSTRINGCustom camera distance. Overrides preset.
    focus_presetCOMBOSharp focus on steam rising from coffee and mug detailsFocus preset.
    focus_text_overrideSTRINGCustom focus. Overrides preset.
    lens_presetCOMBO85mm portrait lensLens preset.
    lens_text_overrideSTRINGCustom lens. Overrides preset.
    f_number_presetCOMBOf/5.6 (product standard)Aperture preset.
    f_number_text_overrideSTRINGCustom f-number. Overrides preset.
    iso_presetCOMBO200 (studio/outdoors)ISO preset.
    iso_text_overrideSTRINGCustom ISO. Overrides preset.
    lens_mmSTRING0Lens focal length in mm. 0 or empty = use preset or omit.
    shutter_speedSTRINGShutter speed (optional), e.g. 1/125.
    color_hex_1STRINGPrimary hex color (e.g. #FF5733).
    color_hex_2STRINGSecondary hex color.
    color_hex_3STRINGTertiary hex color.
    color_hex_4STRINGAccent hex color 1.
    color_hex_5STRINGAccent hex color 2.
    include_shot_on_prefixBOOLEANtrueAdd 'Shot on [camera]' prefix to formatted prompt.
    enable_prompt_expansionBOOLEANfalseReserved for future auto-expansion (no-op now).
    subject_2_descriptionoptSTRINGSubject 2 description (optional).
    subject_2_positionoptSTRINGSubject 2 position.
    subject_2_actionoptSTRINGSubject 2 action.
    subject_2_poseoptSTRINGSubject 2 pose.
    subject_2_color_paletteoptSTRINGSubject 2 colors.
    subject_3_descriptionoptSTRINGSubject 3 description.
    subject_3_positionoptSTRINGSubject 3 position
    subject_3_actionoptSTRINGSubject 3 action
    subject_3_poseoptSTRINGSubject 3 pose
    subject_3_color_paletteoptSTRINGSubject 3 colors
    subject_4_descriptionoptSTRINGSubject 4 description.
    subject_4_positionoptSTRINGSubject 4 position
    subject_4_actionoptSTRINGSubject 4 action
    subject_4_poseoptSTRINGSubject 4 pose
    subject_4_color_paletteoptSTRINGSubject 4 colors
    subject_5_descriptionoptSTRINGSubject 5 description.
    subject_5_positionoptSTRINGSubject 5 position
    subject_5_actionoptSTRINGSubject 5 action
    subject_5_poseoptSTRINGSubject 5 pose
    subject_5_color_paletteoptSTRINGSubject 5 colors
    additional_json_fieldsoptSTRINGExtra JSON object merged into final output (advanced).

    Outputs (4)

    NameTypeDescription
    json_promptSTRING
    formatted_promptSTRING
    camera_settingsSTRING
    json_to_clip_promptSTRING