Nodes/Nynxz H3/H3 Rewrite Prompt
ComfyUI Node

H3 Rewrite Prompt

Turn a one-liner into a proper H3 prompt, inside the graph

By Nynxz·Created about a month ago·Updated 25 days ago· 4
H3 Rewrite Prompt
  • first_frame
  • last_frame
  • prompt
  • reference_images
prompt
taskt2va
resolution16:9
duration10
system_prompt

H3 wants a lot from its prompts - a paced shot timeline, dialogue marks, a soundscape. Writing that by hand is the kind of thing you do twice before you wish a model would do it for you. H3 Rewrite Prompt is the graph-side half of exactly that: it builds the chat prompt that lightx2v's MiniMax-H3 prompt-rewriter LoRA was trained on, so an 8B model in your graph can turn "a cat burglar in a neon rainstorm" into a real H3 prompt.

How it works

This is the LLM-in-the-graph pattern done properly. The node renders three things, byte-for-byte matching what the adapter saw in training:

  1. the system prompt - vendored verbatim from the LoRA repo. Editing it isn't tuning, it's moving the rewriter off the distribution it learned, which is why system_prompt exists but the README says leave it empty.
  2. the task header - task is t2va (text only), i2va (first frame), l2va (last frame) or fl2va (both).
  3. the reference-frame placeholders - <|image_pad|> slots that bind images by position.

The outputs are prompt (already chat-templated, so Generate Text's template toggle can't interfere) and reference_images (the images in placeholder order). The position binding is the subtle part: the text encoder binds each <|image_pad|> to the next image in the batch, so the node ordering the images to match the placeholders is what keeps everything aligned. Two frames travel as one IMAGE batch, which is why fl2va scales last_frame onto first_frame when they differ.

The other inputs: resolution (default 16:9) and duration (4–15s - the rewriter paces the shot timeline to fit).

The workflow it plugs into

CLIPLoader (qwen3vl_8b, type: stable_diffusion)
  -> H3 CLIP LoRA        the rewriter LoRA, strength 1.0
  -> Generate Text       sampling_mode: off (greedy), max_length 2048-4096
       prompt <- H3 Rewrite Prompt.prompt
       image  <- H3 Rewrite Prompt.reference_images
  -> H3 Rewrite Clean    -> prompt for H3 Encode

You'll want ComfyUI-format LoRAs (nynxz's Qwen3-VL-8B-ComfyUI repo carries them) and a Qwen3-VL-8B text encoder. The honest caveat: ref2va is not supported by the rewriter adapter. H3 Encode can condition on references; this rewriter can't write the prompt for them. For reference-based work, write the prompt yourself.

Install

Pack install: ComfyUI Manager → "Nynxz H3", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Nynxz/ComfyUI-NynxzH3

Restart. Pure Python, no dependencies, ComfyUI 0.30.0+. The rewriter LoRA itself downloads separately from HuggingFace - nothing here bundles it.

The one-liner

Wire the prompt, the reference frames, a task and a duration, and this hands a small local model exactly the format it was trained to answer. Just remember the safety rule that applies to every LLM-in-the-graph node: read what a fresh pack does before you install it - this one is clean and open, but the category's been weaponized before.

CategoryNynxz/H3/Prompt

Inputs (7)

NameTypeDefaultDescription
promptSTRINGThe short request to rewrite.
taskCOMBOt2vat2va: text only. i2va: first frame. l2va: last frame. fl2va: both.
resolutionCOMBO16:9Target aspect. Upstream defaults to 16:9 for t2va and adaptive for the image-conditioned tasks.
durationINT104–15Target duration in seconds. The rewriter paces the shot timeline to fit it.
first_frameoptIMAGERequired by i2va and fl2va.
last_frameoptIMAGERequired by l2va and fl2va.
system_promptoptSTRINGOverrides the trained system prompt. Leave empty — the adapter was trained on the built-in one, and replacing it moves the rewriter off the format it learned.

Outputs (2)

NameTypeDescription
promptSTRINGAlready chat-templated, so Generate Text's use_default_template has no effect on it.
reference_imagesIMAGEIn placeholder order. None for t2va — leave it unwired.