Nodes/ComfyUI-BerniniR/BerniniR · Text Encode (UMT5 + task prefix)
ComfyUI Node

BerniniR · Text Encode (UMT5 + task prefix)

Bernini's edits are driven by a sentence you never type

By neuregex·Created 3 months ago·Updated 3 months ago· 24
BerniniR · Text Encode (UMT5 + task prefix)
  • model_path
  • cond
prompt
task_typet2v
add_system_prefixtrue
negative_prompt色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走

BerniniR · Text Encode is this pack's text encoder for the diffusers path, and it encodes the exact same thing ByteDance's CLI encodes: your prompt run through the UMT5 encoder, with a per-task system prompt silently prepended to the front. That prefix - "You are a helpful assistant specialized in video editing," for example - is a big part of why Bernini follows instructions instead of just captions. It's the model's switch for which job it's doing, and this node sets it for you based on one dropdown.

Bernini is an instruction-following model, not a caption model. That's the community's single most important prompting lesson, and it starts here: pick the right task_type and the model knows whether you're editing a video, generating from references, or doing text-to-image. The pack's Sampler node then reads that same choice and auto-selects the matching guidance mode.

The inputs

  • model_path (BR_PATH) - connect the model_path output of BerniniR · Load Model. The UMT5 weights live inside the same bundle, so there's no separate text-encoder download on this path.
  • prompt - your instruction. Reference images are addressed by index in the prompt, e.g. "the man from image0, wearing the black T-shirt from image2, keep the scene from image4 unchanged."
  • task_type - t2i, i2i, t2v, v2v, mv2v, rv2v, r2v. This picks the system prompt and drives the sampler's auto guidance mode. Set it first, prompt second.
  • add_system_prefix - on by default. Off strips the task preamble, which is the "I know what I'm doing" escape hatch if you want raw UMT5 embeddings.
  • negative_prompt - defaults to the stock Wan2.2 Chinese negative (yes, the node ships with Chinese text in it - that's the model's official negative, not a bug). You can replace it with your own; the negative is encoded without a task prefix.

Mechanically: the positive gets the task prefix concatenated literally in front (no space, exactly like Bernini), everything is padded to 512 tokens, and the result is moved to CPU and freed before the experts load - the README's measured UMT5 peak is ~10.8 GB, transient, and it's gone before sampling.

Output

cond (BR_COND) - carries the positive and negative embeddings and the task_type, into BerniniR · Sampler.

Install

Part of the shared pack: ComfyUI Manager, or git clone https://github.com/neuregex/ComfyUI-BerniniR into custom_nodes and pip install -r requirements.txt. The sentencepiece requirement is the one people skip - UMT5 needs it.

Troubleshooting

  • "Why is my negative prompt in Chinese?" It's the official Wan2.2 negative (quality/deformity/watermark terms). Leave it, or swap in your own.
  • Edits coming out literal instead of instructed? You're probably on the wrong task_type. A "make it night" edit with task_type = t2v runs as text-to-video and ignores your source; it should be v2v.
  • On the GGUF path you won't use this node. The GGUF graphs load UMT5 through CLIPLoaderGGUF (type = wan) instead - the fp8 .safetensors UMT5 triggers a Windows/torch-2.8 access violation under memory pressure. This node exists for the diffusers/dual-expert path, where the weights come from the downloaded bundle.
  • Long prompts getting truncated? 512-token cap, same as Bernini's CLI. Keep instructions tight and put the important edit words early.
CategoryBerniniR

Inputs (5)

NameTypeDefaultDescription
model_pathBR_PATHConecta el output 'model_path' del Load Model.
promptSTRING
task_typeCOMBOt2v7 options: t2i, i2i, t2v, v2v, mv2v, rv2v, +1
add_system_prefixBOOLEANtrueAntepone el system prompt de la tarea (como Bernini).
negative_promptSTRING色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走

Outputs (1)

NameTypeDescription
condBR_COND