Nodes/ComfyUI_MieNodes/Bernini Prompt Generator ๐Ÿ‘
ComfyUI Node

Bernini Prompt Generator ๐Ÿ‘

Task-aware prompt rewriting with ByteDance's Bernini templates

By MieMieeeeeยทCreated 2 years agoยทUpdated 28 days agoยท 225
Bernini Prompt Generator ๐Ÿ‘
  • llm_service_connector
  • source
  • reference_images
  • reference_video
  • bernini_prompt
โ—„task_typet2i - ๆ–‡็”Ÿๅ›พโ–บ
โ—„user_promptโ–บ
โ—„seed0โ–บ
โ—„video_frames3โ–บ
โ—„reference_video_frames0โ–บ
โ—„image_detailautoโ–บ
โ—„temperature0.70โ–บ
โ—„top_p0.90โ–บ
โ—„max_tokens8192โ–บ
โ—„timeout30โ–บ

BerniniPromptGenerator rewrites your prompt using Bernini's task-aware system prompts - a set of templates built for 13 different generation tasks, from plain text-to-image to reference-guided video editing. Pick the task, feed your instruction (and optionally the image or video you're operating on), and it hands back a prompt shaped for that specific job.

It's the most capable prompt node in ComfyUI-MieNodes, MieMieeeee's utility pack, and also the one most likely to be misunderstood.

The name is a little misleading - read this first

Bernini is ByteDance's open video-editing model, fine-tuned from Wan 2.2's weights and released Apache 2.0 - the KB calls it the strongest open v2v editing available in 2026. But this node does not run the Bernini model. What it uses is Bernini's prompt-enhancer - the 13 task-specific system prompts and templates that ByteDance shipped alongside the model (the MieNodes README is explicit that they're a verbatim copy of the upstream bytedance/Bernini prompt library). So this node borrows Bernini's prompt-shaping brains and runs them through whatever LLM you connect. It produces a better prompt; the actual image or video still gets generated by your normal sampler downstream. It fits ByteDance's whole pattern of shipping the useful components open while the flagship models stay behind an API (panel).

Why task-aware matters

A prompt for text-to-image and a prompt for "edit this video using a reference clip" are completely different animals. Bernini's contribution is a purpose-built system prompt for each: t2i, t2v, i2i, i2v, r2i/r2v (reference-subject), the various video-editing tasks (v2v, mv2v, vi2v, rv2v, vrc2v, ads2v), plus MieNodes' own ri2i extension. Instead of you learning how to phrase each, you pick the task and let the right template do the shaping. It's the prompt-engineering "structure matters" idea, packaged per task.

The inputs that matter

  • llm_service_connector (required) - the LLM that does the rewriting, from a Set*LLMServiceConnector node.
  • task_type (required, 13 choices, default t2i) - the job. The dropdown labels are bilingual (code + ไธญๆ–‡). This is the most important choice you make here; it picks the template.
  • user_prompt (required, multiline) - your instruction.
  • seed (required) - reproducibility/variation.

For the editing and reference tasks, you can also forward media so the LLM can see what it's rewriting about: source (IMAGE - the image or video frames being operated on), reference_images and reference_video (IMAGE - subjects or guidance material), plus video_frames / reference_video_frames to control how many frames get sent, and image_detail, temperature, top_p, max_tokens, timeout. For a plain t2i you can ignore all of those.

The single output is bernini_prompt (STRING) - into your text-encode, or a ShowAnything node to read it.

Installing it

Install the pack. ComfyUI Manager โ†’ search ComfyUI-MieNodes (ComfyUI_MieNodes) โ†’ install โ†’ restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes

then restart. No model download for the pack. Nodes appear under the sheep-emoji ๐Ÿ‘ MieNodes menu.

The API key step

Needs an LLM, so needs an API key on the connector (api_token, or mie_llm_keys.json - copy the .example). One connector-specific wrinkle: if you route this through a MiniMax connector and forward images, MiniMax rejects the image_detail: "auto" value with an HTTP 400 - the pack strips it for you, but if you're on MiniMax and images misbehave, set image_detail to low or high explicitly rather than leaving it on auto.

Common issues

Match the task to your actual pipeline. Picking t2v when you're rendering a still, or a video-editing task without forwarding a source, gives you a prompt shaped for the wrong job. Choose the task_type that matches what you're really generating.

Forward media for the editing tasks. The reference and edit tasks are far better when the LLM can see the source - that's the whole point of the source/reference_images inputs. Skip them and you're basically doing blind text-only rewriting under a task label.

Run errors are usually the connector. Confirm the LLM works with CheckLLMServiceConnectivity before digging into task settings.

Category๐Ÿ‘ MieNodes/๐Ÿ‘ Prompt Generator

Inputs (14)

NameTypeDefaultDescription
llm_service_connectorLLMServiceConnectorโ€”
task_typeCOMBOt2i - ๆ–‡็”Ÿๅ›พ13 options: t2i - ๆ–‡็”Ÿๅ›พ, t2v - ๆ–‡็”Ÿ่ง†้ข‘, i2i - ๅ›พๅƒ็ผ–่พ‘, r2i - ๅ‚่€ƒไธปไฝ“็”Ÿๅ›พ, ri2i (ๆ‰ฉๅฑ•) - ๅ‚่€ƒๅ›พๅผ•ๅฏผๅ›พๅƒ็ผ–่พ‘, i2v - ๅ›พ็”Ÿ่ง†้ข‘, +7
user_promptSTRINGโ€”
seedINT00โ€“18446744073709550000โ€”
sourceoptIMAGEโ€”
reference_imagesoptIMAGEโ€”
reference_videooptIMAGEโ€”
video_framesoptINT31โ€“16โ€”
reference_video_framesoptINT00โ€“16โ€”
image_detailoptCOMBOauto3 options: auto, low, high
temperatureoptFLOAT0.700โ€“2โ€”
top_poptFLOAT0.900โ€“1โ€”
max_tokensoptINT819264โ€“32768โ€”
timeoutoptCOMBO304 options: 30, 60, 120, 300

Outputs (1)

NameTypeDescription
bernini_promptSTRINGโ€”