Nodes/Lance-3B AIO/Lance Loader
ComfyUI Node

Lance Loader

The node that bolts your LLM and vision encoder together into Lance

By SteveImmanuel·Created 4 months ago·Updated 3 months ago· 8
Lance Loader
  • model_args
  • inference_args
  • qwen2_causal_lm
  • vit
  • vit_config
  • LANCE
ckpt_dir

Lance Loader is where the pieces become the model. The Qwen 2 Causal LM Loader and the ViT Loader each load a chunk of Lance's brain, but a chunk is not a model - Lance Loader is the node that actually assembles them into the LANCE object every generation and understanding node needs.

Lance is ByteDance's 3B-active (roughly 9B total, MoE) Apache 2.0 model for unified image/video generation, editing, and understanding. It's structured as a language model plus a vision encoder plus some glue - VAE-to-LLM and LLM-to-VAE connectors, latent position embeddings, a time embedder - that only make sense as one unit. That glue is what this node reads from disk and fuses with the already-loaded language model.

What goes in

  • ckpt_dir - a string path to the Lance checkpoint folder (Lance_3B/ for image-ish tasks, Lance_3B_Video/ for video-ish ones). You usually take this straight from the LANCE_CKPT_DIR string output of Lance Args. The node reads model.safetensors from that folder.
  • model_args / inference_args - the config objects from Lance Args. They tell the loader what the model structure is: latent patch size, max frames, max latent size, whether the vision encoder should be attached.
  • qwen2_causal_lm - the language model object from the Qwen 2 Causal LM Loader. This is the big MoE LLM, already loaded with its own patcher for low-VRAM streaming.
  • vit / vit_config (optional) - the vision encoder and its config from the ViT Loader. You need them for understanding tasks and for any task where the model must look at an input image or video. Text-only generation can skip them.

What comes out

One output: LANCE - the fully-assembled model, ready for Lance Configure. Note it's not a raw ComfyUI model type like MODEL; it's the pack's own custom type, so it only plugs into this pack's nodes. Expect that - this is a self-contained port of a research codebase, not something designed to interoperate with standard KSamplers.

How it works

The loader builds a LanceConfig from your args (which is where those values you set in Lance Args actually get consumed - max frames, latent patch size, timestep shift, whether the ViT is in the loop), constructs the Lance wrapper around the language model and optional vision encoder, then loads model.safetensors and pulls out everything that isn't prefixed language_model. or vit_model. - i.e. the connector and embedding glue - and loads that into the wrapper. The language model and ViT weights themselves stay in the objects the other loaders already created, because they were loaded with their own memory management for offloading. If the state dict doesn't match expectations it logs a warning rather than dying, which keeps you from a hard crash but is worth reading in the console.

Installing the pack

This node is part of comfyui-lance-aio, so install 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 too. You then need the Lance checkpoints from bytedance-research/Lance under ComfyUI/models/lance/, and - this is the part people underestimate - the llm_config.json inside the checkpoint folder is load-bearing here. The loader reads it to size the language model, so if you've moved or renamed files inside the checkpoint folder, this node is where it surfaces. Restart ComfyUI after cloning and you'll find the Lance nodes in their own category.

Troubleshooting

If you get a state-dict mismatch warning here, it usually means the checkpoint folder doesn't match what the port expects - a partial download, or a mix of the image and video checkpoints. Redownload the right folder for your task. And if the loader complains it can't find model.safetensors, check that ckpt_dir points at the inner checkpoint folder (.../models/lance/Lance_3B), not at .../models/lance.

CategoryLance

Inputs (6)

NameTypeDefaultDescription
ckpt_dirSTRING
model_argsMODEL_ARGS
inference_argsINFERENCE_ARGS
qwen2_causal_lmQWEN_2_CAUSAL_LM
vitoptVIT
vit_configoptVIT_CONFIG

Outputs (1)

NameTypeDescription
LANCELANCE