MCPcopy Create free account

hub / github.com/PixArt-alpha/PixArt-sigma / functions

Functions537 in github.com/PixArt-alpha/PixArt-sigma

↓ 246 callersMethodto
(self, device)
train_scripts/train_pixart_lcm.py:92
↓ 49 callersMethodlog
(self, n=1)
diffusion/utils/misc.py:94
↓ 28 callersMethodrandn
(self, size, **kwargs)
diffusion/model/utils.py:430
↓ 23 callersFunction_extract_into_tensor
Extract values from a 1-D numpy array for a batch of indices. :param arr: the 1-D numpy array. :param timesteps: a tensor of indices into
diffusion/model/gaussian_diffusion.py:1029
↓ 23 callersFunctionget_root_logger
Get root logger. Args: log_file (str, optional): File path of log. Defaults to None. log_level (int, optional): The level of logg
diffusion/utils/logger.py:9
↓ 22 callersMethodmarginal_lambda
Compute lambda_t = log(alpha_t) - log(sigma_t) of a given continuous-time label t in [0, T].
diffusion/model/sa_solver.py:134
↓ 19 callersMethodmarginal_lambda
Compute lambda_t = log(alpha_t) - log(sigma_t) of a given continuous-time label t in [0, T].
diffusion/model/dpm_solver.py:149
↓ 19 callersMethodmarginal_std
Compute sigma_t of a given continuous-time label t in [0, T].
diffusion/model/dpm_solver.py:143
↓ 17 callersMethodrandn_like
(self, input)
diffusion/model/utils.py:434
↓ 16 callersMethodmarginal_log_mean_coeff
Compute log(alpha_t) of a given continuous-time label t in [0, T].
diffusion/model/dpm_solver.py:127
↓ 16 callersMethodmarginal_std
Compute sigma_t of a given continuous-time label t in [0, T].
diffusion/model/sa_solver.py:128
↓ 15 callersMethodmodel_fn
Convert the model to the noise prediction model or the data prediction model.
diffusion/model/dpm_solver.py:446
↓ 15 callersMethodrandint
(self, *args, size, **kwargs)
diffusion/model/utils.py:437
↓ 14 callersMethodmarginal_alpha
Compute alpha_t of a given continuous-time label t in [0, T].
diffusion/model/sa_solver.py:122
↓ 14 callersMethodstep
( self, closure: Optional[Callable] = None )
diffusion/utils/optimizer.py:207
↓ 13 callersMethodexists
(val)
diffusion/utils/optimizer.py:203
↓ 12 callersFunctionget_world_size
()
diffusion/utils/dist_utils.py:20
↓ 11 callersMethodwrite
Write text to stdout (and a file) and optionally flush.
diffusion/model/utils.py:391
↓ 10 callersMethod__init__
(self, hidden_size, patch_size, out_channels)
diffusion/model/nets/PixArt_blocks.py:189
↓ 10 callersMethodmodel_fn
Convert the model to the noise prediction model or the data prediction model.
diffusion/model/sa_solver.py:388
↓ 10 callersMethodsample
For the PC-mode, please refer to the wiki page https://en.wikipedia.org/wiki/Predictor%E2%80%93corrector_method#PEC_mode_and_PECE_mo
diffusion/model/sa_solver.py:1066
↓ 9 callersFunctionexpand_dims
Expand the tensor `v` to the dim `dims`. Args: `v`: a PyTorch tensor with shape [N]. `dim`: a `int`. Returns: a
diffusion/model/dpm_solver.py:1327
↓ 9 callersFunctionflush
()
train_scripts/train_dreambooth_lora.py:61
↓ 9 callersFunctionmean_flat
Take the mean over all non-batch dimensions.
diffusion/model/gaussian_diffusion.py:17
↓ 8 callersMethodexpand_frame
(self, line)
diffusion/utils/misc.py:216
↓ 7 callersFunctionreplace_img_ext
(path, dst_ext: str)
diffusion/data/datasets/InternalData.py:16
↓ 6 callersMethod_predict_xstart_from_eps
(self, x_t, t, eps)
diffusion/model/gaussian_diffusion.py:363
↓ 6 callersMethodanalyse_variable
(self, var, ctx)
diffusion/utils/misc.py:242
↓ 6 callersMethodbackward
(ctx, *grads)
diffusion/utils/dist_utils.py:237
↓ 5 callersFunction_cast_if_autocast_enabled
(tensor)
diffusion/model/llava/mpt/norm.py:3
↓ 5 callersMethod_predict_eps_from_xstart
(self, x_t, t, pred_xstart)
diffusion/model/gaussian_diffusion.py:370
↓ 5 callersMethod_vb_terms_bpd
Get a term for the variational lower-bound. The resulting units are bits (rather than nats, as one might expect). This allows
diffusion/model/gaussian_diffusion.py:711
↓ 5 callersMethod_wrap_model
(self, model)
diffusion/model/respace.py:110
↓ 5 callersMethodadd_noise
( self, original_samples: torch.FloatTensor, noise: torch.FloatTensor,
diffusion/lcm_scheduler.py:413
↓ 5 callersFunctionflush
()
diffusion/utils/dist_utils.py:312
↓ 5 callersFunctionflush_memory
()
tools/convert_diffusers_to_pipeline.py:19
↓ 5 callersFunctiongeneric_param_init_fn_
(module: nn.Module, init_fn_, n_layers: int, d_model: Optional[int]=None, init_div_is_residual: Union[int, flo
diffusion/model/llava/mpt/param_init_fns.py:28
↓ 5 callersMethodget_time_steps
Compute the intermediate time steps for sampling. Args: skip_type: A `str`. The type for the spacing of the time steps. We suppor
diffusion/model/dpm_solver.py:455
↓ 5 callersMethodinverse_lambda
Compute the continuous-time label t in [0, T] of a given half-logSNR lambda_t.
diffusion/model/dpm_solver.py:157
↓ 5 callersMethodq_posterior_mean_variance
Compute the mean and variance of the diffusion posterior: q(x_{t-1} | x_t, x_0)
diffusion/model/gaussian_diffusion.py:258
↓ 5 callersFunctionsave_image
(image, path)
scripts/DMD/transformer_train/utils.py:186
↓ 5 callersFunctiont2i_modulate
(x, shift, scale)
diffusion/model/nets/PixArt_blocks.py:24
↓ 5 callersMethodtraining_losses
( self, model, *args, **kwargs )
diffusion/model/respace.py:94
↓ 4 callersFunctionIDDPM
( timestep_respacing, noise_schedule="linear", use_kl=False, sigma_small=False
diffusion/iddpm.py:9
↓ 4 callersFunctionbuild_dataloader
(dataset, batch_size=256, num_workers=4, shuffle=True, **kwargs)
diffusion/data/builder.py:47
↓ 4 callersFunctionextract_embeddings
(embeddings : torch.Tensor, device='cuda', dtype = torch.float32)
train_scripts/train_dreambooth_lora.py:57
↓ 4 callersFunctionforward_model
(model, latents, timestep, prompt_embeds, prompt_attention_masks=None)
scripts/DMD/transformer_train/generate.py:44
↓ 4 callersFunctionget_closest_ratio
(height: float, width: float, ratios: dict)
diffusion/data/datasets/InternalData_ms.py:14
↓ 4 callersMethodget_coefficients_fn
Calculate the coefficient of gradients.
diffusion/model/sa_solver.py:541
↓ 4 callersFunctionget_data_path
(data_dir)
diffusion/data/builder.py:20
↓ 4 callersFunctionget_logger
Initialize and get a logger by name. If the logger has not been initialized, this method will initialize the logger by adding one or two hand
diffusion/utils/logger.py:26
↓ 4 callersFunctionget_rank
()
diffusion/utils/dist_utils.py:28
↓ 4 callersFunctionload_checkpoint
(checkpoint, model, model_ema=None, optimizer=None
diffusion/utils/checkpoint.py:40
↓ 4 callersMethodload_json
(self, file_path)
diffusion/data/datasets/dmd.py:128
↓ 4 callersMethodmarginal_alpha
Compute alpha_t of a given continuous-time label t in [0, T].
diffusion/model/dpm_solver.py:137
↓ 4 callersFunctionnoise_pred_fn
(x, t_continuous, cond=None)
diffusion/model/dpm_solver.py:284
↓ 4 callersFunctionnoise_pred_fn
(x, t_continuous, cond=None)
diffusion/model/sa_solver.py:270
↓ 4 callersMethodp_mean_variance
Apply the model to get p(x_{t-1} | x_t), as well as a prediction of the initial x, x_0. :param model: the model, which takes
diffusion/model/gaussian_diffusion.py:280
↓ 4 callersFunctionsave_checkpoint
(work_dir, epoch, model, model_ema=None,
diffusion/utils/checkpoint.py:8
↓ 4 callersFunctionsynchronize
Helper function to synchronize (barrier) among all processes when using distributed training
diffusion/utils/dist_utils.py:70
↓ 3 callersFunctionDPMS
( model, condition, uncondition, cfg_scale, model_type='noise', # or
diffusion/dpm_solver.py:6
↓ 3 callersFunctionaccelerate_save_state
Saves the current states of the model, optimizer, scaler, RNG generators, and registered objects to a folder. If a `ProjectConfiguration` wa
scripts/DMD/transformer_train/utils.py:39
↓ 3 callersMethodadams_bashforth_update
SA-Predictor, without the "rescaling" trick in Appendix D in SA-Solver paper https://arxiv.org/pdf/2309.05019.pdf
diffusion/model/sa_solver.py:562
↓ 3 callersMethodadams_bashforth_update_few_steps
SA-Predictor, with the "rescaling" trick in Appendix D in SA-Solver paper https://arxiv.org/pdf/2309.05019.pdf
diffusion/model/sa_solver.py:644
↓ 3 callersFunctionall_gather_tensor
(tensor, group_size=None, group=None)
diffusion/utils/dist_utils.py:194
↓ 3 callersMethodclose
Flush, close possible files, and remove stdout/stderr mirroring.
diffusion/model/utils.py:411
↓ 3 callersFunctioncompute_snr
Computes SNR as per https://github.com/TiankaiHang/Min-SNR-Diffusion-Training/blob/521b624bd70c67cee4bdf49225915f5945a872e3/guided_diffusion/gaus
scripts/DMD/transformer_train/utils.py:161
↓ 3 callersMethoddpm_solver_first_update
DPM-Solver-1 (equivalent to DDIM) from time `s` to time `t`. Args: x: A pytorch tensor. The initial value at time `s`.
diffusion/model/dpm_solver.py:551
↓ 3 callersMethodget_input_embeddings
(self)
diffusion/model/llava/mpt/modeling_mpt.py:69
↓ 3 callersMethodmarginal_log_mean_coeff
Compute log(alpha_t) of a given continuous-time label t in [0, T].
diffusion/model/sa_solver.py:108
↓ 3 callersFunctionmodulate
(x, shift, scale)
diffusion/model/nets/PixArt_blocks.py:20
↓ 3 callersFunctionprepare_prompt_ar
(prompt, ratios, device='cpu', show=True)
diffusion/model/utils.py:442
↓ 3 callersMethodq_sample
Diffuse the data for a given number of diffusion steps. In other words, sample from q(x_t | x_0). :param x_start: the initial
diffusion/model/gaussian_diffusion.py:241
↓ 3 callersFunctionread_config
(file)
diffusion/utils/misc.py:21
↓ 3 callersMethodregister_buffer
(self, name, attr)
diffusion/sa_sampler.py:24
↓ 3 callersMethodsample_subset
(self, ratio)
diffusion/data/datasets/InternalData.py:149
↓ 3 callersMethodscale_model_input
Ensures interchangeability with schedulers that need to scale the denoising model input depending on the current timestep. Ar
diffusion/lcm_scheduler.py:229
↓ 3 callersFunctionset_data_root
(data_root)
diffusion/data/builder.py:15
↓ 3 callersMethodsinglestep_dpm_solver_second_update
Singlestep solver DPM-Solver-2 from time `s` to time `t`. Args: x: A pytorch tensor. The initial value at time `s`.
diffusion/model/dpm_solver.py:598
↓ 2 callersFunctionPixArtMS_XL_2
(**kwargs)
diffusion/model/nets/PixArtMS.py:292
↓ 2 callersFunctionPixArt_XL_2
(**kwargs)
diffusion/model/nets/PixArt.py:314
↓ 2 callersMethod__init__
( self, input_size=32, patch_size=2, in_channels=4,
diffusion/model/nets/PixArtMS.py:91
↓ 2 callersMethod__init__
(self, normalized_shape, eps=1e-05, weight=True, dtype=None, device=None)
diffusion/model/llava/mpt/norm.py:35
↓ 2 callersFunction_normal_param_init_fn_
(module: nn.Module, std: float, n_layers: int, d_model: Optional[int]=None, init_div_is_residual: Union[int, f
diffusion/model/llava/mpt/param_init_fns.py:124
↓ 2 callersFunction_ntuple
(n)
diffusion/model/utils.py:17
↓ 2 callersFunction_reset_is_causal
(num_query_tokens: int, num_key_tokens: int, original_is_causal: bool)
diffusion/model/llava/mpt/attention.py:11
↓ 2 callersMethod_set_config_defaults
(self, config, config_defaults)
diffusion/model/llava/mpt/configuration_mpt.py:90
↓ 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/sa_solver_diffusers.py:265
↓ 2 callersMethod_validate_config
(self)
diffusion/model/llava/mpt/configuration_mpt.py:96
↓ 2 callersFunction_warmup_beta
(beta_start, beta_end, num_diffusion_timesteps, warmup_frac)
diffusion/model/gaussian_diffusion.py:59
↓ 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:602
↓ 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:700
↓ 2 callersFunctionalpha_bar_fn
(t)
diffusion/lcm_scheduler.py:70
↓ 2 callersFunctionalpha_bar_fn
(t)
diffusion/sa_solver_diffusers.py:53
↓ 2 callersFunctionappend_dims
Appends dimensions to the end of a tensor until it has target_dims dimensions.
train_scripts/train_pixart_lcm.py:56
↓ 2 callersFunctionapprox_standard_normal_cdf
A fast approximation of the cumulative distribution function of the standard normal.
diffusion/model/diffusion_utils.py:39
↓ 2 callersFunctionauto_grad_checkpoint
(module, *args, **kwargs)
diffusion/model/utils.py:38
↓ 2 callersFunctionauto_scale_lr
(effective_bs, optimizer_cfg, rule='linear', base_batch_size=256)
diffusion/utils/optimizer.py:18
↓ 2 callersMethodbatch_start_frame
(self)
diffusion/utils/misc.py:252
↓ 2 callersFunctionbuild_dataset
(cfg, resolution=224, **kwargs)
diffusion/data/builder.py:34
next →1–100 of 537, ranked by callers