home/ atoms/ t-index-list-timestep-selection

The t_index_list selects which diffusion timesteps to apply, controlling quality–speed trade-off

A full diffusion schedule has many timesteps (e.g., 50 with LCMScheduler). StreamDiffusion does not run all of them; instead, t_index_list specifies the indices of the timesteps to include. Fewer indices = fewer UNet calls = faster generation but coarser output. For img2img [32, 45] means two late-stage timesteps (lower noise level), preserving input structure. For txt2img [0, 16, 32, 45] starts from full noise. SD-Turbo uses [0] (single step). The indices are into scheduler.timesteps not raw noise levels, so their effect depends on the scheduler. The set of chosen timesteps becomes the sub-batch that stream-batch processes in parallel.

Examples

# img2img — 2 denoising steps, faster, keeps structure:
stream = StreamDiffusion(pipe, t_index_list=[32, 45])

# txt2img — 4 denoising steps, fuller synthesis:
stream = StreamDiffusion(pipe, t_index_list=[0, 16, 32, 45])

# SD-Turbo — 1 step, maximum speed:
stream = StreamDiffusion(pipe, t_index_list=[0])

Assessment

Given a LCMScheduler with num_inference_steps=50, calculate the noise level (scheduler.timesteps[32]) that t_index_list=[32] corresponds to. Then explain why adding an earlier timestep (e.g. index 0) to the list increases generation time but may improve txt2img quality.

“# make sub timesteps list based on the indices in the t_list list and the values in the timesteps list”
corpus · streamdiffusion-pipeline-for-real-time-interactive-image-gen · chunk 56