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
↓ 39 callers
Method
get_velocity
( self, sample: torch.FloatTensor, noise: torch.FloatTensor, timesteps: torch.IntTensor )
examples/community/scheduling_ufogen.py:488
↓ 39 callers
Function
torch_all_close
(a, b, *args, **kwargs)
src/diffusers/utils/testing_utils.py:94
↓ 38 callers
Method
_get_variance
(self, timestep, prev_timestep)
src/diffusers/schedulers/scheduling_tcd.py:319
↓ 38 callers
Method
from_pipe
r""" Instantiates a text-to-image Pytorch diffusion pipeline from another instantiated diffusion pipeline class. The from_pipe() meth
src/diffusers/pipelines/auto_pipeline.py:338
↓ 38 callers
Method
to_tuple
Convert self to a tuple containing all the attributes/keys that are not `None`.
src/diffusers/utils/outputs.py:133
↓ 37 callers
Function
convert_state_dict_to_diffusers
r""" Converts a state dict to new diffusers format. The state dict can be from previous diffusers format (`OLD_DIFFUSERS`), or PEFT format (`P
src/diffusers/utils/state_dict_utils.py:193
↓ 35 callers
Method
_test_attention_slicing_forward_pass
( self, test_max_difference=True, test_mean_pixel_difference=True, expected_max_diff=1e-3 )
tests/pipelines/test_pipelines_common.py:1015
↓ 35 callers
Method
get_dummy_components
(self)
tests/pipelines/test_pipelines_common.py:587
↓ 35 callers
Function
is_flax_available
()
src/diffusers/utils/import_utils.py:311
↓ 35 callers
Method
set_processor
r""" Set the attention processor to use. Args: processor (`AttnProcessor`): The attention processor to us
src/diffusers/models/attention_processor.py:380
↓ 34 callers
Method
progress_bar
(self, iterable=None, total=None)
src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_combined.py:141
↓ 32 callers
Function
assign_to_checkpoint
This does the final conversion step: take locally converted weights and apply a global renaming to them. It splits attention layers, and take
src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py:168
↓ 32 callers
Method
from_single_file
r""" Instantiate a [`DiffusionPipeline`] from pretrained pipeline weights saved in the `.ckpt` or `.safetensors` format. The pipeline
src/diffusers/loaders/single_file.py:158
↓ 32 callers
Method
preprocess
Preprocess the image input. Args: image (`pipeline_image_input`): The image input, accepted formats are
src/diffusers/image_processor.py:446
↓ 31 callers
Method
encode
(self, text, *args, vector_shuffle=False, prop_tokens_to_load=1.0, **kwargs)
examples/research_projects/multi_token_textual_inversion/multi_token_clip.py:96
↓ 31 callers
Method
prepare_attention_mask
r""" Prepare the attention mask for the attention computation. Args: attention_mask (`torch.Tensor`): The
src/diffusers/models/attention_processor.py:624
↓ 31 callers
Method
to
(self, device)
examples/consistency_distillation/train_lcm_distill_sdxl_wds.py:434
↓ 29 callers
Function
is_invisible_watermark_available
()
src/diffusers/utils/import_utils.py:383
↓ 29 callers
Method
to
(self, device)
examples/consistency_distillation/train_lcm_distill_lora_sdxl_wds.py:412
↓ 28 callers
Method
load_config
r""" Load a model or scheduler configuration. Parameters: pretrained_model_name_or_path (`str` or `os.PathLike`, *optiona
src/diffusers/configuration_utils.py:287
↓ 28 callers
Method
mode
(self)
src/diffusers/models/vae_flax.py:722
↓ 28 callers
Function
prepare_mask_and_masked_image
Prepares a pair (image, mask) to be consumed by the Stable Diffusion pipeline. This means that those inputs will be converted to ``torch.Tens
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py:40
↓ 28 callers
Method
set_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
src/diffusers/models/brushnet.py:558
↓ 27 callers
Method
__init__
( self, in_channels: int, prev_output_channel: int, out_channels: int,
src/diffusers/models/unets/unet_2d_blocks.py:2643
↓ 27 callers
Method
_test_xformers_attention_forwardGenerator_pass
( self, test_max_difference=True, test_mean_pixel_difference=True, expected_max_diff=1e-4 )
tests/pipelines/test_pipelines_common.py:1111
↓ 27 callers
Function
assert_mean_pixel_difference
(image, expected_image, expected_max_diff=10)
tests/pipelines/test_pipelines_common.py:1610
↓ 27 callers
Method
copy_to
Copy current averaged parameters into given collection of parameters. Args: parameters: Iterable of `torch.nn.Parameter`;
examples/research_projects/intel_opts/textual_inversion_dfq/textual_inversion.py:305
↓ 27 callers
Method
decode
(self, encodings_and_masks, input_tokens, noise_time)
src/diffusers/pipelines/deprecated/spectrogram_diffusion/pipeline_spectrogram_diffusion.py:114
↓ 27 callers
Function
get_activation
Helper function to get activation function from string. Args: act_fn (str): Name of activation function. Returns: nn.Module:
src/diffusers/models/activations.py:33
↓ 27 callers
Method
norm_encoder_hidden_states
r""" Normalize the encoder hidden states. Requires `self.norm_cross` to be specified when constructing the `Attention` class.
src/diffusers/models/attention_processor.py:671
↓ 26 callers
Method
load_textual_inversion
r""" Load Textual Inversion embeddings into the text encoder of [`StableDiffusionPipeline`] (both 🤗 Diffusers and Automatic1111 format
src/diffusers/loaders/textual_inversion.py:266
↓ 26 callers
Method
pop
(self, *args, **kwargs)
src/diffusers/configuration_utils.py:69
↓ 26 callers
Method
preprocess
(self, image, scale, resample)
examples/custom_diffusion/train_custom_diffusion.py:238
↓ 26 callers
Method
save_lora_weights
( self, save_directory: Union[str, os.PathLike], unet_lora_layers: Dict[str, Union[tor
examples/community/pipeline_demofusion_sdxl.py:1342
↓ 25 callers
Function
assert_param_count
(model_1, model_2)
scripts/convert_if.py:1176
↓ 25 callers
Function
to_np
(tensor)
tests/pipelines/test_pipelines_common.py:56
↓ 24 callers
Method
batch_to_head_dim
r""" Reshape the tensor from `[batch_size, seq_len, dim]` to `[batch_size // heads, seq_len, dim * heads]`. `heads` is the number of h
src/diffusers/models/attention_processor.py:533
↓ 24 callers
Method
create_state
(self, common: Optional[CommonSchedulerState] = None)
src/diffusers/schedulers/scheduling_pndm_flax.py:143
↓ 23 callers
Method
from_pretrained
r""" Instantiate a pretrained MultiControlNet model from multiple pre-trained controlnet models. The model is set in evaluation mode
src/diffusers/pipelines/controlnet/multicontrolnet.py:118
↓ 23 callers
Method
optimize
(self, onnx_graph)
examples/community/stable_diffusion_tensorrt_inpaint.py:451
↓ 23 callers
Method
pil_to_numpy
Convert a PIL image or a list of PIL images to NumPy arrays.
src/diffusers/image_processor.py:102
↓ 23 callers
Method
to
(self, device)
examples/consistency_distillation/train_lcm_distill_lora_sd_wds.py:424
↓ 22 callers
Method
decode
( self, h: torch.FloatTensor, force_not_quantize: bool = False, return_dict: bool = True, shape=None
src/diffusers/models/vq_model.py:140
↓ 22 callers
Method
download
r""" Download and cache a PyTorch diffusion pipeline from pretrained pipeline weights. Parameters: pretrained_model_name
src/diffusers/pipelines/pipeline_utils.py:1086
↓ 22 callers
Method
to
(self, device)
examples/consistency_distillation/train_lcm_distill_lora_sdxl.py:92
↓ 21 callers
Method
get_attention_scores
r""" Compute the attention scores. Args: query (`torch.Tensor`): The query tensor. key (`torch.Tensor`): The
src/diffusers/models/attention_processor.py:577
↓ 21 callers
Method
get_dummy_components
(self, scheduler_cls=None)
tests/lora/test_lora_layers_peft.py:93
↓ 21 callers
Method
get_dummy_inputs
(self, device, seed=0)
tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_inpaint.py:172
↓ 21 callers
Method
get_dummy_inputs
(self, device, seed=0)
tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl.py:151
↓ 21 callers
Method
get_dummy_inputs
(self, device, seed=0)
tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py:125
↓ 20 callers
Method
__init__
(self, num_channels: int, flip_sin_to_cos: bool, downscale_freq_shift: float)
src/diffusers/models/embeddings.py:241
↓ 20 callers
Method
fuse_lora
r""" Fuses the LoRA parameters into the original parameters of the corresponding blocks. <Tip warning={true}> This is an exp
src/diffusers/loaders/lora.py:838
↓ 20 callers
Method
get_dummy_components
(self, time_cond_proj_dim=None)
tests/pipelines/stable_diffusion/test_stable_diffusion.py:125
↓ 20 callers
Method
get_dummy_inputs
(self, with_generator=True)
tests/lora/test_lora_layers_peft.py:149
↓ 20 callers
Method
get_dummy_inputs
(self, device, seed=0)
tests/pipelines/stable_diffusion/test_stable_diffusion.py:183
↓ 20 callers
Function
is_onnx_available
()
src/diffusers/utils/import_utils.py:327
↓ 20 callers
Function
load_or_create_model_card
Loads or creates a model card. Args: repo_id_or_path (`str`): The repo id (e.g., "runwayml/stable-diffusion-v1-5") or lo
src/diffusers/utils/hub_utils.py:96
↓ 20 callers
Function
populate_model_card
Populates the `model_card` with library name and optional tags.
src/diffusers/utils/hub_utils.py:165
↓ 20 callers
Method
prepare_init_args_and_inputs_for_common
(self)
tests/models/unets/test_models_unet_2d_condition.py:266
↓ 20 callers
Method
test_output
(self)
tests/models/unets/test_unet_2d_blocks.py:208
↓ 19 callers
Method
crop
(self, im, new_width, new_height)
src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py:508
↓ 19 callers
Method
load_ip_adapter
Parameters: pretrained_model_name_or_path_or_dict (`str` or `List[str]` or `os.PathLike` or `List[os.PathLike]` or `dict` or `Lis
src/diffusers/loaders/ip_adapter.py:50
↓ 19 callers
Method
load_lora_weights
(self, pretrained_model_name_or_path_or_dict: Union[str, Dict[str, torch.Tensor]], **kwargs)
examples/community/pipeline_demofusion_sdxl.py:1284
↓ 19 callers
Method
normalize
Normalize an image array to [-1,1].
src/diffusers/image_processor.py:133
↓ 19 callers
Function
to_np
(tensor)
tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py:39
↓ 18 callers
Method
apply_watermark
(self, images: List[PIL.Image.Image], sample_size=None)
src/diffusers/pipelines/deepfloyd_if/watermark.py:19
↓ 18 callers
Method
get_dummy_inputs
(self, for_image_to_image=False, for_inpainting=False, for_sdxl=False, for_masks=False)
tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py:68
↓ 18 callers
Method
get_inputs
(self, device, generator_device="cpu", dtype=torch.float32, seed=0)
tests/pipelines/stable_diffusion/test_stable_diffusion.py:768
↓ 18 callers
Method
prepare_init_args_and_inputs_for_common
(self)
tests/models/autoencoders/test_models_vq.py:55
↓ 17 callers
Function
assign_to_checkpoint
This does the final conversion step: take locally converted weights and apply a global renaming to them. It splits attention layers, and take
scripts/convert_svd_to_diffusers.py:117
↓ 17 callers
Method
check_over_forward
(self, time_step=0, **forward_kwargs)
tests/schedulers/test_schedulers.py:431
↓ 17 callers
Method
get_dummy_components
(self, skip_first_text_encoder=False, time_cond_proj_dim=None)
tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_inpaint.py:75
↓ 17 callers
Method
set_adapters
( self, adapter_names: Union[List[str], str], adapter_weights: Optional[List[float]] =
src/diffusers/loaders/lora.py:1033
↓ 17 callers
Method
step_plms
Predict the sample from the previous timestep by reversing the SDE. This function propagates the sample with the linear multistep met
src/diffusers/schedulers/scheduling_pndm.py:321
↓ 17 callers
Method
step_prk
Predict the sample from the previous timestep by reversing the SDE. This function propagates the sample with the Runge-Kutta method.
src/diffusers/schedulers/scheduling_pndm.py:261
↓ 17 callers
Function
to_np
(tensor)
tests/pipelines/pia/test_pia.py:23
↓ 17 callers
Method
walk
Walks through a series of prompts and seeds, interpolating between them and saving the results to disk. Args: prompts (`
examples/community/interpolate_stable_diffusion.py:399
↓ 16 callers
Method
__init__
(self, in_channels: int, out_channels: int, mid_channels: Optional[int] = None)
src/diffusers/models/unets/unet_1d_blocks.py:562
↓ 16 callers
Method
__init__
( self, in_channels: int, prev_output_channel: int, out_channels: int,
src/diffusers/models/unets/unet_3d_blocks.py:828
↓ 16 callers
Function
assign_to_checkpoint
This does the final conversion step: take locally converted weights and apply a global renaming to them. It splits attention layers, and take
scripts/convert_if.py:649
↓ 16 callers
Method
get_dummy_components
(self, time_cond_proj_dim=None)
tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl.py:79
↓ 16 callers
Method
get_dummy_input
( self, include_temb=True, include_res_hidden_states_tuple=False, include_enco
tests/models/unets/test_unet_blocks_common.py:46
↓ 16 callers
Method
inputs_dict
(self, seed=None)
tests/models/autoencoders/test_models_vae.py:363
↓ 16 callers
Function
is_transformers_version
Args: Compares the current Transformers version to a given reference with an operation. operation (`str`): A string repre
src/diffusers/utils/import_utils.py:603
↓ 16 callers
Function
train_transforms
(img)
examples/kandinsky2_2/text_to_image/train_text_to_image_decoder.py:647
↓ 15 callers
Function
_get_task_class
(mapping, pipeline_class_name, throw_error_if_not_exist: bool = True)
src/diffusers/pipelines/auto_pipeline.py:148
↓ 15 callers
Method
_sigma_to_alpha_sigma_t
(self, sigma)
src/diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py:358
↓ 15 callers
Method
_sigma_to_alpha_sigma_t
(self, sigma)
src/diffusers/schedulers/scheduling_dpmsolver_multistep.py:444
↓ 15 callers
Function
assign_to_checkpoint
This does the final conversion step: take locally converted weights and apply a global renaming to them. It splits attention layers, and take
scripts/convert_i2vgen_to_diffusers.py:28
↓ 15 callers
Function
assign_to_checkpoint
This does the final conversion step: take locally converted weights and apply a global renaming to them. It splits attention layers, and take
scripts/convert_ms_text_to_video_to_diffusers.py:24
↓ 15 callers
Method
get_dummy_inputs
(self, device, seed=0)
tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_img2img.py:189
↓ 15 callers
Method
get_image_encoder
(self, repo_id, subfolder)
tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py:58
↓ 15 callers
Method
get_processor
r""" Get the attention processor in use. Args: return_deprecated_lora (`bool`, *optional*, defaults to `False`):
src/diffusers/models/attention_processor.py:400
↓ 15 callers
Function
get_timestep_embedding
This matches the implementation in Denoising Diffusion Probabilistic Models: Create sinusoidal timestep embeddings. :param timesteps: a 1-D
src/diffusers/models/embeddings.py:27
↓ 15 callers
Method
prepare_inputs
(self, prompt: Union[str, List[str]])
src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py:167
↓ 15 callers
Method
store
r""" Args: Save the current parameters for restoring later. parameters: Iterable of `torch.nn.Parameter`; the parameters t
src/diffusers/training_utils.py:381
↓ 15 callers
Method
unload_lora_weights
Unloads the LoRA parameters. Examples: ```python >>> # Assuming `pipeline` is already loaded with the LoRA paramete
src/diffusers/loaders/lora.py:806
↓ 15 callers
Function
unwrap_model
(model)
examples/text_to_image/train_text_to_image_lora_sdxl.py:649
↓ 14 callers
Method
_load_ip_adapter_weights
(self, state_dicts, low_cpu_mem_usage=False)
src/diffusers/loaders/unet.py:877
↓ 14 callers
Method
_sigma_to_alpha_sigma_t
(self, sigma)
src/diffusers/schedulers/scheduling_dpmsolver_singlestep.py:399
← previous
next →
101–200 of 9,976, ranked by callers