Bernini-R Prompt Embedding
The task-aware prompt planner that stops you fighting Bernini-R's system prompts
- clip
- positive
- negative
- system_prompt
- full_prompt
Bernini-R is a renderer, not a text box: it expects a system prompt plus your prompt, and the full pipeline normally has a 7B MLLM planner doing that thinking for you. That planner never got a working ComfyUI path, so this node is the pragmatic substitute - it picks the right system prompt for your task, concatenates your prompt, encodes the whole thing with the Wan T5 encoder, and hands you ready-made conditioning. It's the node that makes the renderer-only workflow actually work like the full model was supposed to.
How it works
You pick a task type, and the node selects a matching system prompt - twelve presets from "Text to Video" through "Video Editing (Style / Motion)" to "Ads / Content Insertion". It joins system prompt + your prompt with a delimiter, encodes it, and outputs both the positive and a task-default negative conditioning. Because the T5-XXL encoder is big, it also does two things to keep VRAM sane: force_offload shoves the CLIP back to CPU after encoding, and use_disk_cache saves the encoded embeddings to disk so the same prompt on the next run doesn't re-encode at all.
The inputs that matter
- task_type - the 12-way dropdown. This is the important one. The active behavior of the whole graph is determined by which visual inputs you later connect to
BerniniR_Conditioning; the task type mostly tunes the system prompt and the default negative. - user_prompt - your actual creative prompt.
- clip / clip_name / clip_type / clip_device - if you connect a
clipfromBerniniR_CLIPLoader, the file-based inputs are ignored. If you don't, the node loads the encoder itself usingclip_name(fromtext_encoders/).clip_device=cpuis the VRAM-saving default.
Useful optional ones:
- negative_prompt - defaults to a long Chinese negative string (the standard Wan-style quality list: overexposure, static, bad hands, extra fingers...). Leave it empty to use the task default, or replace it if you want a plain-English negative.
- cache_tag - isolates disk caches, handy if you're comparing prompts across models or projects and don't want hash collisions.
Outputs
Four: positive and negative (CONDITIONING) feed BerniniR_Conditioning, and system_prompt and full_prompt (STRING) are for eyeballing what actually got sent - genuinely useful for debugging, since "why is it behaving like a different task?" is usually a system-prompt question.
Installation and the disk cache
Pack installs via ComfyUI Manager or git clone https://github.com/xiaolibai-sys/ComfyUI-BerniniRWrapper into custom_nodes, then restart. Dependencies stay light (numpy, einops, tqdm, comfy-kitchen). The model downloads are the usual three: the Bernini-R diffusion model, the Wan T5-XXL encoder, the Wan 16-channel VAE.
Two things to know going in. First, that disk cache is a genuine quality-of-life win - the second run of the same prompt skips encoding entirely. But if you change the CLIP or the model, tag or clear it, because embeddings cached under one encoder can quietly persist across a swap. Second, and this is the Wan/Bernini context that explains a lot of frustration: this model prompts like an instruction, not a caption. Especially with references, address them by index ("the man from image0...") rather than describing everything as a scene. The task presets help, but the instruction-style habit is the one that actually changes your results.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| task_type | COMBO | Default / General | Pre-built task type. Selects a system prompt + default negative tailored to the task |
| user_prompt | STRING | Your creative prompt describing the desired video content | |
| clipopt | CLIP | CLIP text encoder. If connected, CLIP loader inputs below are ignored | |
| clip_nameopt | COMBO | CLIP model file (ignored if 'clip' input is connected) | |
| clip_typeopt | COMBO | wan | CLIP architecture type |
| clip_deviceopt | COMBO | cpu | 'cpu' saves VRAM during encoding, 'default' = GPU |
| negative_promptopt | STRING | 色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走 | Negative prompt. Leave empty to use task default |
| delimiteropt | STRING | Separator between system prompt and user prompt | |
| force_offloadopt | BOOLEAN | true | Offload CLIP to CPU after encoding to free VRAM |
| use_disk_cacheopt | BOOLEAN | true | Cache encoded embeddings to disk for reuse across sessions |
| cache_tagopt | STRING | Optional tag to isolate caches (e.g. per model or project) |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |
| system_prompt | STRING | — |
| full_prompt | STRING | — |