MCPcopy Create free account

hub / github.com/NVlabs/Sana / functions

Functions2,606 in github.com/NVlabs/Sana

↓ 2 callersMethod_build_frame_token_mask
Convert frame-valid mask to token mask shaped ``(B, N, 1)``.
diffusion/model/nets/sana_multi_scale_video_camctrl.py:271
↓ 2 callersMethod_build_model
(self, model_path: str | Path)
inference_video_scripts/wm/inference_sana_wm.py:952
↓ 2 callersMethod_build_vae
(self)
inference_video_scripts/wm/inference_sana_wm.py:929
↓ 2 callersMethod_capture_block_kv
Run one forward at σ=0 with capture hooks; return per-layer (K, V). ``capture_mode='pre_rope'`` uses the ``_kv_cache_capture`` hook (stored
diffusion/refiner/diffusers_ltx2_refiner.py:557
↓ 2 callersFunction_capture_streaming_self_attention_kv
Capture the current layer self-attention K/V without computing attention output.
diffusion/refiner/diffusers_ltx2_refiner.py:1595
↓ 2 callersFunction_collect_captured_kv_from_blocks
( transformer: nn.Module, mode: str, layer_mask: list[bool] | None = None, )
diffusion/refiner/diffusers_ltx2_refiner.py:1854
↓ 2 callersFunction_collect_sample_frames
(pixel_np: np.ndarray, frame_base: int)
inference_video_scripts/wm/streaming_pipeline.py:330
↓ 2 callersMethod_combine_without_prefix
(self, folder_path, prefix=".")
tools/metrics/clip-score/src/clip_score/clip_score.py:129
↓ 2 callersFunction_compute_conv_output_size
Compute output size of a convolution operation.
diffusion/model/ltx2/causal_vae.py:56
↓ 2 callersMethod_convert_flow_pred_to_x0
Convert flow matching's prediction to x0 prediction. flow_pred: the prediction with shape [B, C, H, W] xt: the input noisy da
diffusion/longsana/utils/model_wrapper.py:51
↓ 2 callersMethod_convert_x0_to_flow_pred
Convert x0 prediction to flow matching's prediction. x0_pred: the x0 prediction with shape [B, C, H, W] xt: the input noisy d
diffusion/longsana/utils/model_wrapper.py:77
↓ 2 callersFunction_cross_attention_with_cached_kv
( attn: nn.Module, hidden_states: torch.Tensor, cache: tuple[torch.Tensor, torch.Tensor, torch.Ten
diffusion/refiner/diffusers_ltx2_refiner.py:1738
↓ 2 callersMethod_dequantize_state
Dequantize 8bit quantized data to 32bit float Args: quantized_chunks: list of quantized data blocks Returns:
diffusion/utils/optimizer.py:565
↓ 2 callersFunction_disable_cuda_cam
(err)
diffusion/model/ops/fused_gdn_chunkwise_cuda.py:846
↓ 2 callersFunction_emit_ready
Emit one decoded chunk to the MP4 writer / callback (single source of truth for the in-loop flush and the final drain).
inference_video_scripts/wm/streaming_pipeline.py:525
↓ 2 callersMethod_encode
Internal encode method.
diffusion/model/ltx2/causal_vae.py:1598
↓ 2 callersMethod_encode_prompt
(self, prompt: str)
diffusion/refiner/diffusers_ltx2_refiner.py:629
↓ 2 callersMethod_encode_prompts
( self, prompt: str, negative_prompt: str )
inference_video_scripts/wm/inference_sana_wm.py:1255
↓ 2 callersFunction_env_tuple
(name: str)
diffusion/refiner/diffusers_ltx2_refiner.py:2274
↓ 2 callersMethod_extract_masked_hidden
Helper function to extract non-padded token embeddings from a batch. Args: hidden_states (torch.Tensor): The output embe
diffusion/model/qwen/qwen_vl.py:54
↓ 2 callersFunction_fit_intrinsics_sequence
Return ``arr`` fitted to ``num_frames`` along axis 0.
inference_video_scripts/wm/inference_sana_wm.py:632
↓ 2 callersFunction_forward_video_block
( *, block: nn.Module, hidden_states: torch.Tensor, encoder_hidden_states: torch.Tensor | None
diffusion/refiner/diffusers_ltx2_refiner.py:1352
↓ 2 callersMethod_forward_video_only_with_rope
Shared body of ``_forward_video_only`` that takes a pre-built RoPE. Used by the AR refinement path where each block forward needs custom
diffusion/refiner/diffusers_ltx2_refiner.py:722
↓ 2 callersFunction_get_chunk_causal_block_mask
Build a flex_attention BlockMask for chunk-causal attention. Token ``q_idx`` can attend to ``kv_idx`` iff ``chunk(q) >= chunk(kv)``, i.e. ``k
diffusion/model/nets/sana_gdn_blocks.py:838
↓ 2 callersFunction_get_clip_size
(size)
diffusion/post_training/rewards.py:86
↓ 2 callersMethod_get_closest_ratio
(self, height, width)
diffusion/utils/data_sampler.py:144
↓ 2 callersMethod_get_n_chunks
(self, numel: int, n_channels: int)
diffusion/model/dc_ae/efficientvit/models/nn/ops.py:644
↓ 2 callersMethod_get_num_layers_from_state_dict
get model layers from state dict
diffusion/model/model_growth_utils.py:109
↓ 2 callersFunction_has_cross_attention_kv_cache
(transformer: nn.Module)
diffusion/refiner/diffusers_ltx2_refiner.py:1731
↓ 2 callersFunction_inception_v3
Wraps `torchvision.models.inception_v3`
tools/metrics/pytorch-fid/src/pytorch_fid/inception.py:160
↓ 2 callersMethod_init_gdn_gates_for_linear_equiv
Initialize gates near identity to mimic Linear Attention at start.
diffusion/model/nets/sana_gdn_blocks.py:298
↓ 2 callersFunction_invert_SE3
Invert a 4x4 SE(3) matrix batch (closed-form). Mirrors the production ``_invert_SE3`` in ``sana_camctrl_blocks.py``; inlined to keep this mod
diffusion/model/ops/fused_cam_gdn.py:58
↓ 2 callersMethod_load_modality
(self, path, modality)
tools/metrics/clip-score/src/clip_score/clip_score.py:98
↓ 2 callersMethod_make_nvfp4_recipe
(self)
diffusion/refiner/diffusers_ltx2_refiner.py:128
↓ 2 callersFunction_make_stage1_nvfp4_recipe
()
inference_video_scripts/wm/inference_sana_wm.py:332
↓ 2 callersFunction_move_tensor_attr
(module: nn.Module, name: str, device: torch.device | str)
diffusion/refiner/diffusers_ltx2_refiner.py:2611
↓ 2 callersFunction_ntuple
(n)
diffusion/model/utils.py:30
↓ 2 callersMethod_offload_vae_encoder_for_streaming
(self)
inference_video_scripts/wm/inference_sana_wm.py:1179
↓ 2 callersMethod_pack_latents
(latents, batch_size, num_channels_latents, height, width, frame)
diffusion/model/nets/sana_multi_scale_video_camctrl.py:901
↓ 2 callersMethod_pad_stage1_text_for_nvfp4
( self, cond: torch.Tensor, cond_mask: torch.Tensor, neg: torch.Tensor,
inference_video_scripts/wm/inference_sana_wm.py:1300
↓ 2 callersFunction_precompute_cam_inv_rms
Compute ``1/RMS`` per ``(b, n)`` over full-``C`` channels. Args: raw: ``(B, N, H, D)`` raw QKV projection output (typically fp32).
diffusion/model/ops/fused_cam_gdn.py:144
↓ 2 callersFunction_prepare_cam_qkv_softmax
Camera branch Q/K/V for softmax attention. Mirrors ``_GDNUCPEBase._prepare_cam_qkv`` but skips the ReLU kernel and GDN key scaling — standard
diffusion/model/nets/sana_gdn_camctrl_blocks.py:379
↓ 2 callersMethod_prepare_stage1_nvfp4
(self)
inference_video_scripts/wm/inference_sana_wm.py:1057
↓ 2 callersFunction_prepare_ucpe_rope_tables
Convert complex RoPE ``(1, 1, N, D_half//2)`` to interleaved ``(N, D_half)`` cos/sin. Uses the interleaved-pair convention: y[2i] = x[2
diffusion/model/ops/fused_cam_gdn.py:160
↓ 2 callersMethod_prepared_transformer_cache_path
(self)
diffusion/refiner/diffusers_ltx2_refiner.py:136
↓ 2 callersFunction_process_camera_conditions_raymats_only
Lightweight variant of ``_process_camera_conditions_ucpe`` — raymats only. Computes *only* the per-ray ``world -> ray_local`` SE(3) transforms us
diffusion/model/ops/fused_cam_gdn.py:73
↓ 2 callersMethod_record_section
(self, name: str, start: torch.cuda.Event, end: torch.cuda.Event)
diffusion/refiner/diffusers_ltx2_refiner.py:2113
↓ 2 callersFunction_refiner_layer_profile_enabled
()
diffusion/refiner/diffusers_ltx2_refiner.py:2088
↓ 2 callersFunction_replace_linear_with_te_nvfp4
( module: nn.Module, *, recipe, params_dtype: torch.dtype, skip_patterns: tuple[str, ...],
diffusion/refiner/diffusers_ltx2_refiner.py:2478
↓ 2 callersFunction_resolve_dataset_file
(dataset, filename)
diffusion/post_training/prompt_dataset.py:22
↓ 2 callersMethod_resolve_flow_shift
(self, override: float | None)
inference_video_scripts/wm/inference_sana_wm.py:1497
↓ 2 callersFunction_resolve_trajectory
Materialise the camera-to-world trajectory from --camera or --action.
inference_video_scripts/wm/inference_sana_wm.py:2095
↓ 2 callersMethod_rms
(self, tensor)
diffusion/utils/optimizer.py:317
↓ 2 callersMethod_rms
(self, tensor)
diffusion/utils/optimizer.py:615
↓ 2 callersMethod_run_generator
Optionally simulate the generator's input from noise using backward simulation and then run the generator for one-step. Input
diffusion/longsana/model/dmd_sana.py:559
↓ 2 callersFunction_sample_discard_frames
(pixel_chunk: torch.Tensor, frame_base: int, drop_first: bool)
inference_video_scripts/wm/streaming_pipeline.py:339
↓ 2 callersFunction_sdpa_maybe_chunk_causal
Run SDPA with chunk-causal masking when needed, or plain SDPA otherwise. Replicates the masking logic from ``_forward_softmax_attn`` and ``_f
diffusion/model/nets/sana_gdn_blocks.py:1135
↓ 2 callersFunction_select_inference_transformer
Return the transformer to use for inference based on *mode*. mode: "compile_nvfp4" | "compile" | "peft"
train_scripts/sol_rl/train_sana.py:129
↓ 2 callersFunction_set_kv_prefix_on_blocks
Mirror tian's ``_inject_kv_prefix``: attach a per-layer prefix dict to each ``attn1``.
diffusion/refiner/diffusers_ltx2_refiner.py:1804
↓ 2 callersMethod_setup_visualizer
Initialize the inference pipeline for visualization on CPU, to be moved to GPU only when needed.
diffusion/longsana/trainer/ode.py:360
↓ 2 callersFunction_slice_rope_for_cam
Re-slice WAN RoPE frequencies for a smaller rope_dim using the same (T, H, W) split.
diffusion/model/nets/sana_camctrl_blocks.py:572
↓ 2 callersFunction_snap_num_frames
Snap ``n`` to the nearest ``stride*k + 1`` (LTX-2 VAE constraint). Ties round up to keep the user's requested length when possible. If the ro
inference_video_scripts/wm/inference_sana_wm.py:2109
↓ 2 callersMethod_stage1_prepared_cache_path
(self, model_path: str | Path)
inference_video_scripts/wm/inference_sana_wm.py:992
↓ 2 callersFunction_store_kv_pair
( pair: tuple[torch.Tensor, torch.Tensor], dtype: torch.dtype | None, )
diffusion/refiner/diffusers_ltx2_refiner.py:2260
↓ 2 callersFunction_streaming_self_attention
LTX-2 self-attention with sink/current streaming mask + AR KV-cache hooks. Two modes are layered on top of vanilla diffusers self-attention, sele
diffusion/refiner/diffusers_ltx2_refiner.py:1454
↓ 2 callersFunction_swap_pipeline_model
Swap pipeline.transformer to the model specified by *mode*. mode: "compile_nvfp4" | "compile" | "peft"
train_scripts/sol_rl/train_flux1.py:234
↓ 2 callersFunction_swap_pipeline_model
Swap pipeline.transformer to the model specified by *mode*. mode: "compile_nvfp4" | "compile" | "peft"
train_scripts/sol_rl/train_sd3.py:241
↓ 2 callersMethod_sync
(self, val: Union[torch.Tensor, int, float])
diffusion/model/dc_ae/efficientvit/apps/utils/metric.py:34
↓ 2 callersFunction_te_name_matches
(patterns: tuple[str, ...], name: str)
diffusion/refiner/diffusers_ltx2_refiner.py:2427
↓ 2 callersMethod_threshold_sample
"Dynamic thresholding: At each sampling step we set s to a certain percentile absolute pixel value in xt0 (the prediction of x_0 at t
diffusion/scheduler/sa_solver_diffusers.py:262
↓ 2 callersFunction_try_launch_refiner
(max_ready_stage_idx: int)
inference_video_scripts/wm/streaming_pipeline.py:407
↓ 2 callersFunction_unpack_latents
( latents: torch.Tensor, num_frames: int, height: int, width: int, patch_size: int = 1,
diffusion/refiner/diffusers_ltx2_refiner.py:1934
↓ 2 callersMethod_unpack_latents
(latents, height, width, frame)
diffusion/model/nets/sana_multi_scale_video_camctrl.py:909
↓ 2 callersMethod_visualize
Generate and save sample videos to monitor training progress.
diffusion/longsana/trainer/ode.py:424
↓ 2 callersFunction_wait
(stream, event)
inference_video_scripts/wm/streaming_pipeline.py:275
↓ 2 callersFunction_warmup_beta
(beta_start, beta_end, num_diffusion_timesteps, warmup_frac)
diffusion/model/gaussian_diffusion.py:81
↓ 2 callersMethodadams_moulton_update
SA-Corrector, without the "rescaling" trick in Appendix D in SA-Solver paper https://arxiv.org/pdf/2309.05019.pdf
diffusion/model/sa_solver.py:709
↓ 2 callersMethodadams_moulton_update_few_steps
SA-Corrector, without the "rescaling" trick in Appendix D in SA-Solver paper https://arxiv.org/pdf/2309.05019.pdf
diffusion/model/sa_solver.py:825
↓ 2 callersFunctionalpha_bar_fn
(t)
diffusion/scheduler/lcm_scheduler.py:69
↓ 2 callersFunctionalpha_bar_fn
(t)
diffusion/scheduler/sa_solver_diffusers.py:52
↓ 2 callersFunctionapply_overlay
Composite the action overlay onto each frame. Args: video_hwc: ``(T, H, W, 3)`` uint8 video. c2w: ``(T_pose, 4, 4)`` camera-to-wo
diffusion/utils/action_overlay.py:317
↓ 2 callersFunctionapply_style
(style_name: str, positive: str, negative: str = "")
app/app_sana_multithread.py:157
↓ 2 callersFunctionapprox_standard_normal_cdf
A fast approximation of the cumulative distribution function of the standard normal.
diffusion/model/diffusion_utils.py:48
↓ 2 callersMethodas_tuple
Flatten to the 8-tuple the legacy API returns.
diffusion/model/ops/fused_gdn_chunkwise.py:98
↓ 2 callersMethodbatch_start_frame
(self)
diffusion/utils/misc.py:310
↓ 2 callersMethodblend_h
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae.py:565
↓ 2 callersMethodblend_h
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae_with_temporal.py:552
↓ 2 callersMethodblend_h
Blend horizontally between two tiles.
diffusion/model/ltx2/causal_vae.py:1837
↓ 2 callersMethodblend_t
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae.py:573
↓ 2 callersMethodblend_t
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae_with_temporal.py:539
↓ 2 callersMethodblend_t
Blend temporally between two tiles.
diffusion/model/ltx2/causal_vae.py:1846
↓ 2 callersMethodblend_v
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae.py:557
↓ 2 callersMethodblend_v
Blend vertically between two tiles.
diffusion/model/ltx2/causal_vae.py:1828
↓ 2 callersMethodblend_w
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae_with_temporal.py:546
↓ 2 callersFunctionbuild_downsample_block
Spatial downsample is always performed. Temporal downsample is optional.
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae.py:165
↓ 2 callersFunctionbuild_downsample_block
( block_type: str, in_channels: int, out_channels: int, shortcut: Optional[str], zero_out: bool = False )
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae_with_temporal.py:128
↓ 2 callersFunctionbuild_stage_main
( width: int, depth: int, block_type: str | list[str], norm: str, act: str, input_width: int, is_video: bo
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae.py:146
↓ 2 callersFunctionbuild_stage_main
( width: int, depth: int, block_type: str | list[str], norm: str, act: str, zero_out: bool = False )
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae_with_temporal.py:262
↓ 2 callersFunctionbuild_upsample_block
( block_type: str, in_channels: int, out_channels: int, shortcut: Optional[str], is_video:
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae.py:215
↓ 2 callersFunctionbuild_upsample_block
( block_type: str, in_channels: int, out_channels: int, shortcut: Optional[str], zero_out: bool = False )
diffusion/model/dc_ae/efficientvit/models/efficientvit/dc_ae_with_temporal.py:174
← previousnext →401–500 of 2,606, ranked by callers