Bernini Case Builder
Assemble the JSON that Bernini actually eats
- case_json
- case_path
- bernini_case
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_apgvariants). When in doubt,t2vis the default for good reason. - output_path - use
.pngfor one-frame/image outputs,.mp4for 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'sbernini_caseinput, 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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A cinematic shot of a marble statue coming to life. | — |
| task_type | COMBO | t2i | 7 options: t2i, i2i, t2v, v2v, rv2v, r2v, +1 |
| guidance_mode | COMBO | t2v | 7 options: rv2v, v2v, v2v_chain, t2v, r2v_apg, v2v_apg, +1 |
| output_path | STRING | outputs/bernini_output.png | Use .png for one-frame image outputs, .mp4 for video outputs. |
| save_case_path | STRING | Optional path to save the case JSON for debugging/reuse. | |
| image_pathopt | STRING | Single source image for i2i/editing. | |
| video_pathsopt | STRING | One or more source videos, one per line. | |
| reference_imagesopt | STRING | Reference images, one per line. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| case_json | STRING | — |
| case_path | STRING | — |
| bernini_case | BERNINI_CASE | — |