Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TencentARC/BrushNet
/ functions
Functions
9,976 in github.com/TencentARC/BrushNet
⨍
Functions
9,976
◇
Types & classes
1,590
↳
Endpoints
3
↓ 1,593 callers
Method
pop
(self, *args, **kwargs)
src/diffusers/utils/outputs.py:101
↓ 1,207 callers
Method
to
( self, torch_device: Optional[Union[str, torch.device]] = None, torch_dtype: Optional
src/diffusers/pipelines/stable_diffusion/stable_unclip_image_normalizer.py:42
↓ 1,049 callers
Method
to
(self, torch_device: Optional[Union[str, torch.device]] = None)
examples/community/stable_unclip.py:181
↓ 925 callers
Method
from_pretrained
(cls, path, model_cls)
src/diffusers/training_utils.py:256
↓ 795 callers
Method
to
(self, device)
tests/pipelines/stable_diffusion_safe/test_safe_diffusion.py:97
↓ 767 callers
Method
info
(self, prefix)
scripts/convert_stable_diffusion_controlnet_to_onnx.py:31
↓ 718 callers
Method
set_progress_bar_config
(self, **kwargs)
src/diffusers/pipelines/pipeline_utils.py:1531
↓ 653 callers
Function
requires_backends
(obj, backends)
src/diffusers/utils/import_utils.py:527
↓ 629 callers
Method
update
(self, *args, **kwargs)
src/diffusers/utils/outputs.py:104
↓ 594 callers
Method
from_pretrained
( cls, retriever_name_or_path: str, index: Index = None, dataset: Dataset = No
examples/research_projects/rdm/retriever.py:145
↓ 477 callers
Method
to
r""" Performs Pipeline dtype and/or device conversion. A torch.dtype and torch.device are inferred from the arguments of `self.to(*arg
src/diffusers/pipelines/pipeline_utils.py:296
↓ 432 callers
Function
deprecate
(*args, take_from: Optional[Union[Dict, Any]] = None, standard_warn=True, stacklevel=2)
src/diffusers/utils/deprecation_utils.py:8
↓ 393 callers
Method
to
(self, device)
tests/pipelines/test_pipelines.py:1135
↓ 311 callers
Method
from_config
(cls, *args, **kwargs)
src/diffusers/utils/dummy_pt_objects.py:342
↓ 294 callers
Method
transpose
(self, data, **kwargs)
examples/community/dps_pipeline.py:424
↓ 287 callers
Method
set_timesteps
(self, num_inference_steps: int)
examples/community/iadb.py:51
↓ 259 callers
Method
pipeline_class
(self)
tests/pipelines/test_pipelines_common.py:581
↓ 243 callers
Method
to
r"""Move internal buffers of the ExponentialMovingAverage to `device`. Args: device: like `device` argument to `torch.Tensor.to`
examples/research_projects/intel_opts/textual_inversion_dfq/textual_inversion.py:318
↓ 242 callers
Function
randn_tensor
A helper function to create random tensors on the desired `device` with the desired `dtype`. When passing a list of generators, you can seed each
src/diffusers/utils/torch_utils.py:37
↓ 226 callers
Method
load_state_dict
r""" Args: Loads the ExponentialMovingAverage state. This method is used by accelerate during checkpointing to save the ema st
src/diffusers/training_utils.py:408
↓ 200 callers
Method
register_modules
(self, **kwargs)
src/diffusers/pipelines/pipeline_utils.py:148
↓ 187 callers
Method
step
(self, parameters: Iterable[torch.nn.Parameter])
src/diffusers/training_utils.py:300
↓ 185 callers
Method
resize
Resize image. Args: image (`PIL.Image.Image`, `np.ndarray` or `torch.Tensor`): The image input, can be a
src/diffusers/image_processor.py:330
↓ 172 callers
Method
register_to_config
(self, **kwargs)
src/diffusers/configuration_utils.py:109
↓ 160 callers
Function
is_torch_available
()
src/diffusers/utils/import_utils.py:299
↓ 157 callers
Method
set_timesteps
Sets the discrete timesteps used for the diffusion chain (to be run before inference). Args: num_inference_steps (`int`,
src/diffusers/schedulers/scheduling_lcm.py:351
↓ 151 callers
Method
scale_model_input
Ensures interchangeability with schedulers that need to scale the denoising model input depending on the current timestep. A
src/diffusers/schedulers/scheduling_lcm.py:301
↓ 147 callers
Method
sample
Args: t0: start time has shape [batch_size, *shape, 1] t1: finish time has shape [batch_size, *shape, 1]
src/diffusers/pipelines/shap_e/renderer.py:366
↓ 145 callers
Function
is_transformers_available
()
src/diffusers/utils/import_utils.py:315
↓ 144 callers
Method
maybe_convert_prompt
r""" Processes prompts that include a special token corresponding to a multi-vector textual inversion embedding to be replaced with mu
src/diffusers/loaders/textual_inversion.py:117
↓ 134 callers
Method
step
Predict the sample at the previous timestep by reversing the ODE. Core function to propagate the diffusion process from the learned m
examples/community/iadb.py:18
↓ 132 callers
Function
callback
(obj)
examples/community/tiled_upscaling.py:289
↓ 129 callers
Method
load
(self)
examples/community/stable_diffusion_tensorrt_inpaint.py:158
↓ 126 callers
Method
step
Predict the sample from the previous timestep by reversing the SDE. This function propagates the diffusion process from the learned m
src/diffusers/schedulers/scheduling_lcm.py:500
↓ 125 callers
Method
state_dict
r""" Returns the state of the ExponentialMovingAverage as a dict. This method is used by accelerate during checkpointing to save the e
src/diffusers/training_utils.py:362
↓ 120 callers
Function
floats_tensor
Creates a random float32 tensor
src/diffusers/utils/testing_utils.py:165
↓ 118 callers
Method
save_pretrained
(self, path)
src/diffusers/training_utils.py:265
↓ 114 callers
Method
maybe_free_model_hooks
r""" Function that offloads all components, removes all model hooks that were added when using `enable_model_cpu_offload` and then app
src/diffusers/pipelines/pipeline_utils.py:1011
↓ 110 callers
Method
check_over_configs
(self, time_step=0, **config)
tests/schedulers/test_schedulers.py:370
↓ 106 callers
Method
enable_model_cpu_offload
r""" Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared to `enable_sequenti
src/diffusers/pipelines/pipeline_utils.py:940
↓ 104 callers
Function
load_image
Loads `image` to a PIL Image. Args: image (`str` or `PIL.Image.Image`): The image to convert to the PIL Image format.
src/diffusers/utils/testing_utils.py:369
↓ 103 callers
Method
add_noise
( self, original_samples: torch.FloatTensor, noise: torch.FloatTensor, alpha:
examples/community/iadb.py:54
↓ 100 callers
Method
set_default_attn_processor
Disables custom attention processors and sets the default attention implementation.
src/diffusers/models/brushnet.py:593
↓ 96 callers
Method
decode
( self, h: torch.FloatTensor, force_not_quantize: bool = True, return_dict: bool = True )
src/diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py:143
↓ 96 callers
Method
encode
(self, img)
examples/community/magic_mix.py:33
↓ 94 callers
Function
enable_full_determinism
Helper function for reproducible behavior during distributed training. See - https://pytorch.org/docs/stable/notes/randomness.html for pytorc
src/diffusers/utils/testing_utils.py:804
↓ 94 callers
Method
postprocess
(self, sample: torch.FloatTensor, output_type: str = "pil")
src/diffusers/pipelines/blip_diffusion/blip_image_processing.py:301
↓ 94 callers
Function
text_encoder
()
scripts/convert_kakao_brain_unclip_to_diffusers.py:919
↓ 93 callers
Function
load_numpy
(arry: Union[str, np.ndarray], local_path: Optional[str] = None)
src/diffusers/utils/testing_utils.py:336
↓ 91 callers
Method
add_adapter
r""" Adds a new adapter to the current model for training. If no adapter name is passed, a default name is assigned to the adapter to
src/diffusers/loaders/peft.py:35
↓ 91 callers
Method
enable_attention_slicing
r""" Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor in slices to compu
src/diffusers/pipelines/pipeline_utils.py:1595
↓ 89 callers
Method
to
r"""Move internal buffers of the ExponentialMovingAverage to `device`. Args: device: like `device` argument to `torch.Tensor.to`
src/diffusers/training_utils.py:350
↓ 88 callers
Method
numpy_to_pil
Convert a NumPy image or a batch of images to a PIL image.
src/diffusers/pipelines/pipeline_utils.py:1510
↓ 87 callers
Method
save_pretrained
(self, save_directory)
examples/research_projects/rdm/retriever.py:167
↓ 86 callers
Method
decode
(self, latent)
examples/community/magic_mix.py:40
↓ 84 callers
Method
enable_xformers_memory_efficient_attention
r""" Enable memory efficient attention from [xFormers](https://facebookresearch.github.io/xformers/). When this option is enabled, yo
src/diffusers/models/modeling_utils.py:261
↓ 82 callers
Function
adjust_lora_scale_text_encoder
(text_encoder, lora_scale: float = 1.0)
src/diffusers/models/lora.py:69
↓ 82 callers
Method
dummy_model
(self)
tests/schedulers/test_schedulers.py:358
↓ 82 callers
Function
scale_lora_layers
Adjust the weightage given to the LoRA layers of the model. Args: model (`torch.nn.Module`): The model to scale.
src/diffusers/utils/peft_utils.py:100
↓ 82 callers
Method
train
r""" Function invoked when calling the pipeline for generation. Args: prompt (`str` or `List[str]`): The p
examples/community/imagic_stable_diffusion.py:109
↓ 81 callers
Method
progress_bar
(self, iterable=None, total=None)
src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py:205
↓ 80 callers
Method
head_to_batch_dim
r""" Reshape the tensor from `[batch_size, seq_len, dim]` to `[batch_size, seq_len, heads, dim // heads]` `heads` is the number of hea
src/diffusers/models/attention_processor.py:550
↓ 79 callers
Function
unscale_lora_layers
Removes the previously passed weight given to the LoRA layers of the model. Args: model (`torch.nn.Module`): The model t
src/diffusers/utils/peft_utils.py:117
↓ 75 callers
Method
numpy_to_pil
Convert a numpy image or a batch of images to a PIL image.
src/diffusers/image_processor.py:86
↓ 74 callers
Method
postprocess
Postprocess the image output from tensor to `output_type`. Args: image (`torch.FloatTensor`): The image
src/diffusers/image_processor.py:557
↓ 74 callers
Method
scale_model_input
Ensures interchangeability with schedulers that need to scale the denoising model input depending on the current timestep. A
examples/community/scheduling_ufogen.py:245
↓ 73 callers
Method
pad
(self, *inputs)
examples/community/rerender_a_video.py:1188
↓ 69 callers
Method
check_if_lora_correctly_set
Checks if the LoRA layers are correctly set with peft
tests/lora/test_lora_layers_peft.py:180
↓ 69 callers
Function
is_accelerate_available
()
src/diffusers/utils/import_utils.py:347
↓ 67 callers
Method
interpolate
Function invoked when using the prior pipeline for interpolation. Args: images_and_prompts (`List[Union[str, PIL.Image.I
src/diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py:174
↓ 67 callers
Function
numpy_cosine_similarity_distance
(a, b)
src/diffusers/utils/testing_utils.py:102
↓ 67 callers
Method
progress_bar
(self, iterable=None, total=None)
src/diffusers/pipelines/pipeline_utils.py:1516
↓ 64 callers
Function
run_command
Runs `command` with `subprocess.check_output` and will potentially return the `stdout`. Will also properly capture if an error occurred while
examples/test_examples_utils.py:31
↓ 63 callers
Function
unet
(hor)
scripts/convert_models_diffuser_to_diffusers.py:15
↓ 60 callers
Function
is_wandb_available
()
src/diffusers/utils/import_utils.py:359
↓ 60 callers
Method
state_dict
(self, *args, destination=None, prefix="", keep_vars=False)
src/diffusers/models/lora.py:111
↓ 59 callers
Method
get_input_embeddings
(self)
src/diffusers/pipelines/blip_diffusion/modeling_blip2.py:421
↓ 59 callers
Function
is_torch_version
Args: Compares the current PyTorch version to a given reference with an operation. operation (`str`): A string representa
src/diffusers/utils/import_utils.py:591
↓ 59 callers
Method
resize
Resize an image to `(size["height"], size["width"])`. Args: image (`np.ndarray`): Image to resize.
src/diffusers/pipelines/blip_diffusion/blip_image_processing.py:116
↓ 56 callers
Function
get_objects_from_module
Args: Returns a dict of object names and values in a module, while skipping private/internal objects module (ModuleType):
src/diffusers/utils/import_utils.py:645
↓ 55 callers
Method
enable_sequential_cpu_offload
r""" Offloads all models to CPU using 🤗 Accelerate, significantly reducing memory usage. When called, the state dicts of all `torch.nn
src/diffusers/pipelines/pipeline_utils.py:1030
↓ 55 callers
Method
encode
(self, x: torch.FloatTensor, return_dict: bool = True)
src/diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py:133
↓ 55 callers
Function
is_compiled_module
Check whether the module was compiled with torch.compile()
src/diffusers/utils/torch_utils.py:85
↓ 55 callers
Method
step
(self, parameters)
examples/research_projects/intel_opts/textual_inversion_dfq/textual_inversion.py:290
↓ 54 callers
Function
load_image
Loads `image` to a PIL Image. Args: image (`str` or `PIL.Image.Image`): The image to convert to the PIL Image format.
src/diffusers/utils/loading_utils.py:9
↓ 54 callers
Function
set_seed
Args: Helper function for reproducible behavior to set the seed in `random`, `numpy`, `torch`. seed (`int`): The seed to set.
src/diffusers/training_utils.py:34
↓ 53 callers
Function
get_logger
Return a logger with the specified name. This function is not supposed to be directly accessed unless you are writing a custom diffusers mod
src/diffusers/utils/logging.py:111
↓ 53 callers
Method
to
(self, device)
examples/consistency_distillation/train_lcm_distill_sd_wds.py:401
↓ 52 callers
Function
check_min_version
(min_version)
src/diffusers/utils/__init__.py:114
↓ 51 callers
Method
add_noise
( self, original_samples: torch.FloatTensor, noise: torch.FloatTensor, timeste
src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py:267
↓ 50 callers
Method
device
`torch.device`: The device on which the module is (assuming that all the module parameters are on the same device).
src/diffusers/models/modeling_utils.py:877
↓ 50 callers
Method
get_dummy_inputs
(self, device, seed=0)
tests/pipelines/test_pipelines_common.py:593
↓ 50 callers
Function
get_scheduler
Unified API to get any scheduler from its name. Args: name (`str` or `SchedulerType`): The name of the scheduler to use.
src/diffusers/optimization.py:289
↓ 49 callers
Method
enable_gradient_checkpointing
Activates gradient checkpointing for the current model (may be referred to as *activation checkpointing* or *checkpoint activations*
src/diffusers/models/modeling_utils.py:227
↓ 46 callers
Method
preprocess
Preprocess an image or batch of images. Args: images (`ImageInput`): Image to preprocess. Expects a sing
src/diffusers/pipelines/blip_diffusion/blip_image_processing.py:164
↓ 45 callers
Method
load_lora_weights
Load LoRA weights specified in `pretrained_model_name_or_path_or_dict` into `self.unet` and `self.text_encoder`. All kwargs
src/diffusers/loaders/lora.py:80
↓ 45 callers
Method
save_config
Save a configuration object to the directory specified in `save_directory` so that it can be reloaded using the [`~ConfigMixin.from_c
src/diffusers/configuration_utils.py:144
↓ 44 callers
Method
apply
(self, pipe, i, t, callback_kwargs)
tests/pipelines/stable_diffusion/test_stable_diffusion.py:722
↓ 44 callers
Function
is_xformers_available
()
src/diffusers/utils/import_utils.py:343
↓ 39 callers
Method
_test_inference_batch_single_identical
( self, batch_size=2, expected_max_diff=1e-4, additional_params_copy_to_batche
tests/pipelines/test_pipelines_common.py:781
next →
1–100 of 9,976, ranked by callers