Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/LaurentMazare/diffusers-rs
/ functions
Functions
171 in github.com/LaurentMazare/diffusers-rs
⨍
Functions
171
◇
Types & classes
91
↓ 16 callers
Method
get
(&self, name: &str)
src/utils.rs:25
↓ 12 callers
Method
forward
(&self, xs: &Tensor, temb: Option<&Tensor>)
src/models/resnet.rs:77
↓ 10 callers
Method
encode
Returns the distribution in the latent space.
src/models/vae.rs:276
↓ 6 callers
Method
decode
Takes as input some sampled values.
src/models/vae.rs:282
↓ 6 callers
Function
interp
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 callers
Method
state_in_first_order
(&self)
src/schedulers/k_dpm_2_discrete.rs:209
↓ 5 callers
Method
forward
(&self, xs: &Tensor, timestep: f64, encoder_hidden_states: &Tensor)
src/models/unet_2d.rs:243
↓ 5 callers
Method
state_in_first_order
(&self)
src/schedulers/k_dpm_2_ancestral_discrete.rs:254
↓ 5 callers
Method
state_in_first_order
(&self)
src/schedulers/heun_discrete.rs:145
↓ 4 callers
Function
betas_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 callers
Method
build_clip_transformer
( &self, clip_weights: &str, device: tch::Device, )
src/pipelines/stable_diffusion.rs:179
↓ 4 callers
Method
build_scheduler
(&self, n_steps: usize)
src/pipelines/stable_diffusion.rs:175
↓ 4 callers
Method
build_unet
( &self, unet_weights: &str, device: Device, in_channels: i64, )
src/pipelines/stable_diffusion.rs:162
↓ 4 callers
Method
build_vae
( &self, vae_weights: &str, device: Device, )
src/pipelines/stable_diffusion.rs:150
↓ 4 callers
Method
scale_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 callers
Method
step
Performs a backward step during inference.
src/schedulers/ddim.rs:99
↓ 4 callers
Method
timesteps
(&self)
src/schedulers/ddim.rs:88
↓ 3 callers
Method
index_for_timestep
(&self, timestep: f64)
src/schedulers/k_dpm_2_ancestral_discrete.rs:223
↓ 3 callers
Method
index_for_timestep
(&self, timestep: f64)
src/schedulers/k_dpm_2_discrete.rs:180
↓ 3 callers
Method
index_for_timestep
(&self, timestep: f64)
src/schedulers/heun_discrete.rs:119
↓ 3 callers
Method
init_noise_sigma
(&self)
src/schedulers/ddim.rs:149
↓ 3 callers
Method
reshape_heads_to_batch_dim
(&self, xs: &Tensor)
src/models/attention.rs:82
↓ 3 callers
Method
shape
(&self, xs: &Tensor, seq_len: i64, bsz: i64)
src/transformers/clip.rs:556
↓ 3 callers
Method
transpose_for_scores
(&self, xs: Tensor)
src/models/attention.rs:352
↓ 2 callers
Method
attention
(&self, query: &Tensor, key: &Tensor, value: &Tensor)
src/models/attention.rs:128
↓ 2 callers
Method
forward_with_additional_residuals
( &self, xs: &Tensor, timestep: f64, encoder_hidden_states: &Tensor, d
src/models/unet_2d.rs:247
↓ 2 callers
Method
get_variance
(&self, timestep: usize)
src/schedulers/ddpm.rs:93
↓ 2 callers
Function
output_filename
( basename: &str, sample_idx: i64, num_samples: i64, timestep_idx: Option<usize>, )
examples/stable-diffusion/main.rs:175
↓ 2 callers
Function
output_filename
( basename: &str, sample_idx: i64, num_samples: i64, timestep_idx: Option<usize>, )
examples/controlnet/main.rs:91
↓ 2 callers
Method
reshape_batch_dim_to_heads
(&self, xs: &Tensor)
src/models/attention.rs:89
↓ 2 callers
Function
run
(args: Args)
examples/stable-diffusion-img2img/main.rs:131
↓ 2 callers
Function
run
(args: Args)
examples/stable-diffusion/main.rs:202
↓ 2 callers
Function
run
(args: Args)
examples/controlnet/main.rs:147
↓ 2 callers
Method
sample
(&self)
src/models/vae.rs:228
↓ 1 callers
Method
add_noise
(&self, original: &Tensor, noise: Tensor, timestep: usize)
src/schedulers/ddim.rs:142
↓ 1 callers
Method
bpe
(&self, token: &str)
src/transformers/clip.rs:410
↓ 1 callers
Method
clip_weights
(&self)
examples/stable-diffusion-img2img/main.rs:91
↓ 1 callers
Method
clip_weights
(&self)
examples/stable-diffusion/main.rs:144
↓ 1 callers
Method
clip_weights
(&self)
examples/stable-diffusion-inpaint/main.rs:100
↓ 1 callers
Method
convert_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 callers
Method
dpm_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 callers
Method
encode_pad
(&self, s: &str, pad_size_to: Option<usize>)
src/transformers/clip.rs:455
↓ 1 callers
Function
ensure_data_dir
(safetensors)
scripts/get_weights.py:11
↓ 1 callers
Function
file_open
(path: P)
src/utils.rs:6
↓ 1 callers
Method
get_lms_coefficient
Compute a linear multistep coefficient
src/schedulers/lms_discrete.rs:108
↓ 1 callers
Method
get_prev_sample
( &self, sample: Tensor, timestep: usize, prev_timestep: isize, model_
src/schedulers/pndm.rs:164
↓ 1 callers
Function
get_safetensors
(safetensors, weight_bits)
scripts/get_weights.py:29
↓ 1 callers
Function
get_urls
(sd_version, weight_bits)
scripts/get_weights.py:53
↓ 1 callers
Function
get_vocab
(vocab_url)
scripts/get_weights.py:44
↓ 1 callers
Function
image_preprocess
(path: T)
examples/stable-diffusion-img2img/main.rs:122
↓ 1 callers
Method
image_preprocess
(&self, path: T)
examples/controlnet/main.rs:124
↓ 1 callers
Function
integrate
(f: F, a: f64, b: f64, target_absolute_error: f64)
src/schedulers/integrate.rs:27
↓ 1 callers
Function
integrate_core
Integrate f(x) from [-1.0, 1.0]
src/schedulers/integrate.rs:51
↓ 1 callers
Method
multistep_dpm_solver_second_order_update
One step for the second-order multistep DPM-Solver.
src/schedulers/dpmsolver_multistep.rs:240
↓ 1 callers
Method
multistep_dpm_solver_third_order_update
One step for the third-order multistep DPM-Solver
src/schedulers/dpmsolver_multistep.rs:293
↓ 1 callers
Function
prepare_mask_and_masked_image
( path_input: T, path_mask: T, )
examples/stable-diffusion-inpaint/main.rs:131
↓ 1 callers
Function
run
(args: Args)
examples/stable-diffusion-inpaint/main.rs:145
↓ 1 callers
Method
scale
(self, c: f64)
src/schedulers/integrate.rs:18
↓ 1 callers
Method
sliced_attention
( &self, query: &Tensor, key: &Tensor, value: &Tensor, sequence_length
src/models/attention.rs:96
↓ 1 callers
Method
step_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 callers
Method
unet_weights
(&self)
examples/stable-diffusion-img2img/main.rs:111
↓ 1 callers
Method
unet_weights
(&self)
examples/stable-diffusion/main.rs:164
↓ 1 callers
Method
unet_weights
(&self)
examples/stable-diffusion-inpaint/main.rs:120
↓ 1 callers
Method
vae_weights
(&self)
examples/stable-diffusion-img2img/main.rs:101
↓ 1 callers
Method
vae_weights
(&self)
examples/stable-diffusion/main.rs:154
↓ 1 callers
Method
vae_weights
(&self)
examples/stable-diffusion-inpaint/main.rs:110
Method
add_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/k_dpm_2_ancestral_discrete.rs:330
Method
add_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/k_dpm_2_discrete.rs:281
Method
add_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/lms_discrete.rs:173
Method
add_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/euler_ancestral_discrete.rs:139
Method
add_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: usize)
src/schedulers/ddpm.rs:182
Method
add_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/euler_discrete.rs:147
Method
add_noise
(&self, original: &Tensor, noise: Tensor, timestep: usize)
src/schedulers/pndm.rs:217
Method
add_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: usize)
src/schedulers/dpmsolver_multistep.rs:400
Method
add_noise
(&self, original_samples: &Tensor, noise: Tensor, timestep: f64)
src/schedulers/heun_discrete.rs:214
Method
build_causal_attention_mask
https://github.com/huggingface/transformers/blob/674f750a57431222fa2832503a108df3badf1564/src/transformers/models/clip/modeling_clip.py#L678
src/transformers/clip.rs:684
Method
create
Creates a new CLIP tokenizer, this takes as input the path for the bpe vocabulary file.
src/transformers/clip.rs:351
Method
decode
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
Method
default
()
src/schedulers/k_dpm_2_ancestral_discrete.rs:19
Method
default
()
src/schedulers/ddim.rs:35
Method
default
()
src/schedulers/k_dpm_2_discrete.rs:19
Method
default
()
src/schedulers/lms_discrete.rs:23
Method
default
()
src/schedulers/euler_ancestral_discrete.rs:19
Method
default
()
src/schedulers/ddpm.rs:14
Method
default
()
src/schedulers/euler_discrete.rs:19
Method
default
()
src/schedulers/pndm.rs:26
Method
default
()
src/schedulers/dpmsolver_multistep.rs:62
Method
default
()
src/schedulers/heun_discrete.rs:19
Method
default
()
src/models/resnet.rs:30
Method
default
()
src/models/unet_2d_blocks.rs:90
Method
default
()
src/models/unet_2d.rs:33
Method
default
https://huggingface.co/lllyasviel/sd-controlnet-canny/blob/main/config.json
src/models/controlnet.rs:68
Method
default
()
src/models/attention.rs:214
Method
default
()
src/models/vae.rs:22
Method
encode
The main tokenization entry point, takes as input a string and returns the list of tokens.
src/transformers/clip.rs:486
Method
forward
(&self, xs: &Tensor)
src/transformers/clip.rs:18
Method
forward
(&self, xs: &Tensor)
src/models/embeddings.rs:20
Method
forward
(&self, xs: &Tensor)
src/models/unet_2d_blocks.rs:35
Method
forward
(&self, xs: &Tensor)
src/models/controlnet.rs:43
Method
forward
(&self, xs: &Tensor)
src/models/attention.rs:16
next →
1–100 of 171, ranked by callers