Nodes/lzits Nodes/Bernini Case Builder
ComfyUI Node

Bernini Case Builder

Assemble the JSON that Bernini actually eats

By lzitser23·Created 9 months ago·Updated 3 months ago· 0
Bernini Case Builder
    • case_json
    • case_path
    • bernini_case
    promptA cinematic shot of a marble statue coming to life.
    task_typet2i
    guidance_modet2v
    output_pathoutputs/bernini_output.png
    save_case_path
    image_path
    video_paths
    reference_images

    Bernini doesn't take a prompt and a seed. It takes a case - a JSON document that describes the task type, the guidance mode, the prompt, the source media, and the output file, which its infer_single_gpu.py script reads. Hand-writing that JSON is a fine way to introduce a syntax error at 10pm. Bernini Case Builder builds it for you and hands the result to the runner as a typed object.

    The inputs that matter

    • prompt - your instruction. Bernini is an instruction model, not a caption one: "remove the umbrella, keep the bench" style, and multi-reference prompts address images by index ("the man from image0...").
    • task_type - one of seven: t2i, i2i, t2v, v2v, rv2v, r2v, mv2v. The mapping is memorable if you read it as task-to-media: text→image, image→image, text→video, video→video, reference-video→video, reference→video, multi-reference→video.
    • guidance_mode - also seven options (rv2v, v2v, v2v_chain, t2v, and the _apg variants). When in doubt, t2v is the default for good reason.
    • output_path - use .png for one-frame/image outputs, .mp4 for video. The tooltip says it plainly and it matters: this decides how the downstream loader treats the result.
    • save_case_path - optional; if set, the node also writes the case JSON to disk for debugging or reuse.

    The optional media inputs are where the editing happens: image_path (single source image for i2i/editing), video_paths (one source video per line), and reference_images (one per line, up to five for the r2v/mv2v modes that made Bernini famous for multi-reference consistency).

    Outputs

    • case_json (STRING) - the JSON as text; handy for inspection or case_json_override.
    • case_path (STRING) - the on-disk path, if you gave save_case_path.
    • bernini_case (type BERNINI_CASE) - the typed object you connect to Bernini Run Single GPU's bernini_case input, which overrides the runner's prompt/media widgets.

    Notes and gotchas

    The node is an output node - it can stand alone as a debugging display if you want to see what it builds. And one subtlety from the pack's design: guidance_mode set here flows into the case, which the runner treats as authoritative; a guidance_mode on the Generation Settings node can be overridden by the case. So if you're changing guidance behavior and nothing seems to happen, check whether the case is overriding it.

    Installing this node

    One of the 16 nodes in the lzits Nodes pack (Lior Zitser, MIT). Install via ComfyUI Manager (search "lzits Nodes") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lzitser23/lzits-nodes.git
    

    Restart ComfyUI. No extra Python deps for this node; the upstream repo (bytedance/Bernini) and the ByteDance/Bernini-R-Diffusers download are the real requirements, and the Bernini Setup Commands node prints those commands.

    Categorylzits nodes/Bernini

    Inputs (8)

    NameTypeDefaultDescription
    promptSTRINGA cinematic shot of a marble statue coming to life.
    task_typeCOMBOt2i7 options: t2i, i2i, t2v, v2v, rv2v, r2v, +1
    guidance_modeCOMBOt2v7 options: rv2v, v2v, v2v_chain, t2v, r2v_apg, v2v_apg, +1
    output_pathSTRINGoutputs/bernini_output.pngUse .png for one-frame image outputs, .mp4 for video outputs.
    save_case_pathSTRINGOptional path to save the case JSON for debugging/reuse.
    image_pathoptSTRINGSingle source image for i2i/editing.
    video_pathsoptSTRINGOne or more source videos, one per line.
    reference_imagesoptSTRINGReference images, one per line.

    Outputs (3)

    NameTypeDescription
    case_jsonSTRING
    case_pathSTRING
    bernini_caseBERNINI_CASE