MCPcopy Create free account

hub / github.com/YesianRohn/TextSSR / functions

Functions13,352 in github.com/YesianRohn/TextSSR

↓ 59 callersMethodget_dummy_inputs
(self, device, seed=0)
diffusers/tests/pipelines/test_pipelines_common.py:918
↓ 58 callersMethodset_processor
r""" Set the attention processor to use. Args: processor (`AttnProcessor`): The attention processor to us
diffusers/src/diffusers/models/attention_processor.py:418
↓ 56 callersFunctionis_xformers_available
()
diffusers/src/diffusers/utils/import_utils.py:387
↓ 56 callersMethodload_lora_weights
(self, **kwargs)
diffusers/src/diffusers/loaders/lora_base.py:190
↓ 54 callersMethodresize
Resize an image to `(size["height"], size["width"])`. Args: image (`np.ndarray`): Image to resize.
diffusers/src/diffusers/pipelines/blip_diffusion/blip_image_processing.py:116
↓ 53 callersMethod_test_inference_batch_single_identical
( self, batch_size=2, expected_max_diff=1e-4, additional_params_copy_to_batche
diffusers/tests/pipelines/test_pipelines_common.py:1112
↓ 53 callersMethodmode
(self)
diffusers/src/diffusers/models/vae_flax.py:722
↓ 52 callersMethodprepare_attention_mask
r""" Prepare the attention mask for the attention computation. Args: attention_mask (`torch.Tensor`): The
diffusers/src/diffusers/models/attention_processor.py:589
↓ 49 callersMethodget_velocity
(self, sample: torch.Tensor, noise: torch.Tensor, timesteps: torch.IntTensor)
diffusers/examples/community/scheduling_ufogen.py:486
↓ 48 callersMethod_prepare_perturbed_attention_guidance
Prepares the perturbed attention guidance for the PAG model. Args: cond (torch.Tensor): The conditional input tensor.
diffusers/src/diffusers/pipelines/pag/pag_utils.py:133
↓ 46 callersMethodsave_lora_weights
( cls, save_directory: Union[str, os.PathLike], unet_lora_layers: Dict[str, Union[torc
diffusers/examples/community/pipeline_demofusion_sdxl.py:1345
↓ 45 callersMethodapply
(self, pipe, i, t, callback_kwargs)
diffusers/tests/pipelines/stable_diffusion/test_stable_diffusion.py:805
↓ 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
diffusers/src/diffusers/configuration_utils.py:145
↓ 45 callersFunctionto_np
(tensor)
diffusers/tests/pipelines/test_pipelines_common.py:62
↓ 44 callersMethodencode
(self, text, *args, vector_shuffle=False, prop_tokens_to_load=1.0, **kwargs)
diffusers/examples/research_projects/multi_token_textual_inversion/multi_token_clip.py:97
↓ 42 callersMethodget_dummy_components
(self)
diffusers/tests/pipelines/test_pipelines_common.py:912
↓ 42 callersMethodload_config
r""" Load a model or scheduler configuration. Parameters: pretrained_model_name_or_path (`str` or `os.PathLike`, *optiona
diffusers/src/diffusers/configuration_utils.py:288
↓ 42 callersMethodunload_lora_weights
Unloads the LoRA parameters. Examples: ```python >>> # Assuming `pipeline` is already loaded with the LoRA paramete
diffusers/src/diffusers/loaders/lora_base.py:356
↓ 41 callersFunctionis_invisible_watermark_available
()
diffusers/src/diffusers/utils/import_utils.py:427
↓ 41 callersMethodto_tuple
Convert self to a tuple containing all the attributes/keys that are not `None`.
diffusers/src/diffusers/utils/outputs.py:133
↓ 41 callersFunctiontorch_all_close
(a, b, *args, **kwargs)
diffusers/src/diffusers/utils/testing_utils.py:94
↓ 40 callersMethod_get_variance
(self, timestep, prev_timestep)
diffusers/src/diffusers/schedulers/scheduling_tcd.py:318
↓ 39 callersFunctionis_flax_available
()
diffusers/src/diffusers/utils/import_utils.py:355
↓ 39 callersMethodnorm_encoder_hidden_states
r""" Normalize the encoder hidden states. Requires `self.norm_cross` to be specified when constructing the `Attention` class.
diffusers/src/diffusers/models/attention_processor.py:636
↓ 39 callersMethodset_begin_index
Sets the begin index for the scheduler. This function should be run from pipeline before the inference. Args: begin_inde
diffusers/src/diffusers/schedulers/scheduling_lcm.py:289
↓ 38 callersFunctionis_peft_version
Compares the current PEFT version to a given reference with an operation. Args: operation (`str`): A string representati
diffusers/src/diffusers/utils/import_utils.py:733
↓ 38 callersMethodprogress_bar
(self, iterable=None, total=None)
diffusers/src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_combined.py:144
↓ 37 callersMethod_test_attention_slicing_forward_pass
( self, test_max_difference=True, test_mean_pixel_difference=True, expected_max_diff=1e-3 )
diffusers/tests/pipelines/test_pipelines_common.py:1357
↓ 37 callersFunctionto_np
(tensor)
diffusers/tests/pipelines/pag/test_pag_animatediff.py:33
↓ 36 callersMethodpreprocess
Preprocess the image input. Args: image (`pipeline_image_input`): The image input, accepted formats are
diffusers/src/diffusers/image_processor.py:469
↓ 35 callersMethodpreprocess
(self, image, scale, resample)
diffusers/examples/custom_diffusion/train_custom_diffusion.py:238
↓ 34 callersMethod_compare_component_configs
(self, pipe, single_file_pipe)
diffusers/tests/single_file/single_file_testing_utils.py:50
↓ 34 callersFunctionis_torch_xla_available
()
diffusers/src/diffusers/utils/import_utils.py:347
↓ 34 callersFunctionload_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
diffusers/src/diffusers/utils/hub_utils.py:99
↓ 34 callersFunctionpopulate_model_card
Populates the `model_card` with library name and optional tags.
diffusers/src/diffusers/utils/hub_utils.py:169
↓ 33 callersMethod_test_xformers_attention_forwardGenerator_pass
( self, test_max_difference=True, test_mean_pixel_difference=True, expected_max_diff=1e-4 )
diffusers/tests/pipelines/test_pipelines_common.py:1645
↓ 33 callersMethodcopy_to
Copy current averaged parameters into given collection of parameters. Args: parameters: Iterable of `torch.nn.Parameter`;
diffusers/examples/research_projects/intel_opts/textual_inversion_dfq/textual_inversion.py:305
↓ 32 callersFunctionassign_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
diffusers/src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py:168
↓ 32 callersMethodbatch_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
diffusers/src/diffusers/models/attention_processor.py:498
↓ 32 callersMethodget_dummy_components
(self, scheduler_cls=None, use_dora=False)
diffusers/tests/lora/utils.py:100
↓ 31 callersMethod__init__
(self, num_channels: int, flip_sin_to_cos: bool, downscale_freq_shift: float, scale: int = 1)
diffusers/src/diffusers/models/embeddings.py:766
↓ 31 callersMethodto
(self, device)
diffusers/examples/consistency_distillation/train_lcm_distill_sdxl_wds.py:440
↓ 30 callersMethodload_lora_weights
(self, pretrained_model_name_or_path_or_dict: Union[str, Dict[str, torch.Tensor]], **kwargs)
diffusers/examples/community/pipeline_demofusion_sdxl.py:1283
↓ 30 callersMethodprepare_init_args_and_inputs_for_common
(self)
diffusers/tests/models/unets/test_models_unet_2d_condition.py:378
↓ 30 callersMethodset_adapters
Set the currently active adapters for use in the UNet. Args: adapter_names (`List[str]` or `str`): The n
diffusers/src/diffusers/loaders/peft.py:56
↓ 29 callersMethodoptimize
(self, onnx_graph)
diffusers/examples/community/stable_diffusion_tensorrt_inpaint.py:436
↓ 29 callersMethodprepare_init_args_and_inputs_for_common
(self)
diffusers/tests/models/autoencoders/test_models_vq.py:55
↓ 29 callersMethodto
(self, device)
diffusers/examples/consistency_distillation/train_lcm_distill_lora_sdxl_wds.py:417
↓ 29 callersFunctionto_np
(tensor)
diffusers/tests/pipelines/pia/test_pia.py:26
↓ 28 callersMethodencode_prompt
( self, tokenizers, text_encoders, prompt: str, num_images_per_prompt: int = 1, negative_prompt: str =
diffusers/tests/pipelines/test_pipelines_common.py:2050
↓ 28 callersFunctionget_activation
Helper function to get activation function from string. Args: act_fn (str): Name of activation function. Returns: nn.Module:
diffusers/src/diffusers/models/activations.py:36
↓ 28 callersMethodget_attention_scores
r""" Compute the attention scores. Args: query (`torch.Tensor`): The query tensor. key (`torch.Tensor`): The
diffusers/src/diffusers/models/attention_processor.py:542
↓ 28 callersMethodget_dummy_inputs
(self, with_generator=True)
diffusers/tests/lora/utils.py:180
↓ 28 callersMethodset_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
diffusers/src/diffusers/pipelines/wuerstchen/modeling_wuerstchen_prior.py:91
↓ 28 callersFunctiontrain_transforms
(img)
diffusers/examples/kandinsky2_2/text_to_image/train_text_to_image_decoder.py:651
↓ 27 callersMethoddecode
(self, encodings_and_masks, input_tokens, noise_time)
diffusers/src/diffusers/pipelines/deprecated/spectrogram_diffusion/pipeline_spectrogram_diffusion.py:114
↓ 27 callersFunctionis_scipy_available
()
diffusers/src/diffusers/utils/import_utils.py:379
↓ 27 callersMethodpop
(self, *args, **kwargs)
diffusers/src/diffusers/configuration_utils.py:70
↓ 26 callersMethod__init__
( self, in_channels: int, prev_output_channel: int, out_channels: int,
diffusers/src/diffusers/models/unets/unet_2d_blocks.py:2568
↓ 26 callersMethodapply_watermark
(self, images: List[PIL.Image.Image], sample_size=None)
diffusers/src/diffusers/pipelines/deepfloyd_if/watermark.py:19
↓ 26 callersFunctioncast_training_params
(model: Union[torch.nn.Module, List[torch.nn.Module]], dtype=torch.float32)
diffusers/src/diffusers/training_utils.py:196
↓ 26 callersMethodfuse_lora
(self, lora_scale=1.0, safe_fusing=False, adapter_names=None)
diffusers/src/diffusers/loaders/peft.py:265
↓ 26 callersMethodget_processor
r""" Get the attention processor in use. Args: return_deprecated_lora (`bool`, *optional*, defaults to `False`):
diffusers/src/diffusers/models/attention_processor.py:438
↓ 25 callersFunctionassert_mean_pixel_difference
(image, expected_image, expected_max_diff=10)
diffusers/tests/pipelines/test_pipelines_common.py:2193
↓ 25 callersFunctionassert_param_count
(model_1, model_2)
diffusers/scripts/convert_if.py:1176
↓ 25 callersMethodget_dummy_inputs
(self, device, seed=0)
diffusers/tests/pipelines/stable_diffusion/test_stable_diffusion.py:187
↓ 24 callersMethodcreate_state
(self, common: Optional[CommonSchedulerState] = None)
diffusers/src/diffusers/schedulers/scheduling_pndm_flax.py:141
↓ 24 callersMethodget_dummy_inputs
(self, device, seed=0)
diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl.py:151
↓ 24 callersMethodget_generator
(self, device, seed=0)
diffusers/tests/pipelines/text_to_video_synthesis/test_text_to_video_zero_sdxl.py:150
↓ 24 callersFunctionis_transformers_version
Compares the current Transformers version to a given reference with an operation. Args: operation (`str`): A string repr
diffusers/src/diffusers/utils/import_utils.py:703
↓ 24 callersMethodload_textual_inversion
r""" Load Textual Inversion embeddings into the text encoder of [`StableDiffusionPipeline`] (both 🤗 Diffusers and Automatic1111 format
diffusers/src/diffusers/loaders/textual_inversion.py:264
↓ 23 callersFunction_extract_repo_id_and_weights_name
(pretrained_model_name_or_path)
diffusers/src/diffusers/loaders/single_file_utils.py:294
↓ 23 callersMethoddownload
r""" Download and cache a PyTorch diffusion pipeline from pretrained pipeline weights. Parameters: pretrained_model_name
diffusers/src/diffusers/pipelines/pipeline_utils.py:1151
↓ 23 callersMethodfrom_pretrained
r""" Instantiate a pretrained MultiControlNet model from multiple pre-trained controlnet models. The model is set in evaluation mode
diffusers/src/diffusers/pipelines/controlnet/multicontrolnet.py:114
↓ 23 callersMethodto
(self, device)
diffusers/examples/consistency_distillation/train_lcm_distill_lora_sd_wds.py:429
↓ 22 callersFunctiondownload_single_file_checkpoint
(repo_id, filename, tmpdir)
diffusers/tests/single_file/single_file_testing_utils.py:16
↓ 22 callersMethodget_dummy_components
(self, time_cond_proj_dim=None)
diffusers/tests/pipelines/stable_diffusion/test_stable_diffusion.py:127
↓ 22 callersFunctionis_bs4_available
()
diffusers/src/diffusers/utils/import_utils.py:419
↓ 22 callersFunctionis_ftfy_available
()
diffusers/src/diffusers/utils/import_utils.py:415
↓ 22 callersMethodload_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
diffusers/src/diffusers/loaders/ip_adapter.py:55
↓ 22 callersMethodto
(self, device)
diffusers/examples/consistency_distillation/train_lcm_distill_lora_sdxl.py:93
↓ 21 callersFunction_get_task_class
(mapping, pipeline_class_name, throw_error_if_not_exist: bool = True)
diffusers/src/diffusers/pipelines/auto_pipeline.py:215
↓ 21 callersFunctionapply_rotary_emb
Apply rotary embeddings to input tensors using the given frequency tensor. This function applies rotary embeddings to the given query or key
diffusers/src/diffusers/models/embeddings.py:643
↓ 21 callersMethodcrop
(self, im, new_width, new_height)
diffusers/src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py:514
↓ 21 callersMethodget_dummy_inputs
( self, for_image_to_image=False, for_inpainting=False, for_sdxl=False, for_masks=False, for_instant_s
diffusers/tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py:75
↓ 21 callersMethodget_dummy_inputs
(self, device, seed=0)
diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_inpaint.py:172
↓ 21 callersMethodget_dummy_inputs
(self, device, seed=0)
diffusers/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py:125
↓ 21 callersMethodlora_state_dict
(cls, **kwargs)
diffusers/src/diffusers/loaders/lora_base.py:198
↓ 21 callersMethodpil_to_numpy
Convert a PIL image or a list of PIL images to NumPy arrays.
diffusers/src/diffusers/image_processor.py:121
↓ 21 callersMethodwalk
Walks through a series of prompts and seeds, interpolating between them and saving the results to disk. Args: prompts (`
diffusers/examples/community/interpolate_stable_diffusion.py:399
↓ 20 callersFunctioncompute_snr
Computes SNR as per https://github.com/TiankaiHang/Min-SNR-Diffusion-Training/blob/521b624bd70c67cee4bdf49225915f5945a872e3/guided_diffusion/
diffusers/src/diffusers/training_utils.py:53
↓ 20 callersFunctionconvert_unet_state_dict_to_peft
r""" Converts a state dict from UNet format to diffusers format - i.e. by removing some keys
diffusers/src/diffusers/utils/state_dict_utils.py:248
↓ 20 callersFunctionis_onnx_available
()
diffusers/src/diffusers/utils/import_utils.py:371
↓ 20 callersFunctionis_safetensors_compatible
Checking for safetensors compatibility: - The model is safetensors compatible only if there is a safetensors file for each model component pr
diffusers/src/diffusers/pipelines/pipeline_loading_utils.py:93
↓ 20 callersMethodnormalize
Normalize an image array to [-1,1].
diffusers/src/diffusers/image_processor.py:152
↓ 20 callersMethodpostprocess_video
r""" Converts a video tensor to a list of frames for export. Args: video (`torch.Tensor`): The video as a tensor.
diffusers/src/diffusers/video_processor.py:89
↓ 20 callersMethodtest_output
(self)
diffusers/tests/models/unets/test_unet_2d_blocks.py:208
↓ 19 callersMethod_test_save_load_optional_components
(self)
diffusers/tests/pipelines/deepfloyd_if/__init__.py:152
↓ 19 callersMethodget_dummy_inputs
(self, device, seed=0, num_frames: int = 2)
diffusers/tests/pipelines/animatediff/test_animatediff_video2video.py:118
↓ 19 callersMethodinputs_dict
(self, seed=None)
diffusers/tests/models/autoencoders/test_models_vae.py:377
← previousnext →101–200 of 13,352, ranked by callers