Nodes/ComfyUI-RH-Bernini/Bernini Prompt Enhancer
ComfyUI Node

Bernini Prompt Enhancer

It builds the request, you bring the LLM

By RH-RunningHub·Created 3 months ago·Updated 3 months ago· 23
Bernini Prompt Enhancer
  • source_video
  • source_image
  • reference_images
  • system_prompt
  • user_prompt
  • llm_prompt
  • api_prompt
  • json_mode
prompt
task_typev2v
video_frames3

The name is a lie, and that's the good news: Bernini Prompt Enhancer doesn't call any API, needs no key, and does zero "enhancing" by itself. What it actually does is build the exact task-aware prompt-enhancement request from ByteDance's official Bernini prompt enhancer, so you can hand it to whatever LLM node you already run and get back a prompt Bernini will actually obey.

First, the thirty seconds of context that make this node make sense. Bernini is ByteDance's maskless video-editing and reference-to-video model, fine-tuned on Wan 2.2, and it is famously prompt-hungry. It's instruction-driven, not caption-driven - you tell it what to change in a clip or which of your five reference images a character's outfit comes from, and it punishes vague phrasing. ByteDance's own inference scripts recommend pushing every prompt through an enhancement LLM before sampling, and the community found the same thing: people running a vision-capable model like Qwen or Gemma in front of it report a real difference in how faithfully edits land. This pack backports those official templates so you get the enhancement step in the graph instead of copy-pasting strings out of the repo.

How it works

Pick a task_type from the combo box (t2v, t2i, v2v, mv2v, i2i, i2v, r2v, r2i, rv2v, vrc2v, vi2v, ads2v) and the node assembles the matching system prompt plus a task template around your raw prompt - the reference-to-video modes get instructions that tell the LLM to describe each indexed reference, editing modes get change-focused instructions, and text-to-video just gets the plain T2V system prompt. For the reference-heavy modes (r2v, r2i, rv2v, vrc2v) it also sets JSON mode so the LLM is told to reply with a single rewritten_text field.

The trap hiding in the optional media inputs: source_video, source_image, and reference_images are only counted. The node uses them to fill in "how many images/reference frames" the template mentions, then does nothing else with them - it doesn't encode or send them anywhere. You still have to connect the same media to your external vision LLM node yourself, or the LLM will be asked to describe images it never sees. The tooltip says exactly this, and it's the #1 thing people get wrong on first build.

The inputs and outputs that matter

  • prompt - your raw instruction or generation prompt. The one genuinely important field. Bonus: the enhancer tells a Chinese-language input to be rewritten into English, which is a nice touch if you're not writing prompts in English.
  • task_type - set it to match what you connected, not what sounds cool. Defaults to v2v; use t2v for text-only, r2v when you're feeding reference images.
  • video_frames (1–8, default 3) - how many source-video frames the enhancement prompt asks the vision LLM to describe. A couple frames is usually enough for a vibe; bump it for frame-accurate edits.

The outputs are a ladder of convenience: system_prompt and user_prompt for LLM nodes with two text inputs, llm_prompt (a single combined string) for nodes that only take one, api_prompt for the raw official request if you want to debug against ByteDance's reference script, and json_mode - a string you wire straight into the companion Bernini Prompt Result Parser. The one you'll actually use is the system_prompt/user_prompt pair.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/RH-RunningHub/ComfyUI-RH-Bernini

then restart ComfyUI (or use ComfyUI Manager and search "ComfyUI-RH-Bernini"). Requirements are refreshingly light: no extra Python packages at all - the requirements file is deliberately empty - and this node downloads no models. Two real caveats: the pack uses ComfyUI's newer V3 custom-node API, so you need a reasonably recent ComfyUI build, and the full Bernini workflow still needs the model side (Wan 2.2 weights plus Bernini-compatible checkpoints, Kijai's fp8 conversions being the common route) and the pack's Bernini Conditioning node to actually sample.

Troubleshooting

If the nodes don't appear after install, your ComfyUI is too old for the V3 API - update it before blaming the pack. If your enhanced prompt comes back ignoring your references, you forgot to connect the media to the vision LLM. If the parser hands you raw JSON, you didn't wire json_mode through. And remember this node is only half the pipeline: without an external LLM node of your own (local Ollama-style node or an API node) there's nothing on the other end to do the enhancing.

Categoryconditioning/video_models

Inputs (6)

NameTypeDefaultDescription
promptSTRINGOriginal user instruction or generation prompt. For Chinese input, the enhancer asks the external LLM to rewrite it in English.
task_typeCOMBOv2vBernini task type. Choose the mode that matches connected media and the intended generation or editing workflow.
video_framesINT31–8Number of source video frames described to the external vision LLM in prompt-enhancement tasks.
source_videooptIMAGEOptional source video frames. Also connect the same frames to your external vision API node when the selected task needs visual context.
source_imageoptIMAGEOptional source image. Also connect it to your external vision API node for i2i/i2v tasks.
reference_imagesoptIMAGEOptional reference image batch. Also connect it to your external vision API node for r2v/r2i/rv2v/vrc2v/vi2v tasks.

Outputs (5)

NameTypeDescription
system_promptSTRING
user_promptSTRING
llm_promptSTRING
api_promptSTRING
json_modeSTRING