Nodes/ComfyUI-HY-Motion1/HY-Motion Rewrite Prompt
ComfyUI Node

HY-Motion Rewrite Prompt

Say it in plain English, let the LLM make it animatable

By jtydhr88·Created 8 months ago·Updated 5 days ago· 307
HY-Motion Rewrite Prompt
  • prompter
  • rewritten_text
  • duration
textA person is walking forward.

You type "guy walks in a circle and waves." This node returns a standardized English motion description and a sensible duration for it, and both feed the rest of the pipeline. It's the pack's recommended first step for a reason: HY-Motion's Qwen encoder is smart, but the Text2MotionPrompter LLM that drives this node is trained to translate sloppy human motion descriptions into the exact phrasing and timing a motion model expects. You skip it at the cost of writing more careful prompts yourself.

Mechanically it's a one-shot LLM call. Your text goes into the prompter (loaded by HY-Motion Load Prompter), which is asked to reply with JSON containing a duration measured in frames and a cleaned-up short_caption. The node parses that, converts frames to seconds (duration / 30), and hands you:

  • rewritten_text - the optimized English motion description. Wire it into HY-Motion Encode Text's text input.
  • duration - an estimated length in seconds. Wire it into HY-Motion Generate's duration input.

That wiring is the whole point: it's the only node in the pack that outputs a float you're supposed to feed straight into Generate, and it solves the "how long should this motion be" question you'd otherwise guess at. Chinese input works - the prompter understands it and the output is standardized English either way.

The two inputs

  • prompter - from Load Prompter. That's it for the heavy lifting.
  • text - multiline, defaults to "A person is walking forward." This is the only thing you actually edit, and it's where being casual is fine: "runs and then stops" is exactly the input this node was built to clean up.

Reading its failure modes

The telltale sign something's wrong is the output. If rewritten_text comes back identical to your input and duration is exactly 5.0, the node hit its fallback path - the prompter either didn't load (the "auto download" trap, see Load Prompter) or returned unparseable JSON. It quietly returns your original text rather than crashing, which is polite but easy to miss, and it means your workflow just ran without the rewrite you thought you had. Check the console for the prompter's raw response and the "[Prompter] JSON parse failed" line.

A subtler point: this node is the pack's most LLM-y component, and LLM prompt rewriting drifts. If the rewritten caption adds action you didn't ask for, that's the enhancer inventing narrative - the known failure mode of this whole class of node. For motion it's usually harmless (a little more walking before the wave), but if it consistently hallucinates choreography you don't want, feed this node more specific prompts and treat its output as a suggestion you can route around.

Where it sits

Full recommended graph: Load Prompter → this node → (rewritten_text → Encode Text, duration → Generate), with Load LLM and Load Network on their usual rails. If you're on a tight VRAM budget, enable offload_to_cpu on the Load Prompter - this is the model the README explicitly says is fine to run on CPU while the encoder stays on the GPU. The rewrite takes a few seconds longer; the card stays happy.

CategoryHY-Motion/Conditioning

Inputs (2)

NameTypeDefaultDescription
prompterHYMOTION_PROMPTER
textSTRINGA person is walking forward.

Outputs (2)

NameTypeDescription
rewritten_textSTRING
durationFLOAT