Nodes/lzits Nodes/Bernini Run Single GPU
ComfyUI Node

Bernini Run Single GPU

The node that actually runs Bernini

By lzitser23·Created 9 months ago·Updated 3 months ago· 0
Bernini Run Single GPU
  • bernini_config
  • bernini_case
  • generation_args
  • output_path
  • case_json
  • command
  • log
bernini_repo_dir/root/Bernini
python_executable/usr/bin/python
config/root/Bernini-R-Diffusers
high_noise_ckpt
low_noise_ckpt
promptA cinematic shot of a marble statue coming to life.
task_typet2i
guidance_modet2v
output_pathoutputs/bernini_output.png
num_frames1
width848
height480
num_inference_steps40
seed42
timeout_seconds1800
case_json_override
image_path
video_paths
reference_images
negative_prompt
system_prompt
max_image_size848
fps16
flow_shift5.0
omega_V1.25
omega_I4.50
omega_TI4.00
omega_scale0.80
eta0.50
use_prompt_enhancerfalse
dry_runfalse
extra_args
show_previewtrue

This is the centerpiece of the pack, and the reason the other Bernini nodes exist. Bernini is a 14B renderer with its own Python 3.11 / CUDA 12.4 requirements, and bolting that onto ComfyUI's environment is a recipe for a broken install. Bernini Run Single GPU sidesteps the whole mess: it launches the upstream infer_single_gpu.py in a subprocess, streams the logs into your console, and lets ComfyUI keep running normally even if Bernini's dependencies aren't installed in ComfyUI's Python at all.

How it works

The node assembles a command - your configured Python, the repo's infer_single_gpu.py, --config, --case, and every generation flag - writes the case to a temporary JSON file, runs it with a timeout, and reaps the process if it hangs. Relative output paths are resolved under ComfyUI's output directory, output folders are created automatically, and a small progress bar ticks in the corner. It's the Kijai/WanVideoWrapper philosophy applied to a CLI script.

Prefer the typed inputs

Three optional inputs override the wall of fallback widgets:

  • bernini_config (from Bernini Model Config) - repo path, Python, config dir, checkpoints, env vars.
  • bernini_case (from Bernini Case Builder) - prompt, task type, guidance mode, media paths, output.
  • generation_args (from Bernini Generation Settings) - frames, size, steps, seed, omegas, eta.

Connect all three and you can ignore most of the widgets. The fallback widgets exist so you can test a one-off prompt without building the whole graph.

The controls worth knowing

  • dry_run - builds the full command and case but doesn't execute it. This is the most useful toggle in the node: it's how you verify your paths and flags before committing to a 30-minute render. Do this every time you change something.
  • timeout_seconds - default 1800. Hung processes get killed and reaped instead of piling up.
  • use_prompt_enhancer - passes --use_pe, which needs BERNINI_PE_API_KEY in the env (set it in Bernini Model Config's env_json).
  • negative_prompt / system_prompt - optional extra conditioning passed as CLI flags.
  • extra_args - raw CLI flags for upstream options not yet exposed; shlex-split with Windows handling.
  • show_preview - for image outputs inside ComfyUI's output dir, returns UI preview metadata so the result appears in the node.

Outputs

  • output_path (STRING) - where the file landed. For .png/.jpg/.webp results, feed it to Bernini Load Output Image to get a real IMAGE tensor. For .mp4, keep the path for video helpers.
  • case_json (STRING) - the exact case that was run.
  • command (STRING) - the exact command line, quoted and shell-safe. Invaluable when a render fails: you can run it by hand in the Bernini environment and see the real error.
  • log (STRING) - the streamed subprocess output.

Gotchas

  • The repo must exist - if infer_single_gpu.py is missing you get a clear "clone ByteDance/Bernini first" error, not a traceback.
  • Editing is slow by design: Bernini is Wan-2.2-derived, and the source video you're editing is part of the model input, so compute is roughly double a plain Wan generation. On consumer GPUs, budget accordingly (a single 3090 was reported around 55–60 s/it at 480×832/101 frames).
  • The two-checkpoint rule follows you here too: high_noise_ckpt/low_noise_ckpt must be set together.

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. The pack itself needs no Bernini Python deps, but you still need the upstream pieces: clone bytedance/Bernini, download ByteDance/Bernini-R-Diffusers (a real download), and have a Python 3.11 CUDA 12.4 environment. The Bernini Setup Commands node prints the exact commands.

Categorylzits nodes/Bernini

Inputs (36)

NameTypeDefaultDescription
bernini_repo_dirSTRING/root/BerniniFallback if bernini_config is not connected.
python_executableSTRING/usr/bin/pythonFallback if bernini_config is not connected.
configSTRING/root/Bernini-R-DiffusersFallback if bernini_config is not connected.
high_noise_ckptSTRINGOptional fallback if bernini_config is not connected.
low_noise_ckptSTRINGOptional fallback if bernini_config is not connected.
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.png
num_framesINT11–241
widthINT84864–2048
heightINT48064–2048
num_inference_stepsINT401–100
seedINT420–2147483647
timeout_secondsINT180060–86400
bernini_configoptBERNINI_CONFIGFrom Bernini Model Config. Overrides repo/python/config/checkpoint widgets.
bernini_caseoptBERNINI_CASEFrom Bernini Case Builder. Overrides prompt/media widgets.
generation_argsoptBERNINI_GENARGSFrom Bernini Generation Settings. Overrides generation widgets.
case_json_overrideoptSTRINGOptional raw JSON override if not using bernini_case.
image_pathoptSTRING
video_pathsoptSTRING
reference_imagesoptSTRING
negative_promptoptSTRING
system_promptoptSTRING
max_image_sizeoptINT84864–4096
fpsoptINT161–120
flow_shiftoptFLOAT5.00–20
omega_VoptFLOAT1.250–20
omega_IoptFLOAT4.500–20
omega_TIoptFLOAT4.000–20
omega_scaleoptFLOAT0.800–20
etaoptFLOAT0.500–1
use_prompt_enhanceroptBOOLEANfalse
dry_runoptBOOLEANfalseBuild command/case but do not execute. Useful while wiring workflows.
extra_argsoptSTRINGAdvanced: extra CLI args appended with platform-aware shlex splitting.
show_previewoptBOOLEANtrueFor image outputs inside ComfyUI/output, return UI preview metadata.

Outputs (4)

NameTypeDescription
output_pathSTRING
case_jsonSTRING
commandSTRING
logSTRING