Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/tdrussell/diffusion-pipe
/ functions
Functions
1,157 in github.com/tdrussell/diffusion-pipe
⨍
Functions
1,157
◇
Types & classes
222
↓ 1 callers
Function
_set_rng_states
Set the global random state of :mod:`torch`, :mod:`torch.cuda`, :mod:`numpy` and Python in the current process.
utils/isolate_rng.py:45
↓ 1 callers
Function
_t5
(name, encoder_only=False, decoder_only=False, return_tokenizer=False, tokeniz
models/wan/t5.py:409
↓ 1 callers
Function
_video_vae
Autoencoder3d adapted from Stable Diffusion 1.x, 2.x and XL.
models/cosmos_predict2.py:48
↓ 1 callers
Function
_video_vae
(pretrained_path=None, z_dim=16, dim=160, device="cpu", **kwargs)
models/wan/vae2_2.py:863
↓ 1 callers
Function
_video_vae
Autoencoder3d adapted from Stable Diffusion 1.x, 2.x and XL.
models/wan/vae2_1.py:588
↓ 1 callers
Method
add_text_embedding_dataset
(self, te_dataset)
utils/dataset.py:305
↓ 1 callers
Function
apply_debiased_estimation
(loss, timesteps, noise_scheduler, v_prediction=False)
models/sdxl.py:347
↓ 1 callers
Function
apply_normuon_variance_reduction
NorMuon variance reduction. Algebraically fuses the normalization steps to minimize memory ops.
optimizers/generic_optim.py:236
↓ 1 callers
Function
apply_patches
()
utils/patches.py:408
↓ 1 callers
Function
apply_snr_weight
(loss, timesteps, noise_scheduler, gamma, v_prediction=False)
models/sdxl.py:333
↓ 1 callers
Function
approximate_svd
Perform approximate Singular Value Decomposition (SVD) using Subsampled Randomized Hadamard Transform (SRHT). Args: - input_matrix (torc
optimizers/projectors/approx_svd.py:22
↓ 1 callers
Method
build_patch_embed
(self)
models/cosmos_predict2_modeling.py:1306
↓ 1 callers
Method
build_pos_embed
(self)
models/cosmos_predict2_modeling.py:1328
↓ 1 callers
Function
bypass_flux_guidance
(transformer)
models/flux.py:139
↓ 1 callers
Function
canonicalize
(text, keep_punctuation_exact_string=None)
models/wan/tokenizers.py:22
↓ 1 callers
Method
check_params
Check if parameters set are all okay and raise error if there is any strange combination.
optimizers/generic_optim.py:608
↓ 1 callers
Function
clean_memory_on_device
r""" Clean memory on the specified device, will be called from training scripts.
utils/offloading.py:19
↓ 1 callers
Function
clip_grad_norm_
Clips gradient norm of an iterable of parameters. This has been adapted from Nvidia megatron. We add norm averaging to consider MoE params wh
utils/patches.py:175
↓ 1 callers
Function
clip_xlm_roberta_vit_h_14
( pretrained=False, pretrained_name='open-clip-xlm-roberta-large-vit-huge-14', **kwarg
models/wan/clip.py:465
↓ 1 callers
Method
compute_attention
(self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor)
models/cosmos_predict2_modeling.py:443
↓ 1 callers
Method
compute_qkv
( self, x: torch.Tensor, context: Optional[torch.Tensor] = None, rope_emb: Opt
models/cosmos_predict2_modeling.py:413
↓ 1 callers
Function
compute_scale_for_dtype
Compute appropriate scale for the given tensor and target dtype. Args: tensor: Input tensor to be quantized dtype: Target dt
optimizers/optimizer_utils.py:32
↓ 1 callers
Function
convert_crop_and_resize
(pil_img, width_and_height)
tools/image_resize_test.py:15
↓ 1 callers
Function
convert_crop_and_resize
(pil_img, width_and_height)
models/base.py:61
↓ 1 callers
Function
convert_openai_text_enc_state_dict
(text_enc_dict)
models/sdxl.py:275
↓ 1 callers
Function
convert_openclip_text_enc_state_dict
(text_enc_dict)
models/sdxl.py:228
↓ 1 callers
Function
convert_unet_state_dict
(unet_state_dict)
models/sdxl.py:103
↓ 1 callers
Function
convert_vae_state_dict
(vae_state_dict)
models/sdxl.py:183
↓ 1 callers
Method
create_backward_hook
(self, block_index: int)
utils/offloading.py:231
↓ 1 callers
Method
create_new_shard
(self)
utils/cache.py:90
↓ 1 callers
Method
dequantize
(self, model, diffusion_model_dtype)
models/base.py:528
↓ 1 callers
Function
distribute_modulations
()
models/chroma.py:47
↓ 1 callers
Function
distributed_init
Initialize distributed training environment.
train.py:245
↓ 1 callers
Function
distributed_init
Initialize distributed training environment.
test/debug_deepspeed_init.py:27
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/ernie_image.py:91
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/hunyuan_video_15.py:181
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/z_image.py:95
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/auraflow.py:159
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/base.py:384
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/cosmos_predict2.py:421
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/ltx2.py:349
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/ideogram4.py:106
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/krea2.py:153
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/qwen_image.py:487
↓ 1 callers
Method
enable_block_swap
(self, blocks_to_swap)
models/wan/wan.py:385
↓ 1 callers
Method
enable_paramiter_swapping
(self, paramiter_swapping_factor=0.1)
optimizers/automagic.py:95
↓ 1 callers
Method
encode
(self, x)
models/cosmos.py:66
↓ 1 callers
Function
enforce_zero_terminal_snr
(betas)
models/sdxl.py:299
↓ 1 callers
Function
evaluate_single
(model_engine, eval_dataloader, eval_gradient_accumulation_steps, quantile, pbar=None)
train.py:176
↓ 1 callers
Function
execute_mapping
(original_key)
models/wan/t5.py:465
↓ 1 callers
Method
expired
(self)
utils/reduction.py:49
↓ 1 callers
Function
extract_clips
(video, target_frames, video_clip_mode)
models/base.py:37
↓ 1 callers
Function
fix_noise_scheduler_betas_for_zero_terminal_snr
(noise_scheduler)
models/sdxl.py:295
↓ 1 callers
Method
forward
r""" Args: x(Tensor): Shape [B, L1, C] e(Tensor): Shape [B, L1, C]
models/wan/model.py:332
↓ 1 callers
Method
free_dead_references
(self)
utils/reduction.py:90
↓ 1 callers
Method
generate_embeddings
(self, B_T_H_W_C: torch.Size, fps: Optional[torch.Tensor])
models/cosmos_predict2_modeling.py:487
↓ 1 callers
Function
get_and_update_subset_norm_denom
(group, state, grad, beta2)
optimizers/generic_optim.py:28
↓ 1 callers
Function
get_and_update_subspace_momentum
(group, state, p)
optimizers/generic_optim.py:67
↓ 1 callers
Method
get_call_text_encoder_fn
(self, text_encoder)
models/base.py:346
↓ 1 callers
Method
get_call_text_encoder_fn
(self, text_encoder)
models/sd3.py:78
↓ 1 callers
Method
get_call_vae_fn
(self, vae)
models/sd3.py:69
↓ 1 callers
Method
get_conds
(self, inputs)
models/ideogram4.py:46
↓ 1 callers
Method
get_conds
(self, inputs)
models/flux2.py:116
↓ 1 callers
Function
get_dit_config
(state_dict, key_prefix='')
models/cosmos_predict2.py:106
↓ 1 callers
Function
get_format_params
Returns (mantissa_bits, total_bits) for each format. mantissa_bits excludes the implicit leading 1.
optimizers/optimizer_utils.py:121
↓ 1 callers
Method
get_learning_rates
(self)
optimizers/automagic.py:163
↓ 1 callers
Function
get_lin_function
(x1: float = 256, y1: float = 0.5, x2: float = 4096, y2: float = 1.15)
models/hidream.py:31
↓ 1 callers
Function
get_lin_function
(x1: float = 256, y1: float = 0.5, x2: float = 4096, y2: float = 1.15)
models/chroma.py:30
↓ 1 callers
Function
get_lin_function
( x1: float = 256, y1: float = 0.5, x2: float = 4096, y2: float = 1.15 )
models/lumina_2.py:23
↓ 1 callers
Function
get_lin_function
(x1: float = 256, y1: float = 0.5, x2: float = 4096, y2: float = 1.15)
models/cosmos_predict2.py:42
↓ 1 callers
Function
get_lin_function
(x1: float = 256, y1: float = 0.5, x2: float = 4096, y2: float = 1.15)
models/sd3.py:19
↓ 1 callers
Function
get_lin_function
( x1: float = 256, y1: float = 0.5, x2: float = 4096, y2: float = 1.15 )
models/omnigen2.py:21
↓ 1 callers
Function
get_lin_function
(x1: float = 256, y1: float = 0.5, x2: float = 4096, y2: float = 1.15)
models/flux.py:124
↓ 1 callers
Function
get_most_recent_run_dir
(output_dir)
train.py:146
↓ 1 callers
Method
get_numerator
(self, group, state, p, state_device)
optimizers/generic_optim.py:515
↓ 1 callers
Function
get_per_sigma_loss_weights
Args: sigma (tensor): noise level Returns: loss weights per sigma noise level
models/cosmos.py:37
↓ 1 callers
Method
get_preprocess_media_file_fn
(self)
models/base.py:343
↓ 1 callers
Function
get_prodigy_d
(optimizer)
train.py:258
↓ 1 callers
Function
get_projected_grad
(group, state, p)
optimizers/generic_optim.py:101
↓ 1 callers
Function
get_projector
(group, p)
optimizers/generic_optim.py:108
↓ 1 callers
Function
get_rotary_pos_embed
(transformer, video_length, height, width)
models/hunyuan_video.py:35
↓ 1 callers
Method
get_size_bucket_datasets
(self)
utils/dataset.py:890
↓ 1 callers
Function
get_t_distribution
(model_config)
utils/common.py:124
↓ 1 callers
Method
get_text_conditioning
(self, input_ids, input_ids_2)
models/sdxl.py:736
↓ 1 callers
Method
get_text_embeddings
(self, image_spec, caption_number)
utils/dataset.py:173
↓ 1 callers
Method
get_text_encoders
(self)
models/base.py:304
↓ 1 callers
Method
get_text_encoders
(self)
models/sd3.py:60
↓ 1 callers
Method
get_vae
(self)
models/base.py:301
↓ 1 callers
Method
get_vae
(self)
models/sd3.py:57
↓ 1 callers
Function
has_inf_or_nan
(x)
optimizers/generic_optim.py:23
↓ 1 callers
Method
init_weights
(self)
models/cosmos_predict2_modeling.py:257
↓ 1 callers
Method
init_weights
(self)
models/cosmos_predict2_modeling.py:399
↓ 1 callers
Method
init_weights
(self)
models/cosmos_predict2_modeling.py:712
↓ 1 callers
Method
init_weights
(self)
models/cosmos_predict2_modeling.py:830
↓ 1 callers
Method
init_weights
(self)
models/cosmos_predict2_modeling.py:895
↓ 1 callers
Method
init_weights
(self)
models/cosmos_predict2_modeling.py:1293
↓ 1 callers
Method
init_weights
r""" Initialize model parameters using Xavier initialization.
models/wan/model.py:519
↓ 1 callers
Function
is_dev
(safetensors_path)
models/flux.py:112
↓ 1 callers
Function
is_package_installed
(package_name)
optimizers/projectors/approx_svd.py:9
↓ 1 callers
Function
isolate_rng
A context manager that resets the global random state on exit to what it was before entering. It supports isolating the states for PyTorch, Numpy,
utils/isolate_rng.py:58
← previous
next →
201–300 of 1,157, ranked by callers