Nodes/Lance-3B AIO/Lance Text Prompt
ComfyUI Node

Lance Text Prompt

The plain-text prompt node for Lance generation

By SteveImmanuel·Created 4 months ago·Updated 3 months ago· 8
Lance Text Prompt
  • data_config
  • tokenizer
  • new_token_ids
  • DATA_LOADER
prompt

Lance Text Prompt is the most boring node in the comfyui-lance-aio pack, and that's a compliment. It takes a prompt, wraps it into the format Lance expects, and hands the pack's generation node a ready-to-run batch. If your task is text-to-image or text-to-video - no reference image, no input video - this is the node you want. It's the text-only member of the pack's trio of prompt nodes.

Lance itself is ByteDance's 3B-active Apache 2.0 model that does image and video generation, editing, and understanding in one architecture. The pack is an unofficial ComfyUI port of the official codebase. That matters here because the prompt node is basically the clean-room version of the official pipeline's dataset step: your text gets tokenized, batched, and converted into a DATA_LOADER that the Lance Generation node runs its denoising loop over.

The inputs that matter

  • prompt - the only one you set by hand. It's a multiline string, so write normally, in plain language. No Danbooru-tag soup required; Lance understands natural language and even does reasonably well at logical reasoning in a prompt (the "a cat and a dog taking a selfie" example workflow is a good baseline to test). For video, describe motion and scene over time - "a slow pan across a snowy cabin" - rather than a static scene.
  • data_config - from Lance Args. It tells the pipeline what task, resolution, frame count, and text-template settings to use.
  • tokenizer - from the Lance Tokenizer Loader.
  • new_token_ids - from Lance Configure.

Three of four inputs are wires, not knobs. If you're copying the example workflow, you'll set the prompt and leave the rest alone.

What comes out

One DATA_LOADER output, feeding straight into Lance Generation. The output type is the pack's own, so it won't connect to anything else - that's by design. There's no preview here; the node does its work invisibly.

How it works

Mechanically, the node writes your prompt into a temporary JSONL record, then runs it through the same ValidationDataset the official ByteDance codebase uses, tokenized with the Qwen2 tokenizer and wrapped in a DataLoader with a batch size of one. The text_template flag you set in Lance Args decides whether the prompt gets wrapped in Lance's system-prompt template before tokenization. Keep it on unless you have a reason not to; the model was trained expecting the template.

Installing the pack

This node ships with the whole pack:

cd ComfyUI/custom_nodes
git clone https://github.com/SteveImmanuel/comfyui-lance-aio
cd comfyui-lance-aio
pip install -r requirements.txt

ComfyUI Manager finds it as comfyui-lance-aio. Then grab the Lance checkpoints from bytedance-research/Lance into ComfyUI/models/lance/ and restart ComfyUI. The requirements pin transformers>=4.50.3,<5, which is the pack's single most important dependency constraint - the official Lance code won't run on transformers 5.

Troubleshooting

The classic beginner stumble is pairing this node with a task that wants media. If your Lance Args task is i2v or image_edit, the graph needs the image prompt node (Lance Text Image Prompt), and the generation node will error out if it doesn't get the right kind of data loader. Similarly, a task of x2t_image (understanding) with this text-only node won't fly - understanding needs the image or video prompt variant. Task, prompt node, and output node must agree. When they don't, the error surfaces at the output stage, so read it carefully; it usually names the task it expected.

CategoryLance

Inputs (4)

NameTypeDefaultDescription
promptSTRING
data_configDATA_CONFIG
tokenizerTOKENIZER
new_token_idsNEW_TOKEN_IDS

Outputs (1)

NameTypeDescription
DATA_LOADERDATA_LOADER