Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
182ea3a
Add LingBot-Video (Dense-1.3B) support with attention-only LoRA SFT
NancyFyong Jul 25, 2026
67bcd02
Add docs, prompt rewriting, LoRA validation, and low-VRAM example for…
NancyFyong Jul 26, 2026
55c8357
Add LingBot-Video MoE-30B-A3B support
NancyFyong Jul 27, 2026
df7ea8e
Address PR #1539 review: unify scheduler, restore VAE, split rewriter
NancyFyong Jul 27, 2026
5fbf50a
Fix low-VRAM fp32/bf16 dtype mismatch in LingBot-Video DiT
NancyFyong Jul 27, 2026
a9e7cc2
Fold normalize_caption into lingbot_video pipeline module
NancyFyong Jul 27, 2026
c62ea4f
Add normalize_caption to lingbot_video and fix importers
NancyFyong Jul 27, 2026
e83d7d6
Trim verbose comments in LingBot-Video code
NancyFyong Jul 27, 2026
038bad0
Merge lingbot_sft into lingbot_moe: apply PR #1539 review fixes to th…
NancyFyong Jul 27, 2026
3333443
Fix dtype mismatch feeding the fp32-pinned time_embedder
NancyFyong Jul 27, 2026
4ecc892
Add t2v_example_4 structured caption
NancyFyong Jul 27, 2026
0a107bb
Merge lingbot_sft into lingbot_moe (dtype fix + sample 4 prompt)
NancyFyong Jul 27, 2026
ea73e8b
Add TI2V (image-to-video) support to LingBot-Video pipeline
NancyFyong Jul 27, 2026
670ec22
Add text-to-image (t2i) support and example to LingBot-Video
NancyFyong Jul 27, 2026
8d8b7c7
Add ti2v/t2i low-VRAM inference + ti2v LoRA training examples
NancyFyong Jul 28, 2026
b2492dd
update vae&inner_func
mi804 Jul 27, 2026
a10c026
tmp commit for code refactor
mi804 Jul 27, 2026
94e8baa
low vram patch&refactor scripts
mi804 Jul 28, 2026
7caae83
remove fp32 cast to keep compatibility with low-vram-inference
mi804 Jul 28, 2026
5f604e2
add support for full train
mi804 Jul 28, 2026
cae44a0
style refactor
mi804 Jul 28, 2026
531ba56
pop changes for ti2v pipeline
mi804 Jul 28, 2026
4c9ee93
Align TI2V / T2I examples, LoRA + full training, docs and README with…
NancyFyong Jul 28, 2026
5fa49f5
fix: manage Qwen3-VL vision tower in LingBotVideoTextEncoder VRAM map
NancyFyong Jul 28, 2026
56334bf
style: group input_image under image-to-video in pipeline __call__
NancyFyong Jul 28, 2026
7d0852e
refactor: move TI2V helpers into the units that use them
NancyFyong Jul 28, 2026
91fcb94
Merge lingbot_sft into lingbot_moe: integrate TI2V/T2I + full trainin…
NancyFyong Jul 28, 2026
5bc41d2
style: strip comments and align MoE-30B-A3B integration with repo con…
NancyFyong Jul 29, 2026
eed0d72
style: align MoE examples with the Dense inference examples
NancyFyong Jul 29, 2026
b4aec8c
feat: add TI2V / T2I MoE-30B-A3B examples and load captions from the …
NancyFyong Jul 29, 2026
9476867
fix: restore every DiT parameter under low-VRAM offload for the MoE map
NancyFyong Jul 29, 2026
ce0e732
Merge upstream main (LingBot-Video Dense-1.3B, #1539) into the MoE br…
NancyFyong Jul 30, 2026
823fae0
fix: point the MoE examples at the published Dense example-dataset di…
NancyFyong Jul 30, 2026
7bd0ad8
refactor: drop the resolve_bulk_dtype helper from the MoE DiT
NancyFyong Jul 30, 2026
44c506b
fix: cast the MoE router and expert weights inside the model under of…
NancyFyong Jul 30, 2026
c2e4975
feat: add LoRA and full-parameter training examples for MoE-30B-A3B
NancyFyong Jul 30, 2026
3cfbbf1
style: align the MoE accelerate config with the 14B training config
NancyFyong Jul 30, 2026
e0ce129
feat: support the LingBot-Video MoE refiner for two-stage high-resolu…
NancyFyong Jul 30, 2026
cf6dd4d
Merge remote-tracking branch 'origin/main' into lingbot_refiner
NancyFyong Aug 10, 2026
a4387c9
style: drop the '# --- Stage N' decorative separators from refiner ex…
NancyFyong Aug 10, 2026
0131131
review: address PR #1546 comments
NancyFyong Aug 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,8 @@ Example code for LingBot-Video is available at: [/examples/lingbot_video/](/exam
|[Robbyant/lingbot-video-moe-30b-a3b: T2V](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_t2v.py)|[code](/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_t2v.py)|[code](/examples/lingbot_video/model_training/full/lingbot-video-moe-30b-a3b_t2v.sh)|[code](/examples/lingbot_video/model_training/validate_full/lingbot-video-moe-30b-a3b_t2v.py)|[code](/examples/lingbot_video/model_training/lora/lingbot-video-moe-30b-a3b_t2v.sh)|[code](/examples/lingbot_video/model_training/validate_lora/lingbot-video-moe-30b-a3b_t2v.py)|
|[Robbyant/lingbot-video-moe-30b-a3b: TI2V](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_ti2v.py)|[code](/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_ti2v.py)|[code](/examples/lingbot_video/model_training/full/lingbot-video-moe-30b-a3b_ti2v.sh)|[code](/examples/lingbot_video/model_training/validate_full/lingbot-video-moe-30b-a3b_ti2v.py)|[code](/examples/lingbot_video/model_training/lora/lingbot-video-moe-30b-a3b_ti2v.sh)|[code](/examples/lingbot_video/model_training/validate_lora/lingbot-video-moe-30b-a3b_ti2v.py)|
|[Robbyant/lingbot-video-moe-30b-a3b: T2I](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_t2i.py)|[code](/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_t2i.py)|-|-|-|-|
|[Robbyant/lingbot-video-moe-30b-a3b: T2V + Refinement](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_t2v_refiner.py)|[code](/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_t2v_refiner.py)|-|-|-|-|
|[Robbyant/lingbot-video-moe-30b-a3b: TI2V + Refinement](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_ti2v_refiner.py)|[code](/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_ti2v_refiner.py)|-|-|-|-|

</details>

Expand Down
2 changes: 2 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,8 @@ LingBot-Video 的示例代码位于:[/examples/lingbot_video/](/examples/lingb
|[Robbyant/lingbot-video-moe-30b-a3b: T2V](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_t2v.py)|[code](/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_t2v.py)|[code](/examples/lingbot_video/model_training/full/lingbot-video-moe-30b-a3b_t2v.sh)|[code](/examples/lingbot_video/model_training/validate_full/lingbot-video-moe-30b-a3b_t2v.py)|[code](/examples/lingbot_video/model_training/lora/lingbot-video-moe-30b-a3b_t2v.sh)|[code](/examples/lingbot_video/model_training/validate_lora/lingbot-video-moe-30b-a3b_t2v.py)|
|[Robbyant/lingbot-video-moe-30b-a3b: TI2V](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_ti2v.py)|[code](/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_ti2v.py)|[code](/examples/lingbot_video/model_training/full/lingbot-video-moe-30b-a3b_ti2v.sh)|[code](/examples/lingbot_video/model_training/validate_full/lingbot-video-moe-30b-a3b_ti2v.py)|[code](/examples/lingbot_video/model_training/lora/lingbot-video-moe-30b-a3b_ti2v.sh)|[code](/examples/lingbot_video/model_training/validate_lora/lingbot-video-moe-30b-a3b_ti2v.py)|
|[Robbyant/lingbot-video-moe-30b-a3b: T2I](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_t2i.py)|[code](/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_t2i.py)|-|-|-|-|
|[Robbyant/lingbot-video-moe-30b-a3b: T2V + Refinement](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_t2v_refiner.py)|[code](/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_t2v_refiner.py)|-|-|-|-|
|[Robbyant/lingbot-video-moe-30b-a3b: TI2V + Refinement](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_ti2v_refiner.py)|[code](/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_ti2v_refiner.py)|-|-|-|-|

</details>

Expand Down
25 changes: 24 additions & 1 deletion diffsynth/diffusion/flow_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class FlowMatchScheduler():

def __init__(self, template: Literal["FLUX.1", "Wan", "Qwen-Image", "FLUX.2", "Z-Image", "LTX-2", "Qwen-Image-Lightning", "ERNIE-Image", "ACE-Step", "Ideogram4", "Krea-2", "Boogu", "MiniMax-H3"] = "FLUX.1"):
def __init__(self, template: Literal["FLUX.1", "Wan", "Qwen-Image", "FLUX.2", "Z-Image", "LTX-2", "Qwen-Image-Lightning", "ERNIE-Image", "ACE-Step", "Ideogram4", "Krea-2", "Boogu", "MiniMax-H3", "LingBot-Video"] = "FLUX.1"):
self.set_timesteps_fn = {
"FLUX.1": FlowMatchScheduler.set_timesteps_flux,
"Wan": FlowMatchScheduler.set_timesteps_wan,
Expand All @@ -21,6 +21,7 @@ def __init__(self, template: Literal["FLUX.1", "Wan", "Qwen-Image", "FLUX.2", "Z
"Krea-2": FlowMatchScheduler.set_timesteps_krea2,
"Boogu": FlowMatchScheduler.set_timesteps_boogu,
"MiniMax-H3": FlowMatchScheduler.set_timesteps_minimax_h3,
"LingBot-Video": FlowMatchScheduler.set_timesteps_lingbot_video,
}.get(template, FlowMatchScheduler.set_timesteps_flux)
self.num_train_timesteps = 1000

Expand Down Expand Up @@ -80,6 +81,28 @@ def set_timesteps_qwen_image(num_inference_steps=100, denoising_strength=1.0, ex
timesteps = sigmas * num_train_timesteps
return sigmas, timesteps

@staticmethod
def set_timesteps_lingbot_video(num_inference_steps=100, denoising_strength=1.0, shift=None, t_thresh=None, sigma_tail_steps=0):
sigma_min = 0.0
sigma_max = 1.0
shift = 5 if shift is None else shift
num_train_timesteps = 1000
sigma_start = sigma_min + (sigma_max - sigma_min) * denoising_strength
sigmas = torch.linspace(sigma_start, sigma_min, num_inference_steps + 1)[:-1]
sigmas = shift * sigmas / (1 + (shift - 1) * sigmas)
if t_thresh is not None:
# Refinement schedule: keep the sub-threshold part of the shifted grid, pin the first
# sigma exactly at t_thresh, then append extra low-noise steps that end at sigma_min.
sigmas = sigmas[sigmas <= t_thresh + 1e-6]
if sigmas.numel() == 0 or abs(float(sigmas[0]) - t_thresh) > 1e-6:
sigmas = torch.cat([torch.tensor([t_thresh], dtype=sigmas.dtype), sigmas])
if sigma_tail_steps > 0:
tail_start = float(sigmas[-1])
tail = torch.linspace(tail_start, min(sigma_min, tail_start), sigma_tail_steps + 2)[1:-1]
sigmas = torch.cat([sigmas, tail.to(dtype=sigmas.dtype)])
timesteps = sigmas * num_train_timesteps
return sigmas, timesteps

@staticmethod
def set_timesteps_qwen_image_lightning(num_inference_steps=100, denoising_strength=1.0, exponential_shift_mu=None, dynamic_shift_len=None):
sigma_min = 0.0
Expand Down
19 changes: 13 additions & 6 deletions diffsynth/pipelines/lingbot_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, device=get_device_type(), torch_dtype=torch.bfloat16):
height_division_factor=16, width_division_factor=16,
time_division_factor=4, time_division_remainder=1,
)
self.scheduler = FlowMatchScheduler(template="Wan")
self.scheduler = FlowMatchScheduler(template="LingBot-Video")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to the scheduler also affect the existing Dense and MoE models. Please make sure that both models can still generate videos correctly after these changes.

self.text_encoder: Krea2TextEncoder = None
self.dit: LingBotVideoDiT = None
self.vae: QwenImageVAE = None
Expand Down Expand Up @@ -102,11 +102,17 @@ def __call__(
# Scheduler
num_inference_steps: int = 40,
sigma_shift: float = 3.0,
# High-Resolution Refinement
t_thresh: float = None,
sigma_tail_steps: int = 2,
# progress_bar
progress_bar_cmd=tqdm,
):
# Scheduler
self.scheduler.set_timesteps(num_inference_steps, denoising_strength=denoising_strength, shift=sigma_shift)
self.scheduler.set_timesteps(
num_inference_steps, denoising_strength=denoising_strength, shift=sigma_shift,
t_thresh=t_thresh, sigma_tail_steps=sigma_tail_steps,
)

# Inputs
inputs_posi = {"prompt": prompt}
Expand All @@ -116,7 +122,7 @@ def __call__(
"input_video": input_video, "denoising_strength": denoising_strength,
"seed": seed, "rand_device": rand_device,
"height": height, "width": width, "num_frames": num_frames,
"cfg_scale": cfg_scale,
"cfg_scale": cfg_scale, "t_thresh": t_thresh,
}
for unit in self.units:
inputs_shared, inputs_posi, inputs_nega = self.unit_runner(unit, self, inputs_shared, inputs_posi, inputs_nega)
Expand Down Expand Up @@ -197,12 +203,12 @@ class LingBotVideoUnit_ImageEmbedder(PipelineUnit):

def __init__(self):
super().__init__(
input_params=("input_image", "latents", "height", "width"),
input_params=("input_image", "latents", "height", "width", "t_thresh"),
output_params=("latents", "first_frame_latents", "vlm_image"),
onload_model_names=("vae",),
)

def process(self, pipe: LingBotVideoPipeline, input_image, latents, height, width):
def process(self, pipe: LingBotVideoPipeline, input_image, latents, height, width, t_thresh=None):
if input_image is None:
return {}
pipe.load_models_to_device(self.onload_model_names)
Expand All @@ -211,7 +217,8 @@ def process(self, pipe: LingBotVideoPipeline, input_image, latents, height, widt
pixel = self.preprocess_cond_image(input_image, height, width)
pixel = pixel.to(dtype=pipe.torch_dtype, device=pipe.device)
first_frame_latents = pipe.vae.encode_video(pixel * 2.0 - 1.0).to(dtype=pipe.torch_dtype, device=pipe.device)
vlm_image = self.vlm_image(pipe, pixel)
# The refiner conditions on text only and re-pins the frame-0 latent every step instead.
vlm_image = None if t_thresh is not None else self.vlm_image(pipe, pixel)
# Pin the clean condition latent into the first temporal slot before sampling.
cond_t = first_frame_latents.shape[2]
latents[:, :, :cond_t] = first_frame_latents
Expand Down
25 changes: 25 additions & 0 deletions docs/en/Model_Details/LingBot-Video.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ save_video(video, "video.mp4", fps=15, quality=10)

## Model Overview

MoE-30B-A3B is the larger variant: 30B total parameters with ~3B active per token, where each MoE layer holds 128 routed experts plus 1 shared expert and routes every token to 8 experts with group-limited top-k (4 groups, top-2 groups). It serves the same three tasks through the same pipeline, only the model ID and the shard glob change.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model overview table should not include additional explanatory notes. If necessary, a brief description can be added to the example script instead. In most cases, users can find the relevant technical details through the model link, so there is no need to over-explain the technical approach in the documentation.


|Model ID|Inference|Low VRAM Inference|Full Training|Full Training Validation|LoRA Training|LoRA Training Validation|
|-|-|-|-|-|-|-|
|[Robbyant/lingbot-video-dense-1.3b: T2V](https://modelscope.cn/models/Robbyant/lingbot-video-dense-1.3b)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference/lingbot-video-dense-1.3b_t2v.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference_low_vram/lingbot-video-dense-1.3b_t2v.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/full/lingbot-video-dense-1.3b_t2v.sh)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/validate_full/lingbot-video-dense-1.3b_t2v.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/lora/lingbot-video-dense-1.3b_t2v.sh)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/validate_lora/lingbot-video-dense-1.3b_t2v.py)|
Expand All @@ -78,6 +80,8 @@ save_video(video, "video.mp4", fps=15, quality=10)
|[Robbyant/lingbot-video-moe-30b-a3b: T2V](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_t2v.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_t2v.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/full/lingbot-video-moe-30b-a3b_t2v.sh)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/validate_full/lingbot-video-moe-30b-a3b_t2v.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/lora/lingbot-video-moe-30b-a3b_t2v.sh)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/validate_lora/lingbot-video-moe-30b-a3b_t2v.py)|
|[Robbyant/lingbot-video-moe-30b-a3b: TI2V](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_ti2v.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_ti2v.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/full/lingbot-video-moe-30b-a3b_ti2v.sh)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/validate_full/lingbot-video-moe-30b-a3b_ti2v.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/lora/lingbot-video-moe-30b-a3b_ti2v.sh)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_training/validate_lora/lingbot-video-moe-30b-a3b_ti2v.py)|
|[Robbyant/lingbot-video-moe-30b-a3b: T2I](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_t2i.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_t2i.py)|-|-|-|-|
|[Robbyant/lingbot-video-moe-30b-a3b: T2V + Refinement](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_t2v_refiner.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_t2v_refiner.py)|-|-|-|-|
|[Robbyant/lingbot-video-moe-30b-a3b: TI2V + Refinement](https://modelscope.cn/models/Robbyant/lingbot-video-moe-30b-a3b)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference/lingbot-video-moe-30b-a3b_ti2v_refiner.py)|[code](https://github.com/modelscope/DiffSynth-Studio/blob/main/examples/lingbot_video/model_inference_low_vram/lingbot-video-moe-30b-a3b_ti2v_refiner.py)|-|-|-|-|

## Model Inference

Expand All @@ -96,12 +100,33 @@ The input parameters for `LingBotVideoPipeline` inference include:
* `cfg_scale`: Classifier-free guidance scale, default `3.0`.
* `num_inference_steps`: Number of inference steps, default `40`.
* `sigma_shift`: Flow-matching timestep shift, default `3.0`.
* `t_thresh`: Refinement start sigma, default `None` (plain generation). When set, the schedule is truncated so that sampling starts at `sigma=t_thresh` and `input_video` is noised to exactly that level. Only meaningful together with `input_video`; TI2V additionally re-pins the clean first-frame latent after every step. The official refiner setting is `0.85`.
* `sigma_tail_steps`: Number of extra low-noise steps appended to the tail of the refinement schedule, default `2`. Only effective when `t_thresh` is set.
* `seed`: Random seed. Default is `None`, meaning completely random.
* `rand_device`: Device for generating the initial noise, default `"cpu"`.
* `progress_bar_cmd`: Progress bar, default `tqdm`. Can be disabled by setting to `lambda x: x`.

If VRAM is insufficient, please enable [VRAM Management](../Pipeline_Usage/VRAM_management.md). We provide recommended low-VRAM configurations for each task in the example code, see the table in the "Model Overview" section above.

### Two-stage refinement

The MoE refiner performs a short second pass at a higher resolution: the official setup generates at 480×832 with 40 steps, then refines at 1088×1920 with 8 steps. Load the pipeline with the `refiner/` shards instead of `transformer/`, feed the base clip back in through `input_video` at the higher resolution, and set `t_thresh`:

```python
input_video = VideoData("video_base.mp4", height=1088, width=1920)
video = pipe(
prompt=caption,
negative_prompt=pipe.default_negative_prompt,
input_video=input_video,
height=1088, width=1920, num_frames=81,
num_inference_steps=8, cfg_scale=3.0,
t_thresh=0.85, sigma_tail_steps=2,
seed=0,
)
```

The upscaled clip is VAE-encoded and noised back to `sigma=t_thresh`, so the pass keeps the structure of the base clip and regenerates detail at the target resolution. Pass the same caption as the base pass and keep the same aspect ratio. The refinement resolution dominates the cost — at 1088×1920 the sequence is ~5× longer than at 480×832 — so run this pass with VRAM management enabled.

### Prompt rewriting

LingBot-Video is trained on **structured-JSON captions**, not free-form prose. Feeding a flat sentence is out-of-distribution and visibly degrades quality. The pipeline accepts a caption as a `dict` (the format used at training time) or a plain string, and normalises the `dict` internally.
Expand Down
Loading