MCPcopy Create free account

hub / github.com/LaurentMazare/diffusers-rs / functions

Functions171 in github.com/LaurentMazare/diffusers-rs

↓ 16 callersMethodget
(&self, name: &str)
src/utils.rs:25
↓ 12 callersMethodforward
(&self, xs: &Tensor, temb: Option<&Tensor>)
src/models/resnet.rs:77
↓ 10 callersMethodencode
Returns the distribution in the latent space.
src/models/vae.rs:276
↓ 6 callersMethoddecode
Takes as input some sampled values.
src/models/vae.rs:282
↓ 6 callersFunctioninterp
One-dimensional linear interpolation for monotonically increasing sample points, mimicking np.interp(). Based on https://github.com/pytorch/pytorch/i
src/schedulers/mod.rs:61
↓ 6 callersMethodstate_in_first_order
(&self)
src/schedulers/k_dpm_2_discrete.rs:209
↓ 5 callersMethodforward
(&self, xs: &Tensor, timestep: f64, encoder_hidden_states: &Tensor)
src/models/unet_2d.rs:243
↓ 5 callersMethodstate_in_first_order
(&self)
src/schedulers/k_dpm_2_ancestral_discrete.rs:254
↓ 5 callersMethodstate_in_first_order
(&self)
src/schedulers/heun_discrete.rs:145
↓ 4 callersFunctionbetas_for_alpha_bar
Create a beta schedule that discretizes the given alpha_t_bar function, which defines the cumulative product of `(1-beta)` over time from `t = [0,1]`.
src/schedulers/mod.rs:44
↓ 4 callersMethodbuild_clip_transformer
( &self, clip_weights: &str, device: tch::Device, )
src/pipelines/stable_diffusion.rs:179
↓ 4 callersMethodbuild_scheduler
(&self, n_steps: usize)
src/pipelines/stable_diffusion.rs:175
↓ 4 callersMethodbuild_unet
( &self, unet_weights: &str, device: Device, in_channels: i64, )
src/pipelines/stable_diffusion.rs:162
↓ 4 callersMethodbuild_vae
( &self, vae_weights: &str, device: Device, )
src/pipelines/stable_diffusion.rs:150
↓ 4 callersMethodscale_model_input
Ensures interchangeability with schedulers that need to scale the denoising model input depending on the current timestep.
src/schedulers/ddim.rs:94
↓ 4 callersMethodstep
Performs a backward step during inference.
src/schedulers/ddim.rs:99
↓ 4 callersMethodtimesteps
(&self)
src/schedulers/ddim.rs:88
↓ 3 callersMethodindex_for_timestep
(&self, timestep: f64)
src/schedulers/k_dpm_2_ancestral_discrete.rs:223
↓ 3 callersMethodindex_for_timestep
(&self, timestep: f64)
src/schedulers/k_dpm_2_discrete.rs:180
↓ 3 callersMethodindex_for_timestep
(&self, timestep: f64)
src/schedulers/heun_discrete.rs:119
↓ 3 callersMethodinit_noise_sigma
(&self)
src/schedulers/ddim.rs:149
↓ 3 callersMethodreshape_heads_to_batch_dim
(&self, xs: &Tensor)
src/models/attention.rs:82
↓ 3 callersMethodshape
(&self, xs: &Tensor, seq_len: i64, bsz: i64)
src/transformers/clip.rs:556
↓ 3 callersMethodtranspose_for_scores
(&self, xs: Tensor)
src/models/attention.rs:352
↓ 2 callersMethodattention
(&self, query: &Tensor, key: &Tensor, value: &Tensor)
src/models/attention.rs:128
↓ 2 callersMethodforward_with_additional_residuals
( &self, xs: &Tensor, timestep: f64, encoder_hidden_states: &Tensor, d
src/models/unet_2d.rs:247
↓ 2 callersMethodget_variance
(&self, timestep: usize)
src/schedulers/ddpm.rs:93
↓ 2 callersFunctionoutput_filename
( basename: &str, sample_idx: i64, num_samples: i64, timestep_idx: Option<usize>, )
examples/stable-diffusion/main.rs:175
↓ 2 callersFunctionoutput_filename
( basename: &str, sample_idx: i64, num_samples: i64, timestep_idx: Option<usize>, )
examples/controlnet/main.rs:91
↓ 2 callersMethodreshape_batch_dim_to_heads
(&self, xs: &Tensor)
src/models/attention.rs:89
↓ 2 callersFunctionrun
(args: Args)
examples/stable-diffusion-img2img/main.rs:131
↓ 2 callersFunctionrun
(args: Args)
examples/stable-diffusion/main.rs:202
↓ 2 callersFunctionrun
(args: Args)
examples/controlnet/main.rs:147
↓ 2 callersMethodsample
(&self)
src/models/vae.rs:228
↓ 1 callersMethodadd_noise
(&self, original: &Tensor, noise: Tensor, timestep: usize)
src/schedulers/ddim.rs:142
↓ 1 callersMethodbpe
(&self, token: &str)
src/transformers/clip.rs:410
↓ 1 callersMethodclip_weights
(&self)
examples/stable-diffusion-img2img/main.rs:91
↓ 1 callersMethodclip_weights
(&self)
examples/stable-diffusion/main.rs:144
↓ 1 callersMethodclip_weights
(&self)
examples/stable-diffusion-inpaint/main.rs:100
↓ 1 callersMethodconvert_model_output
Convert the model output to the corresponding type that the algorithm (DPM-Solver / DPM-Solver++) needs. DPM-Solver is designed to discretize an inte
src/schedulers/dpmsolver_multistep.rs:151
↓ 1 callersMethoddpm_solver_first_order_update
One step for the first-order DPM-Solver (equivalent to DDIM). See https://arxiv.org/abs/2206.00927 for the detailed derivation.
src/schedulers/dpmsolver_multistep.rs:218
↓ 1 callersMethodencode_pad
(&self, s: &str, pad_size_to: Option<usize>)
src/transformers/clip.rs:455
↓ 1 callersFunctionensure_data_dir
(safetensors)
scripts/get_weights.py:11
↓ 1 callersFunctionfile_open
(path: P)
src/utils.rs:6
↓ 1 callersMethodget_lms_coefficient
Compute a linear multistep coefficient
src/schedulers/lms_discrete.rs:108
↓ 1 callersMethodget_prev_sample
( &self, sample: Tensor, timestep: usize, prev_timestep: isize, model_
src/schedulers/pndm.rs:164
↓ 1 callersFunctionget_safetensors
(safetensors, weight_bits)
scripts/get_weights.py:29
↓ 1 callersFunctionget_urls
(sd_version, weight_bits)
scripts/get_weights.py:53
↓ 1 callersFunctionget_vocab
(vocab_url)
scripts/get_weights.py:44
↓ 1 callersFunctionimage_preprocess
(path: T)
examples/stable-diffusion-img2img/main.rs:122
↓ 1 callersMethodimage_preprocess
(&self, path: T)
examples/controlnet/main.rs:124
↓ 1 callersFunctionintegrate
(f: F, a: f64, b: f64, target_absolute_error: f64)
src/schedulers/integrate.rs:27
↓ 1 callersFunctionintegrate_core
Integrate f(x) from [-1.0, 1.0]
src/schedulers/integrate.rs:51
↓ 1 callersMethodmultistep_dpm_solver_second_order_update
One step for the second-order multistep DPM-Solver.
src/schedulers/dpmsolver_multistep.rs:240
↓ 1 callersMethodmultistep_dpm_solver_third_order_update
One step for the third-order multistep DPM-Solver
src/schedulers/dpmsolver_multistep.rs:293
↓ 1 callersFunctionprepare_mask_and_masked_image
( path_input: T, path_mask: T, )
examples/stable-diffusion-inpaint/main.rs:131
↓ 1 callersFunctionrun
(args: Args)
examples/stable-diffusion-inpaint/main.rs:145
↓ 1 callersMethodscale
(self, c: f64)
src/schedulers/integrate.rs:18
↓ 1 callersMethodsliced_attention
( &self, query: &Tensor, key: &Tensor, value: &Tensor, sequence_length
src/models/attention.rs:96
↓ 1 callersMethodstep_plms
Step function propagating the sample with the linear multi-step method. This has one forward pass with multiple times to approximate the solution.
src/schedulers/pndm.rs:122
↓ 1 callersMethodunet_weights
(&self)
examples/stable-diffusion-img2img/main.rs:111
↓ 1 callersMethodunet_weights
(&self)
examples/stable-diffusion/main.rs:164
↓ 1 callersMethodunet_weights
(&self)
examples/stable-diffusion-inpaint/main.rs:120
↓ 1 callersMethodvae_weights
(&self)
examples/stable-diffusion-img2img/main.rs:101
↓ 1 callersMethodvae_weights
(&self)
examples/stable-diffusion/main.rs:154
↓ 1 callersMethodvae_weights
(&self)
examples/stable-diffusion-inpaint/main.rs:110
Methodadd_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/k_dpm_2_ancestral_discrete.rs:330
Methodadd_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/k_dpm_2_discrete.rs:281
Methodadd_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/lms_discrete.rs:173
Methodadd_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/euler_ancestral_discrete.rs:139
Methodadd_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: usize)
src/schedulers/ddpm.rs:182
Methodadd_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/euler_discrete.rs:147
Methodadd_noise
(&self, original: &Tensor, noise: Tensor, timestep: usize)
src/schedulers/pndm.rs:217
Methodadd_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: usize)
src/schedulers/dpmsolver_multistep.rs:400
Methodadd_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/heun_discrete.rs:214
Methodbuild_causal_attention_mask
https://github.com/huggingface/transformers/blob/674f750a57431222fa2832503a108df3badf1564/src/transformers/models/clip/modeling_clip.py#L678
src/transformers/clip.rs:684
Methodcreate
Creates a new CLIP tokenizer, this takes as input the path for the bpe vocabulary file.
src/transformers/clip.rs:351
Methoddecode
The inverse of the tokenization process, takes as input a list of tokens and returns a string that produces this tokenization.
src/transformers/clip.rs:492
Methoddefault
()
src/schedulers/k_dpm_2_ancestral_discrete.rs:19
Methoddefault
()
src/schedulers/ddim.rs:35
Methoddefault
()
src/schedulers/k_dpm_2_discrete.rs:19
Methoddefault
()
src/schedulers/lms_discrete.rs:23
Methoddefault
()
src/schedulers/euler_ancestral_discrete.rs:19
Methoddefault
()
src/schedulers/ddpm.rs:14
Methoddefault
()
src/schedulers/euler_discrete.rs:19
Methoddefault
()
src/schedulers/pndm.rs:26
Methoddefault
()
src/schedulers/dpmsolver_multistep.rs:62
Methoddefault
()
src/schedulers/heun_discrete.rs:19
Methoddefault
()
src/models/resnet.rs:30
Methoddefault
()
src/models/unet_2d_blocks.rs:90
Methoddefault
()
src/models/unet_2d.rs:33
Methoddefault
https://huggingface.co/lllyasviel/sd-controlnet-canny/blob/main/config.json
src/models/controlnet.rs:68
Methoddefault
()
src/models/attention.rs:214
Methoddefault
()
src/models/vae.rs:22
Methodencode
The main tokenization entry point, takes as input a string and returns the list of tokens.
src/transformers/clip.rs:486
Methodforward
(&self, xs: &Tensor)
src/transformers/clip.rs:18
Methodforward
(&self, xs: &Tensor)
src/models/embeddings.rs:20
Methodforward
(&self, xs: &Tensor)
src/models/unet_2d_blocks.rs:35
Methodforward
(&self, xs: &Tensor)
src/models/controlnet.rs:43
Methodforward
(&self, xs: &Tensor)
src/models/attention.rs:16
next →1–100 of 171, ranked by callers