Nodes/ComfyUI-STARFlow/STARFlow-V Text Encode
ComfyUI Node

STARFlow-V Text Encode

The prompt wrapper that decides 'video' vs 'image'

By RyukoMatoiFan·Created 8 months ago·Updated 2 months ago· 0
STARFlow-V Text Encode
  • text_encoder
  • conditioning
prompt
fps16
noise_std0.50
aspect_ratio1:1

Text encoders are usually the least interesting node in a workflow, and then one like this shows up and you realize the prompt is doing a lot more work than you thought. STARFlowVTextEncode doesn't just encode your text - it wraps it in STARFlow-V's exact prompt protocol, and that wrapper is how the model knows whether it's making a video at all.

The mechanism: prompt wrapping in three steps

Apple's reference pipeline (ported verbatim here, per the pack's docstring) rewrites your prompt in a fixed order before encoding:

  1. FPS wrap - if fps > 0, your text becomes A video with 16 fps:\n{prompt}\n. Set fps to 0 and it becomes An image:\n{prompt}\n instead - yes, this one node can encode an image prompt too.
  2. Noise prepend - Noise Level {int(noise_std*1000)}:\n..., so with the default 0.5 you get Noise Level 500:. The model conditions on how noisy the starting latent is.
  3. Aspect append - ... in a 16:9 aspect ratio.\n.

Then the node encodes your prompt and an empty-string unconditional caption through the same wrapper, with the same fps/noise_std/aspect_ratio metadata, so the sampler has a proper CFG negative half. It even offloads the encoder back to CPU after encoding, which is a thoughtful touch on a 7B-video workflow.

The inputs

  • text_encoder - the STARFLOW_V_TEXT_ENCODER from STARFlowVTextEncoderLoader.
  • prompt - your text. Multiline, unlabeled style rules; describe the motion, the camera, the scene.
  • fps - default 16, matching the released profile (81 frames @ 16 FPS ≈ 5 seconds). This isn't cosmetic metadata; it's literally injected into the prompt string.
  • noise_std - default 0.5, the noise level the model conditions on.
  • aspect_ratio - nine options: 1:1, 2:3, 3:2, 16:9, 9:16, 4:5, 5:4, 21:9, 9:21. Pick the one that matches your sampler's width/height, or the conditioning and canvas disagree.

Output is conditioning (STARFLOW_V_CONDITIONING), which feeds STARFlowVSampler.

Installation

Shared pack install - same as every node in the suite:

cd ComfyUI/custom_nodes
git clone https://github.com/RyukoMatoiFan/ComfyUI-STARFlow
pip install -r ComfyUI-STARFlow/requirements.txt
# restart ComfyUI

The heavier setup is upstream: the STARFlowVTextEncoderLoader needs a full local FLAN-T5-XL directory, and that's covered in its own article.

Gotchas

The subtle one is aspect ratio drift. STARFlowVTextEncode bakes the ratio into the conditioning text, but the sampler takes its own width/height inputs - nothing validates they match. Run 16:9 in the encoder with 1:1 dimensions in the sampler and you'll get a video that's confused about what it should look like. Keep them in sync. Also remember fps is text, not a setting: crank it to 60 and the prompt says "a video with 60 fps" but the actual frame count still comes from num_frames in the sampler. Say the same thing in both places, or the model gets mixed signals.

CategorySTARFlow-V

Inputs (5)

NameTypeDefaultDescription
text_encoderSTARFLOW_V_TEXT_ENCODER
promptSTRING
fpsINT161–60
noise_stdFLOAT0.500–2
aspect_ratioCOMBO1:19 options: 1:1, 2:3, 3:2, 16:9, 9:16, 4:5, +3

Outputs (1)

NameTypeDescription
conditioningSTARFLOW_V_CONDITIONING