Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Chen-Yang-Liu/Text2Earth
/ functions
Functions
8,312 in github.com/Chen-Yang-Liu/Text2Earth
⨍
Functions
8,312
◇
Types & classes
1,375
↳
Endpoints
6
↓ 1,372 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
↓ 971 callers
Method
from_pretrained
(cls, path, model_cls)
src/diffusers/training_utils.py:311
↓ 817 callers
Method
to
(self, device)
tests/pipelines/stable_diffusion_safe/test_safe_diffusion.py:103
↓ 800 callers
Method
pop
(self, *args, **kwargs)
src/diffusers/utils/outputs.py:101
↓ 726 callers
Method
set_progress_bar_config
(self, **kwargs)
src/diffusers/pipelines/pipeline_utils.py:1639
↓ 695 callers
Function
requires_backends
(obj, backends)
src/diffusers/utils/import_utils.py:603
↓ 520 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:303
↓ 430 callers
Method
to
(self, device)
tests/pipelines/test_pipelines.py:1144
↓ 412 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:349
↓ 338 callers
Function
deprecate
(*args, take_from: Optional[Union[Dict, Any]] = None, standard_warn=True, stacklevel=2)
src/diffusers/utils/deprecation_utils.py:8
↓ 299 callers
Method
pipeline_class
(self)
tests/pipelines/test_pipelines_common.py:878
↓ 256 callers
Method
update
(self, *args, **kwargs)
src/diffusers/utils/outputs.py:104
↓ 246 callers
Method
from_config
(cls, *args, **kwargs)
src/diffusers/utils/dummy_pt_objects.py:417
↓ 202 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:38
↓ 190 callers
Method
step
(self, parameters: Iterable[torch.nn.Parameter])
src/diffusers/training_utils.py:355
↓ 167 callers
Function
is_torch_available
()
src/diffusers/utils/import_utils.py:338
↓ 161 callers
Function
is_transformers_available
()
src/diffusers/utils/import_utils.py:354
↓ 158 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:299
↓ 146 callers
Method
register_modules
(self, **kwargs)
src/diffusers/pipelines/pipeline_utils.py:153
↓ 138 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:1015
↓ 136 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:498
↓ 130 callers
Function
floats_tensor
Creates a random float32 tensor
src/diffusers/utils/testing_utils.py:192
↓ 120 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:869
↓ 120 callers
Method
register_to_config
(self, **kwargs)
src/diffusers/configuration_utils.py:110
↓ 111 callers
Method
decode
( self, h: torch.Tensor, force_not_quantize: bool = True, return_dict: bool = True )
src/diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py:143
↓ 111 callers
Method
set_default_attn_processor
Disables custom attention processors and sets the default attention implementation.
src/diffusers/models/unets/uvit_2d.py:276
↓ 110 callers
Method
check_over_configs
(self, time_step=0, **config)
tests/schedulers/test_schedulers.py:370
↓ 110 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:1093
↓ 109 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:434
↓ 109 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:352
↓ 106 callers
Function
numpy_cosine_similarity_distance
(a, b)
src/diffusers/utils/testing_utils.py:102
↓ 105 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:118
↓ 101 callers
Method
postprocess
(self, sample: torch.Tensor, output_type: str = "pil")
src/diffusers/pipelines/blip_diffusion/blip_image_processing.py:301
↓ 96 callers
Function
load_numpy
(arry: Union[str, np.ndarray], local_path: Optional[str] = None)
src/diffusers/utils/testing_utils.py:401
↓ 92 callers
Method
numpy_to_pil
Convert a NumPy image or a batch of images to a PIL image.
src/diffusers/pipelines/pipeline_utils.py:1618
↓ 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:1703
↓ 90 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:36
↓ 87 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:463
↓ 85 callers
Method
dummy_model
(self)
tests/schedulers/test_schedulers.py:358
↓ 80 callers
Function
check_if_lora_correctly_set
Checks if the LoRA layers are correctly set with peft
tests/lora/utils.py:58
↓ 80 callers
Method
progress_bar
(self, iterable=None, total=None, desc=None, leave=True)
src/diffusers/pipelines/marigold/pipeline_marigold_depth.py:315
↓ 78 callers
Method
state_dict
(self, *args, destination=None, prefix="", keep_vars=False)
src/diffusers/models/lora.py:111
↓ 71 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:260
↓ 68 callers
Method
save_pretrained
(self, path)
src/diffusers/training_utils.py:320
↓ 68 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:103
↓ 66 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:574
↓ 65 callers
Function
adjust_lora_scale_text_encoder
(text_encoder, lora_scale: float = 1.0)
src/diffusers/models/lora.py:69
↓ 65 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:123
↓ 63 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
↓ 62 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:667
↓ 61 callers
Method
get_dummy_inputs
(self, device, seed=0)
tests/pipelines/test_pipelines_common.py:890
↓ 61 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
↓ 60 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:735
↓ 59 callers
Method
encode
(self, x: torch.Tensor, return_dict: bool = True)
src/diffusers/pipelines/wuerstchen/modeling_paella_vq_model.py:133
↓ 58 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:1107
↓ 55 callers
Method
add_noise
( self, original_samples: torch.Tensor, noise: torch.Tensor, timesteps: torch.
src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py:267
↓ 53 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:1006
↓ 49 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
↓ 47 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:79
↓ 46 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
↓ 45 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
↓ 44 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:145
↓ 43 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:1084
↓ 43 callers
Function
is_accelerate_available
()
src/diffusers/utils/import_utils.py:386
↓ 42 callers
Method
from_pipe
r""" Create a new pipeline from a given pipeline. This method is useful to create a new pipeline from the existing pipeline components
src/diffusers/pipelines/pipeline_utils.py:1760
↓ 42 callers
Method
get_dummy_components
(self)
tests/pipelines/test_pipelines_common.py:884
↓ 41 callers
Function
to_np
(tensor)
tests/pipelines/test_pipelines_common.py:58
↓ 40 callers
Method
_get_variance
(self, timestep, prev_timestep)
src/diffusers/schedulers/scheduling_tcd.py:318
↓ 39 callers
Function
torch_all_close
(a, b, *args, **kwargs)
src/diffusers/utils/testing_utils.py:94
↓ 38 callers
Function
is_flax_available
()
src/diffusers/utils/import_utils.py:350
↓ 38 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:404
↓ 36 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:1329
↓ 36 callers
Method
preprocess
Preprocess the image input. Args: image (`pipeline_image_input`): The image input, accepted formats are
src/diffusers/image_processor.py:468
↓ 36 callers
Method
progress_bar
(self, iterable=None, total=None)
src/diffusers/pipelines/stable_cascade/pipeline_stable_cascade_combined.py:144
↓ 34 callers
Method
_compare_component_configs
(self, pipe, single_file_pipe)
tests/single_file/single_file_testing_utils.py:49
↓ 34 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:417
↓ 34 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:724
↓ 33 callers
Method
apply
(self, pipe, i, t, callback_kwargs)
tests/pipelines/stable_diffusion/test_stable_diffusion.py:805
↓ 33 callers
Method
to_tuple
Convert self to a tuple containing all the attributes/keys that are not `None`.
src/diffusers/utils/outputs.py:133
↓ 32 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:288
↓ 29 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:1607
↓ 28 callers
Method
pop
(self, *args, **kwargs)
src/diffusers/configuration_utils.py:70
↓ 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:36
↓ 27 callers
Method
postprocess
Postprocess the image output from tensor to `output_type`. Args: image (`torch.Tensor`): The image input
src/diffusers/image_processor.py:596
↓ 27 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:41
↓ 26 callers
Method
__init__
( self, in_channels: int, prev_output_channel: int, out_channels: int,
src/diffusers/models/unets/unet_2d_blocks.py:2568
↓ 26 callers
Method
mode
(self)
src/diffusers/models/vae_flax.py:722
↓ 26 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:648
↓ 26 callers
Method
set_adapters
( self, adapter_names: Union[List[str], str], adapter_weights: Optional[Union[float, D
src/diffusers/loaders/lora.py:945
↓ 25 callers
Method
__init__
(self, num_channels: int, flip_sin_to_cos: bool, downscale_freq_shift: float)
src/diffusers/models/embeddings.py:358
↓ 25 callers
Method
get_dummy_components
(self, scheduler_cls=None, use_dora=False)
tests/lora/utils.py:77
↓ 25 callers
Method
get_dummy_inputs
(self, device, seed=0)
tests/pipelines/stable_diffusion/test_stable_diffusion.py:187
↓ 25 callers
Function
to_np
(tensor)
tests/pipelines/pia/test_pia.py:23
↓ 24 callers
Method
create_state
(self, common: Optional[CommonSchedulerState] = None)
src/diffusers/schedulers/scheduling_pndm_flax.py:141
↓ 24 callers
Method
get_dummy_inputs
(self, with_generator=True)
tests/lora/utils.py:138
↓ 24 callers
Method
get_dummy_inputs
(self, device, seed=0)
tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl.py:151
↓ 24 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:695
↓ 24 callers
Method
prepare_init_args_and_inputs_for_common
(self)
tests/models/unets/test_models_unet_2d_condition.py:378
↓ 24 callers
Method
prepare_init_args_and_inputs_for_common
(self)
tests/models/autoencoders/test_models_vq.py:55
next →
1–100 of 8,312, ranked by callers