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

Lance Generation

The node that turns latents into pixels

By SteveImmanuel·Created 4 months ago·Updated 3 months ago· 8
Lance Generation
  • model_args
  • inference_args
  • data_loader
  • lance
  • new_token_ids
  • qwen2_causal_lm
  • vae
  • vit
  • IMAGE

Lance Generation is the payoff node of the comfyui-lance-aio pack. Everything upstream - the config, the loaders, the prompt node - exists to feed this one thing. It takes the fully-assembled Lance model plus your prompt's data loader and runs the denoising loop, then decodes the result into an image you can actually save. It's an output node, so it's the end of the line for every generation task: text-to-image, text-to-video, image-to-video, and image/video editing.

If you're coming from a normal ComfyUI image workflow, the weird part is that there's no KSampler here. Lance is an autoregressive/diffusion hybrid under the hood - ByteDance's research model that unifies generation and understanding in one 3B-active architecture - so the sampler settings live back in the Lance Args node (validation_num_timesteps, validation_timestep_shift, cfg_text_scale), not on the output node. You steer generation from the Args node and treat this node as the sink.

What goes in

It's the most heavily-wired node in the graph, but most inputs are just relayed from upstream:

  • model_args, inference_args, lance, new_token_ids, qwen2_causal_lm - the config objects, the assembled model, and the language model, all from the loaders and Lance Configure.
  • data_loader - the DATA_LOADER from one of the three prompt nodes (Lance Text Prompt, Lance Text Image Prompt, or Lance Text Video Prompt). This carries your actual prompt plus any reference image/video and the task's data config.
  • vae - from the WAN VAE Loader. Lance generates into Wan-style latents (the model was built around Alibaba's Wan 2.2 VAE, 16× spatial / 4× temporal downsampling), and this node decodes them back to pixels with it.
  • vit (optional) - the vision encoder. You need it for image-to-video and edit tasks, where the model has to actually look at your input image or video; text-to-image and text-to-video can run without it.

What comes out

A single IMAGE tensor. Feed it straight into a Save Image node for a still, or into a video-save node if your task produced frames. For video tasks the frames come out concatenated as one batch, so you're one step away from an mp4.

How it works, briefly

The node moves the Lance glue modules onto the GPU, loads the patchers for the language model (and ViT, if present), and runs Lance's validation generation - either the KV-cache path or the plain path, depending on the use_KVcache flag from Lance Args. Then it hands the resulting latents to the VAE for decode. One nice touch for low-VRAM setups: after the denoising pass it unloads the big language model before decoding, so the decode phase doesn't need to keep a 20GB model resident just to produce pixels. That's very much in the spirit of this pack, which exists to run Lance on cards with 12GB (or even 8GB) of VRAM via weight streaming.

Installing the pack

The node ships with the pack, so:

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

or search comfyui-lance-aio in ComfyUI Manager. Grab the Lance checkpoints from bytedance-research/Lance into ComfyUI/models/lance/ and restart. Note the checkpoint files are FP32 and large - the video checkpoint is north of 25GB on disk, so budget disk space. The community has been grumbling about that since the model dropped, and quantized conversions are the standing fix.

Where people get burned

Picking a task in Lance Args that doesn't match the prompt node. If Lance Args says t2i but you feed it a text-image prompt node, generation raises an error ("task is not a generation task" is the giveaway when it happens for understanding tasks). The task, the prompt node, and the output node all have to agree - that's the one wiring rule this pack is strict about.

CategoryLance

Inputs (8)

NameTypeDefaultDescription
model_argsMODEL_ARGS
inference_argsINFERENCE_ARGS
data_loaderDATA_LOADER
lanceLANCE
new_token_idsNEW_TOKEN_IDS
qwen2_causal_lmQWEN_2_CAUSAL_LM
vaeVAE
vitoptVIT

Outputs (1)

NameTypeDescription
IMAGEIMAGE