MCPcopy Create free account

hub / github.com/TencentARC/BrushNet / functions

Functions9,976 in github.com/TencentARC/BrushNet

↓ 1,593 callersMethodpop
(self, *args, **kwargs)
src/diffusers/utils/outputs.py:101
↓ 1,207 callersMethodto
( 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 callersMethodto
(self, torch_device: Optional[Union[str, torch.device]] = None)
examples/community/stable_unclip.py:181
↓ 925 callersMethodfrom_pretrained
(cls, path, model_cls)
src/diffusers/training_utils.py:256
↓ 795 callersMethodto
(self, device)
tests/pipelines/stable_diffusion_safe/test_safe_diffusion.py:97
↓ 767 callersMethodinfo
(self, prefix)
scripts/convert_stable_diffusion_controlnet_to_onnx.py:31
↓ 718 callersMethodset_progress_bar_config
(self, **kwargs)
src/diffusers/pipelines/pipeline_utils.py:1531
↓ 653 callersFunctionrequires_backends
(obj, backends)
src/diffusers/utils/import_utils.py:527
↓ 629 callersMethodupdate
(self, *args, **kwargs)
src/diffusers/utils/outputs.py:104
↓ 594 callersMethodfrom_pretrained
( cls, retriever_name_or_path: str, index: Index = None, dataset: Dataset = No
examples/research_projects/rdm/retriever.py:145
↓ 477 callersMethodto
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 callersFunctiondeprecate
(*args, take_from: Optional[Union[Dict, Any]] = None, standard_warn=True, stacklevel=2)
src/diffusers/utils/deprecation_utils.py:8
↓ 393 callersMethodto
(self, device)
tests/pipelines/test_pipelines.py:1135
↓ 311 callersMethodfrom_config
(cls, *args, **kwargs)
src/diffusers/utils/dummy_pt_objects.py:342
↓ 294 callersMethodtranspose
(self, data, **kwargs)
examples/community/dps_pipeline.py:424
↓ 287 callersMethodset_timesteps
(self, num_inference_steps: int)
examples/community/iadb.py:51
↓ 259 callersMethodpipeline_class
(self)
tests/pipelines/test_pipelines_common.py:581
↓ 243 callersMethodto
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 callersFunctionrandn_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 callersMethodload_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 callersMethodregister_modules
(self, **kwargs)
src/diffusers/pipelines/pipeline_utils.py:148
↓ 187 callersMethodstep
(self, parameters: Iterable[torch.nn.Parameter])
src/diffusers/training_utils.py:300
↓ 185 callersMethodresize
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 callersMethodregister_to_config
(self, **kwargs)
src/diffusers/configuration_utils.py:109
↓ 160 callersFunctionis_torch_available
()
src/diffusers/utils/import_utils.py:299
↓ 157 callersMethodset_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 callersMethodscale_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 callersMethodsample
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 callersFunctionis_transformers_available
()
src/diffusers/utils/import_utils.py:315
↓ 144 callersMethodmaybe_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 callersMethodstep
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 callersFunctioncallback
(obj)
examples/community/tiled_upscaling.py:289
↓ 129 callersMethodload
(self)
examples/community/stable_diffusion_tensorrt_inpaint.py:158
↓ 126 callersMethodstep
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 callersMethodstate_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 callersFunctionfloats_tensor
Creates a random float32 tensor
src/diffusers/utils/testing_utils.py:165
↓ 118 callersMethodsave_pretrained
(self, path)
src/diffusers/training_utils.py:265
↓ 114 callersMethodmaybe_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 callersMethodcheck_over_configs
(self, time_step=0, **config)
tests/schedulers/test_schedulers.py:370
↓ 106 callersMethodenable_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 callersFunctionload_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 callersMethodadd_noise
( self, original_samples: torch.FloatTensor, noise: torch.FloatTensor, alpha:
examples/community/iadb.py:54
↓ 100 callersMethodset_default_attn_processor
Disables custom attention processors and sets the default attention implementation.
src/diffusers/models/brushnet.py:593
↓ 96 callersMethoddecode
( self, h: torch.FloatTensor, force_not_quantize: bool = True, return_dict: bool = True )
src/diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py:143
↓ 96 callersMethodencode
(self, img)
examples/community/magic_mix.py:33
↓ 94 callersFunctionenable_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 callersMethodpostprocess
(self, sample: torch.FloatTensor, output_type: str = "pil")
src/diffusers/pipelines/blip_diffusion/blip_image_processing.py:301
↓ 94 callersFunctiontext_encoder
()
scripts/convert_kakao_brain_unclip_to_diffusers.py:919
↓ 93 callersFunctionload_numpy
(arry: Union[str, np.ndarray], local_path: Optional[str] = None)
src/diffusers/utils/testing_utils.py:336
↓ 91 callersMethodadd_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 callersMethodenable_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 callersMethodto
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 callersMethodnumpy_to_pil
Convert a NumPy image or a batch of images to a PIL image.
src/diffusers/pipelines/pipeline_utils.py:1510
↓ 87 callersMethodsave_pretrained
(self, save_directory)
examples/research_projects/rdm/retriever.py:167
↓ 86 callersMethoddecode
(self, latent)
examples/community/magic_mix.py:40
↓ 84 callersMethodenable_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 callersFunctionadjust_lora_scale_text_encoder
(text_encoder, lora_scale: float = 1.0)
src/diffusers/models/lora.py:69
↓ 82 callersMethoddummy_model
(self)
tests/schedulers/test_schedulers.py:358
↓ 82 callersFunctionscale_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 callersMethodtrain
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 callersMethodprogress_bar
(self, iterable=None, total=None)
src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py:205
↓ 80 callersMethodhead_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 callersFunctionunscale_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 callersMethodnumpy_to_pil
Convert a numpy image or a batch of images to a PIL image.
src/diffusers/image_processor.py:86
↓ 74 callersMethodpostprocess
Postprocess the image output from tensor to `output_type`. Args: image (`torch.FloatTensor`): The image
src/diffusers/image_processor.py:557
↓ 74 callersMethodscale_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 callersMethodpad
(self, *inputs)
examples/community/rerender_a_video.py:1188
↓ 69 callersMethodcheck_if_lora_correctly_set
Checks if the LoRA layers are correctly set with peft
tests/lora/test_lora_layers_peft.py:180
↓ 69 callersFunctionis_accelerate_available
()
src/diffusers/utils/import_utils.py:347
↓ 67 callersMethodinterpolate
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 callersFunctionnumpy_cosine_similarity_distance
(a, b)
src/diffusers/utils/testing_utils.py:102
↓ 67 callersMethodprogress_bar
(self, iterable=None, total=None)
src/diffusers/pipelines/pipeline_utils.py:1516
↓ 64 callersFunctionrun_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 callersFunctionunet
(hor)
scripts/convert_models_diffuser_to_diffusers.py:15
↓ 60 callersFunctionis_wandb_available
()
src/diffusers/utils/import_utils.py:359
↓ 60 callersMethodstate_dict
(self, *args, destination=None, prefix="", keep_vars=False)
src/diffusers/models/lora.py:111
↓ 59 callersMethodget_input_embeddings
(self)
src/diffusers/pipelines/blip_diffusion/modeling_blip2.py:421
↓ 59 callersFunctionis_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 callersMethodresize
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 callersFunctionget_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 callersMethodenable_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 callersMethodencode
(self, x: torch.FloatTensor, return_dict: bool = True)
src/diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py:133
↓ 55 callersFunctionis_compiled_module
Check whether the module was compiled with torch.compile()
src/diffusers/utils/torch_utils.py:85
↓ 55 callersMethodstep
(self, parameters)
examples/research_projects/intel_opts/textual_inversion_dfq/textual_inversion.py:290
↓ 54 callersFunctionload_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 callersFunctionset_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 callersFunctionget_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 callersMethodto
(self, device)
examples/consistency_distillation/train_lcm_distill_sd_wds.py:401
↓ 52 callersFunctioncheck_min_version
(min_version)
src/diffusers/utils/__init__.py:114
↓ 51 callersMethodadd_noise
( self, original_samples: torch.FloatTensor, noise: torch.FloatTensor, timeste
src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py:267
↓ 50 callersMethoddevice
`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 callersMethodget_dummy_inputs
(self, device, seed=0)
tests/pipelines/test_pipelines_common.py:593
↓ 50 callersFunctionget_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 callersMethodenable_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 callersMethodpreprocess
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 callersMethodload_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 callersMethodsave_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 callersMethodapply
(self, pipe, i, t, callback_kwargs)
tests/pipelines/stable_diffusion/test_stable_diffusion.py:722
↓ 44 callersFunctionis_xformers_available
()
src/diffusers/utils/import_utils.py:343
↓ 39 callersMethod_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