SYMBOL INDEX (4166 symbols across 293 files) FILE: benchmarks/benchmarking_flux.py function get_input_dict (line 14) | def get_input_dict(**device_dtype_kwargs): FILE: benchmarks/benchmarking_ltx.py function get_input_dict (line 14) | def get_input_dict(**device_dtype_kwargs): FILE: benchmarks/benchmarking_sdxl.py function get_input_dict (line 14) | def get_input_dict(**device_dtype_kwargs): FILE: benchmarks/benchmarking_utils.py function benchmark_fn (line 25) | def benchmark_fn(f, *args, **kwargs): function flush (line 34) | def flush(): function calculate_flops (line 42) | def calculate_flops(model, input_dict): function calculate_params (line 71) | def calculate_params(model): function model_init_fn (line 77) | def model_init_fn(model_cls, group_offload_kwargs=None, layerwise_upcast... class BenchmarkScenario (line 91) | class BenchmarkScenario: class BenchmarkMixin (line 101) | class BenchmarkMixin: method pre_benchmark (line 102) | def pre_benchmark(self): method post_benchmark (line 106) | def post_benchmark(self, model): method run_benchmark (line 112) | def run_benchmark(self, scenario: BenchmarkScenario): method run_bencmarks_and_collate (line 179) | def run_bencmarks_and_collate(self, scenarios: BenchmarkScenario | lis... method _run_phase (line 212) | def _run_phase( FILE: benchmarks/benchmarking_wan.py function get_input_dict (line 14) | def get_input_dict(**device_dtype_kwargs): FILE: benchmarks/push_results.py function has_previous_benchmark (line 11) | def has_previous_benchmark() -> str: function filter_float (line 22) | def filter_float(value): function push_to_hf_dataset (line 28) | def push_to_hf_dataset(): FILE: benchmarks/run_all.py class SubprocessCallException (line 17) | class SubprocessCallException(Exception): function run_command (line 21) | def run_command(command: list[str], return_stdout=False): function merge_csvs (line 30) | def merge_csvs(final_csv: str = "collated_results.csv"): function run_scripts (line 57) | def run_scripts(): FILE: examples/advanced_diffusion_training/test_dreambooth_lora_flux_advanced.py class DreamBoothLoRAFluxAdvanced (line 38) | class DreamBoothLoRAFluxAdvanced(ExamplesTestsAccelerate): method test_dreambooth_lora_flux (line 44) | def test_dreambooth_lora_flux(self): method test_dreambooth_lora_text_encoder_flux (line 76) | def test_dreambooth_lora_text_encoder_flux(self): method test_dreambooth_lora_pivotal_tuning_flux_clip (line 109) | def test_dreambooth_lora_pivotal_tuning_flux_clip(self): method test_dreambooth_lora_pivotal_tuning_flux_clip_t5 (line 151) | def test_dreambooth_lora_pivotal_tuning_flux_clip_t5(self): method test_dreambooth_lora_latent_caching (line 194) | def test_dreambooth_lora_latent_caching(self): method test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit (line 227) | def test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit(se... method test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 250) | def test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit_re... method test_dreambooth_lora_with_metadata (line 288) | def test_dreambooth_lora_with_metadata(self): FILE: examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py function save_model_card (line 102) | def save_model_card( function load_text_encoders (line 223) | def load_text_encoders(class_one, class_two): function log_validation (line 233) | def log_validation( function import_model_class_from_model_name_or_path (line 286) | def import_model_class_from_model_name_or_path( function parse_args (line 305) | def parse_args(input_args=None): class TokenEmbeddingsHandler (line 867) | class TokenEmbeddingsHandler: method __init__ (line 868) | def __init__(self, text_encoders, tokenizers): method initialize_new_tokens (line 877) | def initialize_new_tokens(self, inserting_toks: List[str]): method save_embeddings (line 936) | def save_embeddings(self, file_path: str): method dtype (line 955) | def dtype(self): method device (line 959) | def device(self): method retract_embeddings (line 963) | def retract_embeddings(self): class DreamBoothDataset (line 985) | class DreamBoothDataset(Dataset): method __init__ (line 991) | def __init__( method __len__ (line 1129) | def __len__(self): method __getitem__ (line 1132) | def __getitem__(self, index): function collate_fn (line 1163) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 1180) | class PromptDataset(Dataset): method __init__ (line 1183) | def __init__(self, prompt, num_samples): method __len__ (line 1187) | def __len__(self): method __getitem__ (line 1190) | def __getitem__(self, index): function tokenize_prompt (line 1197) | def tokenize_prompt(tokenizer, prompt, max_sequence_length, add_special_... function _encode_prompt_with_t5 (line 1212) | def _encode_prompt_with_t5( function _encode_prompt_with_clip (line 1256) | def _encode_prompt_with_clip( function encode_prompt (line 1300) | def encode_prompt( function main (line 1339) | def main(args): FILE: examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py function save_model_card (line 96) | def save_model_card( function import_model_class_from_model_name_or_path (line 227) | def import_model_class_from_model_name_or_path( function parse_args (line 247) | def parse_args(input_args=None): class TokenEmbeddingsHandler (line 741) | class TokenEmbeddingsHandler: method __init__ (line 742) | def __init__(self, text_encoders, tokenizers): method initialize_new_tokens (line 750) | def initialize_new_tokens(self, inserting_toks: List[str]): method save_embeddings (line 791) | def save_embeddings(self, file_path: str): method dtype (line 811) | def dtype(self): method device (line 815) | def device(self): method retract_embeddings (line 819) | def retract_embeddings(self): class DreamBoothDataset (line 840) | class DreamBoothDataset(Dataset): method __init__ (line 846) | def __init__( method __len__ (line 961) | def __len__(self): method __getitem__ (line 964) | def __getitem__(self, index): function collate_fn (line 999) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 1016) | class PromptDataset(Dataset): method __init__ (line 1019) | def __init__(self, prompt, num_samples): method __len__ (line 1023) | def __len__(self): method __getitem__ (line 1026) | def __getitem__(self, index): function tokenize_prompt (line 1033) | def tokenize_prompt(tokenizer, prompt, add_special_tokens=False): function encode_prompt (line 1047) | def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list... function main (line 1064) | def main(args): FILE: examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py function determine_scheduler_type (line 103) | def determine_scheduler_type(pretrained_model_name_or_path, revision): function save_model_card (line 117) | def save_model_card( function log_validation (line 255) | def log_validation( function import_model_class_from_model_name_or_path (line 318) | def import_model_class_from_model_name_or_path( function parse_args (line 338) | def parse_args(input_args=None): function is_belong_to_blocks (line 873) | def is_belong_to_blocks(key, blocks): function get_unet_lora_target_modules (line 883) | def get_unet_lora_target_modules(unet, use_blora, target_blocks=None): class TokenEmbeddingsHandler (line 907) | class TokenEmbeddingsHandler: method __init__ (line 908) | def __init__(self, text_encoders, tokenizers): method initialize_new_tokens (line 916) | def initialize_new_tokens(self, inserting_toks: List[str]): method save_embeddings (line 956) | def save_embeddings(self, file_path: str): method dtype (line 976) | def dtype(self): method device (line 980) | def device(self): method retract_embeddings (line 984) | def retract_embeddings(self): class DreamBoothDataset (line 1005) | class DreamBoothDataset(Dataset): method __init__ (line 1011) | def __init__( method __len__ (line 1186) | def __len__(self): method __getitem__ (line 1189) | def __getitem__(self, index): function collate_fn (line 1218) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 1244) | class PromptDataset(Dataset): method __init__ (line 1247) | def __init__(self, prompt, num_samples): method __len__ (line 1251) | def __len__(self): method __getitem__ (line 1254) | def __getitem__(self, index): function tokenize_prompt (line 1261) | def tokenize_prompt(tokenizer, prompt, add_special_tokens=False): function encode_prompt (line 1275) | def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list... function main (line 1306) | def main(args): FILE: examples/amused/train_amused.py function parse_args (line 54) | def parse_args(): class InstanceDataRootDataset (line 301) | class InstanceDataRootDataset(Dataset): method __init__ (line 302) | def __init__( method __len__ (line 312) | def __len__(self): method __getitem__ (line 315) | def __getitem__(self, index): class InstanceDataImageDataset (line 325) | class InstanceDataImageDataset(Dataset): method __init__ (line 326) | def __init__( method __len__ (line 335) | def __len__(self): method __getitem__ (line 340) | def __getitem__(self, index): class HuggingFaceDataset (line 344) | class HuggingFaceDataset(Dataset): method __init__ (line 345) | def __init__( method __len__ (line 361) | def __len__(self): method __getitem__ (line 364) | def __getitem__(self, index): function process_image (line 379) | def process_image(image, size): function tokenize_prompt (line 402) | def tokenize_prompt(tokenizer, prompt): function encode_prompt (line 412) | def encode_prompt(text_encoder, input_ids): function main (line 419) | def main(args): function save_checkpoint (line 946) | def save_checkpoint(args, accelerator, global_step): FILE: examples/cogvideo/train_cogvideox_image_to_video_lora.py function get_args (line 69) | def get_args(): class VideoDataset (line 432) | class VideoDataset(Dataset): method __init__ (line 433) | def __init__( method __len__ (line 480) | def __len__(self): method __getitem__ (line 483) | def __getitem__(self, index): method _load_dataset_from_hub (line 489) | def _load_dataset_from_hub(self): method _load_dataset_from_local_path (line 533) | def _load_dataset_from_local_path(self): method _preprocess_data (line 563) | def _preprocess_data(self): function save_model_card (line 614) | def save_model_card( function log_validation (line 698) | def log_validation( function _get_t5_prompt_embeds (line 764) | def _get_t5_prompt_embeds( function encode_prompt (line 802) | def encode_prompt( function compute_prompt_embeddings (line 826) | def compute_prompt_embeddings( function prepare_rotary_positional_embeddings (line 853) | def prepare_rotary_positional_embeddings( function get_optimizer (line 881) | def get_optimizer(args, params_to_optimize, use_deepspeed: bool = False): function main (line 961) | def main(args): FILE: examples/cogvideo/train_cogvideox_lora.py function get_args (line 60) | def get_args(): class VideoDataset (line 416) | class VideoDataset(Dataset): method __init__ (line 417) | def __init__( method __len__ (line 464) | def __len__(self): method __getitem__ (line 467) | def __getitem__(self, index): method _load_dataset_from_hub (line 473) | def _load_dataset_from_hub(self): method _load_dataset_from_local_path (line 517) | def _load_dataset_from_local_path(self): method _resize_for_rectangle_crop (line 547) | def _resize_for_rectangle_crop(self, arr): method _preprocess_data (line 579) | def _preprocess_data(self): function save_model_card (line 635) | def save_model_card( function log_validation (line 715) | def log_validation( function _get_t5_prompt_embeds (line 786) | def _get_t5_prompt_embeds( function encode_prompt (line 824) | def encode_prompt( function compute_prompt_embeddings (line 848) | def compute_prompt_embeddings( function prepare_rotary_positional_embeddings (line 875) | def prepare_rotary_positional_embeddings( function get_optimizer (line 903) | def get_optimizer(args, params_to_optimize, use_deepspeed: bool = False): function main (line 983) | def main(args): FILE: examples/cogview4-control/train_control_cogview4.py function encode_images (line 70) | def encode_images(pixels: torch.Tensor, vae: torch.nn.Module, weight_dty... function log_validation (line 76) | def log_validation(cogview4_transformer, args, accelerator, weight_dtype... function save_model_card (line 181) | def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_... function parse_args (line 228) | def parse_args(input_args=None): function get_train_dataset (line 603) | def get_train_dataset(args, accelerator): function prepare_train_dataset (line 658) | def prepare_train_dataset(dataset, accelerator): function collate_fn (line 696) | def collate_fn(examples): function main (line 705) | def main(args): FILE: examples/community/adaptive_mask_inpainting.py function download_file (line 149) | def download_file(url, output_file, exist_ok: bool): function generate_video_from_imgs (line 161) | def generate_video_from_imgs(images_save_directory, fps=15.0, delete_dir... function prepare_mask_and_masked_image (line 205) | def prepare_mask_and_masked_image(image, mask, height, width, return_ima... class AdaptiveMaskInpaintPipeline (line 322) | class AdaptiveMaskInpaintPipeline( method __init__ (line 358) | def __init__( method enable_model_cpu_offload (line 464) | def enable_model_cpu_offload(self, gpu_id=0): method _encode_prompt (line 493) | def _encode_prompt( method run_safety_checker (line 655) | def run_safety_checker(self, image, device, dtype): method prepare_extra_step_kwargs (line 670) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 687) | def check_inputs( method prepare_latents (line 738) | def prepare_latents( method _encode_vae_image (line 791) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method prepare_mask_latents (line 805) | def prepare_mask_latents( method get_timesteps (line 847) | def get_timesteps(self, num_inference_steps, strength, device): method __call__ (line 857) | def __call__( method decode_to_npuint8_image (line 1251) | def decode_to_npuint8_image(self, latents): method register_adaptive_mask_settings (line 1259) | def register_adaptive_mask_settings(self): method register_adaptive_mask_model (line 1288) | def register_adaptive_mask_model(self): method adapt_mask (line 1308) | def adapt_mask(self, init_image, pred_orig_image, default_mask_image, ... function seg2bbox (line 1349) | def seg2bbox(seg_mask: np.ndarray): function merge_bbox (line 1357) | def merge_bbox(bboxes: list): class PointRendPredictor (line 1371) | class PointRendPredictor: method __init__ (line 1372) | def __init__( method merge_mask (line 1408) | def merge_mask(self, masks, scores=None): method vis_seg_on_img (line 1415) | def vis_seg_on_img(self, image, mask): method __call__ (line 1423) | def __call__(self, image): class MaskDilateScheduler (line 1441) | class MaskDilateScheduler: method __init__ (line 1442) | def __init__(self, max_dilate_num=15, num_inference_steps=50, schedule... method __call__ (line 1448) | def __call__(self, i): class ProvokeScheduler (line 1452) | class ProvokeScheduler: method __init__ (line 1453) | def __init__(self, num_inference_steps=50, schedule=None, is_zero_inde... method __call__ (line 1465) | def __call__(self, i): FILE: examples/community/bit_diffusion.py function decimal_to_bits (line 15) | def decimal_to_bits(x, bits=BITS): function bits_to_decimal (line 31) | def bits_to_decimal(x, bits=BITS): function ddim_bit_scheduler_step (line 45) | def ddim_bit_scheduler_step( function ddpm_bit_scheduler_step (line 135) | def ddpm_bit_scheduler_step( class BitDiffusion (line 213) | class BitDiffusion(DiffusionPipeline): method __init__ (line 214) | def __init__( method __call__ (line 229) | def __call__( FILE: examples/community/checkpoint_merger.py class CheckpointMergerPipeline (line 15) | class CheckpointMergerPipeline(DiffusionPipeline): method __init__ (line 36) | def __init__(self): method _compare_model_configs (line 40) | def _compare_model_configs(self, dict0, dict1): method _remove_meta_keys (line 51) | def _remove_meta_keys(self, config_dict: Dict): method merge (line 62) | def merge(self, pretrained_model_name_or_path_list: List[Union[str, os... method weighted_sum (line 269) | def weighted_sum(theta0, theta1, theta2, alpha): method sigmoid (line 274) | def sigmoid(theta0, theta1, theta2, alpha): method inv_sigmoid (line 280) | def inv_sigmoid(theta0, theta1, theta2, alpha): method add_difference (line 287) | def add_difference(theta0, theta1, theta2, alpha): FILE: examples/community/clip_guided_images_mixing_stable_diffusion.py function preprocess (line 26) | def preprocess(image, w, h): function slerp (line 44) | def slerp(t, v0, v1, DOT_THRESHOLD=0.9995): function spherical_dist_loss (line 69) | def spherical_dist_loss(x, y): function set_requires_grad (line 75) | def set_requires_grad(model, value): class CLIPGuidedImagesMixingStableDiffusion (line 80) | class CLIPGuidedImagesMixingStableDiffusion(DiffusionPipeline, StableDif... method __init__ (line 81) | def __init__( method freeze_vae (line 116) | def freeze_vae(self): method unfreeze_vae (line 119) | def unfreeze_vae(self): method freeze_unet (line 122) | def freeze_unet(self): method unfreeze_unet (line 125) | def unfreeze_unet(self): method get_timesteps (line 128) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 137) | def prepare_latents(self, image, timestep, batch_size, dtype, device, ... method get_image_description (line 163) | def get_image_description(self, image): method get_clip_image_embeddings (line 170) | def get_clip_image_embeddings(self, image, batch_size): method cond_fn (line 179) | def cond_fn( method __call__ (line 234) | def __call__( FILE: examples/community/clip_guided_stable_diffusion.py class MakeCutouts (line 22) | class MakeCutouts(nn.Module): method __init__ (line 23) | def __init__(self, cut_size, cut_power=1.0): method forward (line 29) | def forward(self, pixel_values, num_cutouts): function spherical_dist_loss (line 43) | def spherical_dist_loss(x, y): function set_requires_grad (line 49) | def set_requires_grad(model, value): class CLIPGuidedStableDiffusion (line 54) | class CLIPGuidedStableDiffusion(DiffusionPipeline, StableDiffusionMixin): method __init__ (line 60) | def __init__( method freeze_vae (line 92) | def freeze_vae(self): method unfreeze_vae (line 95) | def unfreeze_vae(self): method freeze_unet (line 98) | def freeze_unet(self): method unfreeze_unet (line 101) | def unfreeze_unet(self): method cond_fn (line 105) | def cond_fn( method __call__ (line 169) | def __call__( FILE: examples/community/clip_guided_stable_diffusion_img2img.py function preprocess (line 78) | def preprocess(image, w, h): class MakeCutouts (line 96) | class MakeCutouts(nn.Module): method __init__ (line 97) | def __init__(self, cut_size, cut_power=1.0): method forward (line 103) | def forward(self, pixel_values, num_cutouts): function spherical_dist_loss (line 117) | def spherical_dist_loss(x, y): function set_requires_grad (line 123) | def set_requires_grad(model, value): class CLIPGuidedStableDiffusion (line 128) | class CLIPGuidedStableDiffusion(DiffusionPipeline, StableDiffusionMixin): method __init__ (line 134) | def __init__( method freeze_vae (line 166) | def freeze_vae(self): method unfreeze_vae (line 169) | def unfreeze_vae(self): method freeze_unet (line 172) | def freeze_unet(self): method unfreeze_unet (line 175) | def unfreeze_unet(self): method get_timesteps (line 178) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 187) | def prepare_latents(self, image, timestep, batch_size, num_images_per_... method cond_fn (line 240) | def cond_fn( method __call__ (line 304) | def __call__( FILE: examples/community/cogvideox_ddim_inversion.py class DDIMInversionArguments (line 46) | class DDIMInversionArguments(TypedDict): function get_args (line 65) | def get_args() -> DDIMInversionArguments: class CogVideoXAttnProcessor2_0ForDDIMInversion (line 92) | class CogVideoXAttnProcessor2_0ForDDIMInversion(CogVideoXAttnProcessor2_0): method __init__ (line 93) | def __init__(self): method calculate_attention (line 96) | def calculate_attention( method __call__ (line 169) | def __call__( class OverrideAttnProcessors (line 243) | class OverrideAttnProcessors: method __init__ (line 263) | def __init__(self, transformer: CogVideoXTransformer3DModel): method __enter__ (line 267) | def __enter__(self): method __exit__ (line 273) | def __exit__(self, _0, _1, _2): function get_video_frames (line 279) | def get_video_frames( class CogVideoXDDIMInversionOutput (line 340) | class CogVideoXDDIMInversionOutput: method __init__ (line 344) | def __init__(self, inverse_latents: torch.FloatTensor, recon_latents: ... class CogVideoXPipelineForDDIMInversion (line 349) | class CogVideoXPipelineForDDIMInversion(CogVideoXPipeline): method __init__ (line 350) | def __init__( method encode_video_frames (line 367) | def encode_video_frames(self, video_frames: torch.FloatTensor) -> torc... method export_latents_to_video (line 389) | def export_latents_to_video(self, latents: torch.FloatTensor, video_pa... method sample (line 406) | def sample( method __call__ (line 561) | def __call__( FILE: examples/community/composable_stable_diffusion.py class ComposableStableDiffusionPipeline (line 42) | class ComposableStableDiffusionPipeline(DiffusionPipeline, StableDiffusi... method __init__ (line 72) | def __init__( method _encode_prompt (line 172) | def _encode_prompt(self, prompt, device, num_images_per_prompt, do_cla... method run_safety_checker (line 277) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 287) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 295) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 312) | def check_inputs(self, prompt, height, width, callback_steps): method prepare_latents (line 327) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method __call__ (line 350) | def __call__( FILE: examples/community/ddim_noise_comparative_analysis.py function preprocess (line 35) | def preprocess(image): class DDIMNoiseComparativeAnalysisPipeline (line 46) | class DDIMNoiseComparativeAnalysisPipeline(DiffusionPipeline): method __init__ (line 58) | def __init__(self, unet, scheduler): method check_inputs (line 66) | def check_inputs(self, strength): method get_timesteps (line 70) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 79) | def prepare_latents(self, image, timestep, batch_size, dtype, device, ... method __call__ (line 104) | def __call__( FILE: examples/community/dps_pipeline.py class DPSPipeline (line 27) | class DPSPipeline(DiffusionPipeline): method __init__ (line 44) | def __init__(self, unet, scheduler): method __call__ (line 49) | def __call__( class SuperResolutionOperator (line 167) | class SuperResolutionOperator(nn.Module): method __init__ (line 168) | def __init__(self, in_shape, scale_factor): method forward (line 371) | def forward(self, data, **kwargs): class GaussialBlurOperator (line 375) | class GaussialBlurOperator(nn.Module): method __init__ (line 376) | def __init__(self, kernel_size, intensity): method forward (line 421) | def forward(self, data, **kwargs): method transpose (line 424) | def transpose(self, data, **kwargs): method get_kernel (line 427) | def get_kernel(self): function RMSELoss (line 431) | def RMSELoss(yhat, y): FILE: examples/community/edict_pipeline.py class EDICTPipeline (line 13) | class EDICTPipeline(DiffusionPipeline): method __init__ (line 14) | def __init__( method _encode_prompt (line 39) | def _encode_prompt( method denoise_mixing_layer (line 71) | def denoise_mixing_layer(self, x: torch.Tensor, y: torch.Tensor): method noise_mixing_layer (line 77) | def noise_mixing_layer(self, x: torch.Tensor, y: torch.Tensor): method _get_alpha_and_beta (line 83) | def _get_alpha_and_beta(self, t: torch.Tensor): method noise_step (line 91) | def noise_step( method denoise_step (line 110) | def denoise_step( method decode_latents (line 129) | def decode_latents(self, latents: torch.Tensor): method prepare_latents (line 136) | def prepare_latents( method __call__ (line 187) | def __call__( FILE: examples/community/fresco_v2v.py function clear_cache (line 52) | def clear_cache(): function coords_grid (line 57) | def coords_grid(b, h, w, homogeneous=False, device=None): function bilinear_sample (line 76) | def bilinear_sample(img, sample_coords, mode="bilinear", padding_mode="z... class Dilate (line 100) | class Dilate: method __init__ (line 101) | def __init__(self, kernel_size=7, channels=1, device="cpu"): method __call__ (line 110) | def __call__(self, x): function flow_warp (line 115) | def flow_warp(feature, flow, mask=False, mode="bilinear", padding_mode="... function forward_backward_consistency_check (line 124) | def forward_backward_consistency_check(fwd_flow, bwd_flow, alpha=0.01, b... function numpy2tensor (line 146) | def numpy2tensor(img): function calc_mean_std (line 153) | def calc_mean_std(feat, eps=1e-5, chunk=1): function adaptive_instance_normalization (line 165) | def adaptive_instance_normalization(content_feat, style_feat, chunk=1): function optimize_feature (line 175) | def optimize_feature( function warp_tensor (line 263) | def warp_tensor(sample, flows, occs, saliency, unet_chunk_size): function my_forward (line 300) | def my_forward( function get_single_mapping_ind (line 642) | def get_single_mapping_ind(bwd_flow, bwd_occ, imgs, scale=1.0): function get_mapping_ind (line 698) | def get_mapping_ind(bwd_flows, bwd_occs, imgs, scale=1.0): function apply_FRESCO_opt (line 737) | def apply_FRESCO_opt( function get_intraframe_paras (line 758) | def get_intraframe_paras(pipe, imgs, frescoProc, prompt_embeds, do_class... function get_flow_and_interframe_paras (line 807) | def get_flow_and_interframe_paras(flow_model, imgs): class AttentionControl (line 864) | class AttentionControl: method __init__ (line 873) | def __init__(self): method get_empty_store (line 887) | def get_empty_store(): method clear_store (line 892) | def clear_store(self): method enable_store (line 900) | def enable_store(self): method disable_store (line 903) | def disable_store(self): method enable_intraattn (line 907) | def enable_intraattn(self): method disable_intraattn (line 914) | def disable_intraattn(self): method disable_cfattn (line 919) | def disable_cfattn(self): method enable_cfattn (line 923) | def enable_cfattn(self, attn_mask=None): method disable_interattn (line 937) | def disable_interattn(self): method enable_interattn (line 941) | def enable_interattn(self, interattn_paras=None): method disable_controller (line 955) | def disable_controller(self): method enable_controller (line 960) | def enable_controller(self, interattn_paras=None, attn_mask=None): method forward (line 965) | def forward(self, context): method __call__ (line 977) | def __call__(self, context): class FRESCOAttnProcessor2_0 (line 982) | class FRESCOAttnProcessor2_0: method __init__ (line 1003) | def __init__(self, unet_chunk_size=2, controller=None): method __call__ (line 1009) | def __call__( function apply_FRESCO_attn (line 1194) | def apply_FRESCO_attn(pipe): function retrieve_latents (line 1210) | def retrieve_latents( function prepare_image (line 1223) | def prepare_image(image): class FrescoV2VPipeline (line 1247) | class FrescoV2VPipeline(StableDiffusionControlNetImg2ImgPipeline): method __init__ (line 1290) | def __init__( method _encode_prompt (line 1384) | def _encode_prompt( method encode_prompt (line 1417) | def encode_prompt( method encode_image (line 1599) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 1624) | def prepare_ip_adapter_image_embeds( method run_safety_checker (line 1676) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 1691) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 1703) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 1720) | def check_inputs( method check_image (line 1878) | def check_image(self, image, prompt, prompt_embeds): method prepare_control_image (line 1916) | def prepare_control_image( method get_timesteps (line 1947) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 1959) | def prepare_latents( method guidance_scale (line 2025) | def guidance_scale(self): method clip_skip (line 2029) | def clip_skip(self): method do_classifier_free_guidance (line 2036) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 2040) | def cross_attention_kwargs(self): method num_timesteps (line 2044) | def num_timesteps(self): method __call__ (line 2048) | def __call__( FILE: examples/community/gluegen.py class TranslatorBase (line 29) | class TranslatorBase(nn.Module): method __init__ (line 30) | def __init__(self, num_tok, dim, dim_out, mult=2): method forward (line 58) | def forward(self, x): class TranslatorBaseNoLN (line 78) | class TranslatorBaseNoLN(nn.Module): method __init__ (line 79) | def __init__(self, num_tok, dim, dim_out, mult=2): method forward (line 101) | def forward(self, x): class TranslatorNoLN (line 121) | class TranslatorNoLN(nn.Module): method __init__ (line 122) | def __init__(self, num_tok, dim, dim_out, mult=2, depth=5): method forward (line 130) | def forward(self, x): function rescale_noise_cfg (line 139) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_timesteps (line 153) | def retrieve_timesteps( class GlueGenStableDiffusionPipeline (line 197) | class GlueGenStableDiffusionPipeline(DiffusionPipeline, StableDiffusionM... method __init__ (line 198) | def __init__( method load_language_adapter (line 228) | def load_language_adapter( method _adapt_language (line 245) | def _adapt_language(self, prompt_embeds: torch.Tensor): method encode_prompt (line 250) | def encode_prompt( method run_safety_checker (line 433) | def run_safety_checker(self, image, device, dtype): method prepare_extra_step_kwargs (line 447) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 464) | def check_inputs( method prepare_latents (line 502) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method get_guidance_scale_embedding (line 525) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 554) | def guidance_scale(self): method guidance_rescale (line 558) | def guidance_rescale(self): method clip_skip (line 562) | def clip_skip(self): method do_classifier_free_guidance (line 569) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 573) | def cross_attention_kwargs(self): method num_timesteps (line 577) | def num_timesteps(self): method interrupt (line 581) | def interrupt(self): method __call__ (line 585) | def __call__( FILE: examples/community/hd_painter.py class RASGAttnProcessor (line 20) | class RASGAttnProcessor: method __init__ (line 21) | def __init__(self, mask, token_idx, scale_factor): method __call__ (line 28) | def __call__( class PAIntAAttnProcessor (line 100) | class PAIntAAttnProcessor: method __init__ (line 101) | def __init__(self, transformer_block, mask, token_idx, do_classifier_f... method __call__ (line 111) | def __call__( class StableDiffusionHDPainterPipeline (line 401) | class StableDiffusionHDPainterPipeline(StableDiffusionInpaintPipeline): method get_tokenized_prompt (line 402) | def get_tokenized_prompt(self, prompt): method init_attn_processors (line 406) | def init_attn_processors( method __call__ (line 452) | def __call__( class GaussianSmoothing (line 896) | class GaussianSmoothing(nn.Module): method __init__ (line 913) | def __init__(self, channels, kernel_size, sigma, dim=2): method forward (line 947) | def forward(self, input): function get_attention_scores (line 962) | def get_attention_scores( FILE: examples/community/iadb.py class IADBScheduler (line 11) | class IADBScheduler(SchedulerMixin, ConfigMixin): method step (line 18) | def step( method set_timesteps (line 51) | def set_timesteps(self, num_inference_steps: int): method add_noise (line 54) | def add_noise( method __len__ (line 62) | def __len__(self): class IADBPipeline (line 66) | class IADBPipeline(DiffusionPipeline): method __init__ (line 78) | def __init__(self, unet, scheduler): method __call__ (line 84) | def __call__( FILE: examples/community/imagic_stable_diffusion.py function preprocess (line 51) | def preprocess(image): class ImagicStableDiffusionPipeline (line 61) | class ImagicStableDiffusionPipeline(DiffusionPipeline, StableDiffusionMi... method __init__ (line 89) | def __init__( method train (line 110) | def train( method __call__ (line 311) | def __call__( FILE: examples/community/img2img_inpainting.py function prepare_mask_and_masked_image (line 21) | def prepare_mask_and_masked_image(image, mask): function check_size (line 38) | def check_size(image, height, width): function overlay_inner_image (line 48) | def overlay_inner_image(image, inner_image, paste_offset: Tuple[int, ...... class ImageToImageInpaintingPipeline (line 58) | class ImageToImageInpaintingPipeline(DiffusionPipeline): method __init__ (line 86) | def __init__( method __call__ (line 133) | def __call__( FILE: examples/community/instaflow_one_step.py function rescale_noise_cfg (line 41) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): class InstaFlowPipeline (line 55) | class InstaFlowPipeline( method __init__ (line 99) | def __init__( method _encode_prompt (line 193) | def _encode_prompt( method encode_prompt (line 223) | def encode_prompt( method run_safety_checker (line 382) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 396) | def decode_latents(self, latents): method merge_dW_to_unet (line 407) | def merge_dW_to_unet(pipe, dW_dict, alpha=1.0): method prepare_extra_step_kwargs (line 414) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 431) | def check_inputs( method prepare_latents (line 478) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method __call__ (line 501) | def __call__( FILE: examples/community/interpolate_stable_diffusion.py function slerp (line 22) | def slerp(t, v0, v1, DOT_THRESHOLD=0.9995): class StableDiffusionWalkPipeline (line 49) | class StableDiffusionWalkPipeline(DiffusionPipeline, StableDiffusionMixin): method __init__ (line 77) | def __init__( method __call__ (line 124) | def __call__( method embed_text (line 377) | def embed_text(self, text): method get_noise (line 390) | def get_noise(self, seed, dtype=torch.float32, height=512, width=512): method walk (line 399) | def walk( FILE: examples/community/ip_adapter_face_id.py class IPAdapterFullImageProjection (line 60) | class IPAdapterFullImageProjection(nn.Module): method __init__ (line 61) | def __init__(self, image_embed_dim=1024, cross_attention_dim=1024, mul... method forward (line 70) | def forward(self, image_embeds: torch.Tensor): function rescale_noise_cfg (line 76) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_timesteps (line 90) | def retrieve_timesteps( class IPAdapterFaceIDStableDiffusionPipeline (line 134) | class IPAdapterFaceIDStableDiffusionPipeline( method __init__ (line 180) | def __init__( method load_ip_adapter_face_id (line 276) | def load_ip_adapter_face_id(self, pretrained_model_name_or_path_or_dic... method convert_ip_adapter_image_proj_to_diffusers (line 310) | def convert_ip_adapter_image_proj_to_diffusers(self, state_dict): method _load_ip_adapter_weights (line 334) | def _load_ip_adapter_weights(self, state_dict): method set_ip_adapter_scale (line 446) | def set_ip_adapter_scale(self, scale): method _encode_prompt (line 452) | def _encode_prompt( method encode_prompt (line 484) | def encode_prompt( method run_safety_checker (line 665) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 679) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 690) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 707) | def check_inputs( method prepare_latents (line 759) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method get_guidance_scale_embedding (line 782) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 811) | def guidance_scale(self): method guidance_rescale (line 815) | def guidance_rescale(self): method clip_skip (line 819) | def clip_skip(self): method do_classifier_free_guidance (line 826) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 830) | def cross_attention_kwargs(self): method num_timesteps (line 834) | def num_timesteps(self): method interrupt (line 838) | def interrupt(self): method __call__ (line 842) | def __call__( FILE: examples/community/kohya_hires_fix.py class UNet2DConditionModelHighResFix (line 35) | class UNet2DConditionModelHighResFix(UNet2DConditionModel): method __init__ (line 49) | def __init__(self, high_res_fix: List[Dict] = [{"timestep": 600, "scal... method _resize (line 55) | def _resize(cls, sample, target=None, scale_factor=1, mode="bicubic"): method forward (line 68) | def forward( method from_unet (line 361) | def from_unet(cls, unet: UNet2DConditionModel, high_res_fix: list): class StableDiffusionHighResFixPipeline (line 390) | class StableDiffusionHighResFixPipeline(StableDiffusionPipeline): method __init__ (line 430) | def __init__( FILE: examples/community/latent_consistency_img2img.py class LatentConsistencyModelImg2ImgPipeline (line 39) | class LatentConsistencyModelImg2ImgPipeline(DiffusionPipeline): method __init__ (line 42) | def __init__( method _encode_prompt (line 75) | def _encode_prompt( method run_safety_checker (line 153) | def run_safety_checker(self, image, device, dtype): method prepare_latents (line 167) | def prepare_latents( method get_w_embedding (line 243) | def get_w_embedding(self, w, embedding_dim=512, dtype=torch.float32): method get_timesteps (line 266) | def get_timesteps(self, num_inference_steps, strength, device): method __call__ (line 276) | def __call__( class LCMSchedulerOutput (line 394) | class LCMSchedulerOutput(BaseOutput): function betas_for_alpha_bar (line 411) | def betas_for_alpha_bar( function rescale_zero_terminal_snr (line 451) | def rescale_zero_terminal_snr(betas): class LCMSchedulerWithTimestamp (line 484) | class LCMSchedulerWithTimestamp(SchedulerMixin, ConfigMixin): method __init__ (line 539) | def __init__( method scale_model_input (line 590) | def scale_model_input(self, sample: torch.Tensor, timestep: Optional[i... method _get_variance (line 605) | def _get_variance(self, timestep, prev_timestep): method _threshold_sample (line 616) | def _threshold_sample(self, sample: torch.Tensor) -> torch.Tensor: method set_timesteps (line 649) | def set_timesteps( method get_scalings_for_boundary_condition_discrete (line 678) | def get_scalings_for_boundary_condition_discrete(self, t): method step (line 686) | def step( method add_noise (line 778) | def add_noise( method get_velocity (line 802) | def get_velocity(self, sample: torch.Tensor, noise: torch.Tensor, time... method __len__ (line 820) | def __len__(self): FILE: examples/community/latent_consistency_interpolate.py function lerp (line 76) | def lerp( function slerp (line 126) | def slerp( class LatentConsistencyModelWalkPipeline (line 192) | class LatentConsistencyModelWalkPipeline( method __init__ (line 238) | def __init__( method encode_prompt (line 281) | def encode_prompt( method run_safety_checker (line 463) | def run_safety_checker(self, image, device, dtype): method prepare_latents (line 478) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method get_guidance_scale_embedding (line 500) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method prepare_extra_step_kwargs (line 529) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 547) | def check_inputs( method interpolate_embedding (line 585) | def interpolate_embedding( method interpolate_latent (line 616) | def interpolate_latent( method guidance_scale (line 642) | def guidance_scale(self): method cross_attention_kwargs (line 646) | def cross_attention_kwargs(self): method clip_skip (line 650) | def clip_skip(self): method num_timesteps (line 654) | def num_timesteps(self): method __call__ (line 659) | def __call__( FILE: examples/community/latent_consistency_txt2img.py class LatentConsistencyModelPipeline (line 37) | class LatentConsistencyModelPipeline(DiffusionPipeline): method __init__ (line 40) | def __init__( method _encode_prompt (line 73) | def _encode_prompt( method run_safety_checker (line 151) | def run_safety_checker(self, image, device, dtype): method prepare_latents (line 165) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method get_w_embedding (line 180) | def get_w_embedding(self, w, embedding_dim=512, dtype=torch.float32): method __call__ (line 204) | def __call__( class LCMSchedulerOutput (line 309) | class LCMSchedulerOutput(BaseOutput): function betas_for_alpha_bar (line 326) | def betas_for_alpha_bar( function rescale_zero_terminal_snr (line 366) | def rescale_zero_terminal_snr(betas): class LCMScheduler (line 399) | class LCMScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 451) | def __init__( method scale_model_input (line 502) | def scale_model_input(self, sample: torch.Tensor, timestep: Optional[i... method _get_variance (line 517) | def _get_variance(self, timestep, prev_timestep): method _threshold_sample (line 528) | def _threshold_sample(self, sample: torch.Tensor) -> torch.Tensor: method set_timesteps (line 561) | def set_timesteps(self, num_inference_steps: int, lcm_origin_steps: in... method get_scalings_for_boundary_condition_discrete (line 586) | def get_scalings_for_boundary_condition_discrete(self, t): method step (line 594) | def step( method add_noise (line 686) | def add_noise( method get_velocity (line 710) | def get_velocity(self, sample: torch.Tensor, noise: torch.Tensor, time... method __len__ (line 728) | def __len__(self): FILE: examples/community/llm_grounded_diffusion.py function convert_attn_keys (line 128) | def convert_attn_keys(key): function scale_proportion (line 141) | def scale_proportion(obj_box, H, W): class AttnProcessorWithHook (line 154) | class AttnProcessorWithHook(AttnProcessor2_0): method __init__ (line 155) | def __init__( method __call__ (line 172) | def __call__( class LLMGroundedDiffusionPipeline (line 275) | class LLMGroundedDiffusionPipeline( method __init__ (line 324) | def __init__( method attn_hook (line 425) | def attn_hook(self, name, query, key, value, attention_probs): method convert_box (line 430) | def convert_box(cls, box, height, width): method _parse_response_with_negative (line 440) | def _parse_response_with_negative(cls, text): method parse_llm_response (line 478) | def parse_llm_response(cls, response, canvas_height=512, canvas_width=... method check_inputs (line 489) | def check_inputs( method register_attn_hooks (line 547) | def register_attn_hooks(self, unet): method enable_fuser (line 582) | def enable_fuser(self, enabled=True): method enable_attn_hook (line 587) | def enable_attn_hook(self, enabled=True): method get_token_map (line 592) | def get_token_map(self, prompt, padding="do_not_pad", verbose=False): method get_phrase_indices (line 608) | def get_phrase_indices( method add_ca_loss_per_attn_map_to_loss (line 657) | def add_ca_loss_per_attn_map_to_loss( method compute_ca_loss (line 710) | def compute_ca_loss( method __call__ (line 754) | def __call__( method latent_lmd_guidance (line 1091) | def latent_lmd_guidance( method _encode_prompt (line 1199) | def _encode_prompt( method encode_prompt (line 1232) | def encode_prompt( method encode_image (line 1416) | def encode_image(self, image, device, num_images_per_prompt): method run_safety_checker (line 1430) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 1445) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 1457) | def prepare_extra_step_kwargs(self, generator, eta): method prepare_latents (line 1475) | def prepare_latents( method get_guidance_scale_embedding (line 1508) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 1538) | def guidance_scale(self): method guidance_rescale (line 1543) | def guidance_rescale(self): method clip_skip (line 1548) | def clip_skip(self): method do_classifier_free_guidance (line 1556) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1561) | def cross_attention_kwargs(self): method num_timesteps (line 1566) | def num_timesteps(self): FILE: examples/community/lpw_stable_diffusion.py function parse_prompt_attention (line 55) | def parse_prompt_attention(text): function get_prompts_with_weights (line 141) | def get_prompts_with_weights(pipe: DiffusionPipeline, prompt: List[str],... function pad_tokens_and_weights (line 176) | def pad_tokens_and_weights(tokens, weights, max_length, bos, eos, pad, n... function get_unweighted_text_embeddings (line 201) | def get_unweighted_text_embeddings( function get_weighted_text_embeddings (line 258) | def get_weighted_text_embeddings( function preprocess_image (line 406) | def preprocess_image(image, batch_size): function preprocess_mask (line 416) | def preprocess_mask(mask, batch_size, scale_factor=8): class StableDiffusionLongPromptWeightingPipeline (line 447) | class StableDiffusionLongPromptWeightingPipeline( method __init__ (line 486) | def __init__( method _encode_prompt (line 582) | def _encode_prompt( method check_inputs (line 663) | def check_inputs( method get_timesteps (line 714) | def get_timesteps(self, num_inference_steps, strength, device, is_text... method run_safety_checker (line 726) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 736) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 744) | def prepare_extra_step_kwargs(self, generator, eta): method prepare_latents (line 761) | def prepare_latents( method __call__ (line 814) | def __call__( method text2img (line 1079) | def text2img( method img2img (line 1198) | def img2img( method inpaint (line 1310) | def inpaint( FILE: examples/community/lpw_stable_diffusion_onnx.py function parse_prompt_attention (line 78) | def parse_prompt_attention(text): function get_prompts_with_weights (line 164) | def get_prompts_with_weights(pipe, prompt: List[str], max_length: int): function pad_tokens_and_weights (line 199) | def pad_tokens_and_weights(tokens, weights, max_length, bos, eos, pad, n... function get_unweighted_text_embeddings (line 224) | def get_unweighted_text_embeddings( function get_weighted_text_embeddings (line 265) | def get_weighted_text_embeddings( function preprocess_image (line 407) | def preprocess_image(image): function preprocess_mask (line 416) | def preprocess_mask(mask, scale_factor=8): class OnnxStableDiffusionLongPromptWeightingPipeline (line 428) | class OnnxStableDiffusionLongPromptWeightingPipeline(OnnxStableDiffusion... method __init__ (line 439) | def __init__( method __init__ (line 466) | def __init__( method __init__additional__ (line 489) | def __init__additional__(self): method _encode_prompt (line 493) | def _encode_prompt( method check_inputs (line 544) | def check_inputs(self, prompt, height, width, strength, callback_steps): method get_timesteps (line 562) | def get_timesteps(self, num_inference_steps, strength, is_text2img): method run_safety_checker (line 575) | def run_safety_checker(self, image): method decode_latents (line 593) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 604) | def prepare_extra_step_kwargs(self, generator, eta): method prepare_latents (line 621) | def prepare_latents(self, image, timestep, batch_size, height, width, ... method __call__ (line 654) | def __call__( method text2img (line 870) | def text2img( method img2img (line 962) | def img2img( method inpaint (line 1053) | def inpaint( FILE: examples/community/lpw_stable_diffusion_xl.py function parse_prompt_attention (line 54) | def parse_prompt_attention(text): function get_prompts_tokens_with_weights (line 156) | def get_prompts_tokens_with_weights(clip_tokenizer: CLIPTokenizer, promp... function group_tokens_and_weights (line 206) | def group_tokens_and_weights(token_ids: list, weights: list, pad_last_bl... function get_weighted_text_embeddings_sdxl (line 258) | def get_weighted_text_embeddings_sdxl( function rescale_noise_cfg (line 506) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_latents (line 521) | def retrieve_latents( function retrieve_timesteps (line 535) | def retrieve_timesteps( class SDXLLongPromptWeightingPipeline (line 579) | class SDXLLongPromptWeightingPipeline( method __init__ (line 647) | def __init__( method enable_model_cpu_offload (line 693) | def enable_model_cpu_offload(self, gpu_id=0): method encode_prompt (line 724) | def encode_prompt( method encode_image (line 919) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_extra_step_kwargs (line 944) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 961) | def check_inputs( method get_timesteps (line 1044) | def get_timesteps(self, num_inference_steps, strength, device, denoisi... method prepare_latents (line 1080) | def prepare_latents( method _encode_vae_image (line 1236) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method prepare_mask_latents (line 1259) | def prepare_mask_latents( method _get_add_time_ids (line 1312) | def _get_add_time_ids(self, original_size, crops_coords_top_left, targ... method upcast_vae (line 1329) | def upcast_vae(self): method get_guidance_scale_embedding (line 1334) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 1363) | def guidance_scale(self): method guidance_rescale (line 1367) | def guidance_rescale(self): method clip_skip (line 1371) | def clip_skip(self): method do_classifier_free_guidance (line 1378) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1382) | def cross_attention_kwargs(self): method denoising_end (line 1386) | def denoising_end(self): method denoising_start (line 1390) | def denoising_start(self): method num_timesteps (line 1394) | def num_timesteps(self): method __call__ (line 1399) | def __call__( method text2img (line 1955) | def text2img( method img2img (line 2028) | def img2img( method inpaint (line 2105) | def inpaint( method load_lora_weights (line 2187) | def load_lora_weights(self, pretrained_model_name_or_path_or_dict: Uni... method save_lora_weights (line 2219) | def save_lora_weights( method _remove_text_encoder_monkey_patch (line 2252) | def _remove_text_encoder_monkey_patch(self): FILE: examples/community/magic_mix.py class MagicMixPipeline (line 19) | class MagicMixPipeline(DiffusionPipeline): method __init__ (line 20) | def __init__( method encode (line 33) | def encode(self, img): method decode (line 40) | def decode(self, latent): method prep_text (line 50) | def prep_text(self, prompt): method __call__ (line 73) | def __call__( FILE: examples/community/marigold_depth_estimation.py class MarigoldDepthOutput (line 49) | class MarigoldDepthOutput(BaseOutput): function get_pil_resample_method (line 67) | def get_pil_resample_method(method_str: str) -> Resampling: class MarigoldPipeline (line 80) | class MarigoldPipeline(DiffusionPipeline): method __init__ (line 104) | def __init__( method __call__ (line 125) | def __call__( method _check_inference_step (line 283) | def _check_inference_step(self, n_step: int): method _encode_empty_text (line 302) | def _encode_empty_text(self): method single_infer (line 318) | def single_infer( method encode_rgb (line 394) | def encode_rgb(self, rgb_in: torch.Tensor) -> torch.Tensor: method decode_depth (line 413) | def decode_depth(self, depth_latent: torch.Tensor) -> torch.Tensor: method resize_max_res (line 434) | def resize_max_res(img: Image.Image, max_edge_resolution: int, resampl... method colorize_depth_maps (line 459) | def colorize_depth_maps(depth_map, min_depth, max_depth, cmap="Spectra... method chw2hwc (line 498) | def chw2hwc(chw): method _find_batch_size (line 507) | def _find_batch_size(ensemble_size: int, input_res: int, dtype: torch.... method ensemble_depths (line 565) | def ensemble_depths( FILE: examples/community/masked_stable_diffusion_img2img.py class MaskedStableDiffusionImg2ImgPipeline (line 11) | class MaskedStableDiffusionImg2ImgPipeline(StableDiffusionImg2ImgPipeline): method __call__ (line 15) | def __call__( method _make_latent_mask (line 239) | def _make_latent_mask(self, latents, mask): FILE: examples/community/masked_stable_diffusion_xl_img2img.py class MaskedStableDiffusionXLImg2ImgPipeline (line 34) | class MaskedStableDiffusionXLImg2ImgPipeline(StableDiffusionXLImg2ImgPip... method __call__ (line 38) | def __call__( method _make_latent_mask (line 523) | def _make_latent_mask(self, latents, mask): method prepare_latents (line 548) | def prepare_latents( method random_latents (line 640) | def random_latents(self, batch_size, num_channels_latents, height, wid... method denormalize (line 657) | def denormalize(self, latents): method latents_to_img (line 673) | def latents_to_img(self, latents): method blur_mask (line 679) | def blur_mask(self, pil_mask, blur): FILE: examples/community/matryoshka.py function rescale_noise_cfg (line 125) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_timesteps (line 140) | def retrieve_timesteps( function _chunked_feed_forward (line 200) | def _chunked_feed_forward(ff: nn.Module, hidden_states: torch.Tensor, ch... class MatryoshkaDDIMSchedulerOutput (line 216) | class MatryoshkaDDIMSchedulerOutput(BaseOutput): function betas_for_alpha_bar (line 234) | def betas_for_alpha_bar( function rescale_zero_terminal_snr (line 279) | def rescale_zero_terminal_snr(betas): class MatryoshkaDDIMScheduler (line 315) | class MatryoshkaDDIMScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 368) | def __init__( method scale_model_input (line 425) | def scale_model_input(self, sample: torch.Tensor, timestep: Optional[i... method _get_variance (line 442) | def _get_variance(self, timestep, prev_timestep): method _threshold_sample (line 453) | def _threshold_sample(self, sample: torch.Tensor) -> torch.Tensor: method set_timesteps (line 486) | def set_timesteps(self, num_inference_steps: int, device: Union[str, t... method get_schedule_shifted (line 534) | def get_schedule_shifted(self, alpha_prod, scale_factor=None): method step (line 542) | def step( method add_noise (line 719) | def add_noise( method get_velocity (line 746) | def get_velocity(self, sample: torch.Tensor, noise: torch.Tensor, time... method __len__ (line 765) | def __len__(self): class CrossAttnDownBlock2D (line 769) | class CrossAttnDownBlock2D(nn.Module): method __init__ (line 770) | def __init__( method forward (line 851) | def forward( class UNetMidBlock2DCrossAttn (line 906) | class UNetMidBlock2DCrossAttn(nn.Module): method __init__ (line 907) | def __init__( method forward (line 1000) | def forward( class CrossAttnUpBlock2D (line 1039) | class CrossAttnUpBlock2D(nn.Module): method __init__ (line 1040) | def __init__( method forward (line 1120) | def forward( class MatryoshkaTransformer2DModelOutput (line 1190) | class MatryoshkaTransformer2DModelOutput(BaseOutput): class MatryoshkaTransformer2DModel (line 1203) | class MatryoshkaTransformer2DModel(LegacyModelMixin, LegacyConfigMixin): method __init__ (line 1208) | def __init__( method forward (line 1236) | def forward( class MatryoshkaTransformerBlock (line 1345) | class MatryoshkaTransformerBlock(nn.Module): method __init__ (line 1352) | def __init__( method set_chunk_feed_forward (line 1416) | def set_chunk_feed_forward(self, chunk_size: Optional[int], dim: int =... method forward (line 1421) | def forward( class MatryoshkaFusedAttnProcessor2_0 (line 1472) | class MatryoshkaFusedAttnProcessor2_0: method __init__ (line 1482) | def __init__(self): method __call__ (line 1488) | def __call__( class MatryoshkaFeedForward (line 1571) | class MatryoshkaFeedForward(nn.Module): method __init__ (line 1577) | def __init__( method forward (line 1587) | def forward(self, x): function get_down_block (line 1596) | def get_down_block( function get_mid_block (line 1678) | def get_mid_block( function get_up_block (line 1725) | def get_up_block( class MatryoshkaCombinedTimestepTextEmbedding (line 1810) | class MatryoshkaCombinedTimestepTextEmbedding(nn.Module): method __init__ (line 1811) | def __init__(self, addition_time_embed_dim, cross_attention_dim, time_... method forward (line 1820) | def forward(self, emb, encoder_hidden_states, added_cond_kwargs): class MatryoshkaUNet2DConditionOutput (line 1848) | class MatryoshkaUNet2DConditionOutput(BaseOutput): class MatryoshkaUNet2DConditionModel (line 1861) | class MatryoshkaUNet2DConditionModel( method __init__ (line 1961) | def __init__( method _check_config (line 2300) | def _check_config( method _set_time_proj (line 2352) | def _set_time_proj( method _set_encoder_hid_proj (line 2385) | def _set_encoder_hid_proj( method _set_class_embedding (line 2425) | def _set_class_embedding( method _set_add_embedding (line 2462) | def _set_add_embedding( method _set_pos_net_if_use_gligen (line 2513) | def _set_pos_net_if_use_gligen(self, attention_type: str, cross_attent... method attn_processors (line 2527) | def attn_processors(self) -> dict[str, AttentionProcessor]: method set_attn_processor (line 2550) | def set_attn_processor(self, processor: Union[AttentionProcessor, Dict... method set_default_attn_processor (line 2584) | def set_default_attn_processor(self): method set_attention_slice (line 2599) | def set_attention_slice(self, slice_size: Union[str, int, List[int]] =... method enable_freeu (line 2664) | def enable_freeu(self, s1: float, s2: float, b1: float, b2: float): method disable_freeu (line 2688) | def disable_freeu(self): method fuse_qkv_projections (line 2696) | def fuse_qkv_projections(self): method unfuse_qkv_projections (line 2718) | def unfuse_qkv_projections(self): method get_time_embed (line 2728) | def get_time_embed( method get_class_embed (line 2755) | def get_class_embed(self, sample: torch.Tensor, class_labels: Optional... method get_aug_embed (line 2771) | def get_aug_embed( method process_encoder_hidden_states (line 2825) | def process_encoder_hidden_states( method model_type (line 2862) | def model_type(self) -> str: method forward (line 2865) | def forward( class NestedUNet2DConditionOutput (line 3166) | class NestedUNet2DConditionOutput(BaseOutput): class NestedUNet2DConditionModel (line 3175) | class NestedUNet2DConditionModel(MatryoshkaUNet2DConditionModel): method __init__ (line 3181) | def __init__( method model_type (line 3306) | def model_type(self): method forward (line 3309) | def forward( class MatryoshkaPipelineOutput (line 3617) | class MatryoshkaPipelineOutput(BaseOutput): class MatryoshkaPipeline (line 3630) | class MatryoshkaPipeline( method __init__ (line 3669) | def __init__( method change_nesting_level (line 3765) | def change_nesting_level(self, nesting_level: int): method encode_prompt (line 3793) | def encode_prompt( method encode_image (line 3992) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 4016) | def prepare_ip_adapter_image_embeds( method prepare_extra_step_kwargs (line 4061) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 4078) | def check_inputs( method prepare_latents (line 4147) | def prepare_latents( method get_guidance_scale_embedding (line 4186) | def get_guidance_scale_embedding( method guidance_scale (line 4217) | def guidance_scale(self): method guidance_rescale (line 4221) | def guidance_rescale(self): method clip_skip (line 4225) | def clip_skip(self): method do_classifier_free_guidance (line 4232) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 4236) | def cross_attention_kwargs(self): method num_timesteps (line 4240) | def num_timesteps(self): method interrupt (line 4244) | def interrupt(self): method __call__ (line 4249) | def __call__( FILE: examples/community/mixture_canvas.py function preprocess_image (line 20) | def preprocess_image(image): class CanvasRegion (line 38) | class CanvasRegion: method __post_init__ (line 48) | def __post_init__(self): method width (line 74) | def width(self): method height (line 78) | def height(self): method get_region_generator (line 81) | def get_region_generator(self, device="cpu"): method __dict__ (line 87) | def __dict__(self): class MaskModes (line 91) | class MaskModes(Enum): class DiffusionRegion (line 100) | class DiffusionRegion(CanvasRegion): class Text2ImageRegion (line 107) | class Text2ImageRegion(DiffusionRegion): method __post_init__ (line 117) | def __post_init__(self): method tokenize_prompt (line 135) | def tokenize_prompt(self, tokenizer): method encode_prompt (line 145) | def encode_prompt(self, text_encoder, device): class Image2ImageRegion (line 154) | class Image2ImageRegion(DiffusionRegion): method __post_init__ (line 160) | def __post_init__(self): method encode_reference_image (line 169) | def encode_reference_image(self, encoder, device, generator, cpu_vae=F... method __dict__ (line 182) | def __dict__(self): class RerollModes (line 191) | class RerollModes(Enum): class RerollRegion (line 199) | class RerollRegion(CanvasRegion): class MaskWeightsBuilder (line 206) | class MaskWeightsBuilder: method compute_mask_weights (line 212) | def compute_mask_weights(self, region: DiffusionRegion) -> torch.tensor: method _constant_weights (line 221) | def _constant_weights(self, region: DiffusionRegion) -> torch.tensor: method _gaussian_weights (line 227) | def _gaussian_weights(self, region: DiffusionRegion) -> torch.tensor: method _quartic_weights (line 247) | def _quartic_weights(self, region: DiffusionRegion) -> torch.tensor: class StableDiffusionCanvasPipeline (line 267) | class StableDiffusionCanvasPipeline(DiffusionPipeline, StableDiffusionMi... method __init__ (line 270) | def __init__( method decode_latents (line 291) | def decode_latents(self, latents, cpu_vae=False): method get_latest_timestep_img2img (line 309) | def get_latest_timestep_img2img(self, num_inference_steps, strength): method __call__ (line 322) | def __call__( FILE: examples/community/mixture_tiling.py function _tile2pixel_indices (line 51) | def _tile2pixel_indices(tile_row, tile_col, tile_width, tile_height, til... function _pixel2latent_indices (line 67) | def _pixel2latent_indices(px_row_init, px_row_end, px_col_init, px_col_e... function _tile2latent_indices (line 72) | def _tile2latent_indices(tile_row, tile_col, tile_width, tile_height, ti... function _tile2latent_exclusive_indices (line 87) | def _tile2latent_exclusive_indices( class StableDiffusionExtrasMixin (line 116) | class StableDiffusionExtrasMixin: method decode_latents (line 119) | def decode_latents(self, latents, cpu_vae=False): class StableDiffusionTilingPipeline (line 138) | class StableDiffusionTilingPipeline(DiffusionPipeline, StableDiffusionEx... method __init__ (line 139) | def __init__( class SeedTilesMode (line 160) | class SeedTilesMode(Enum): method __call__ (line 167) | def __call__( method _gaussian_weights (line 384) | def _gaussian_weights(self, tile_width, tile_height, nbatches): FILE: examples/community/mixture_tiling_sdxl.py function _tile2pixel_indices (line 85) | def _tile2pixel_indices(tile_row, tile_col, tile_width, tile_height, til... function _pixel2latent_indices (line 101) | def _pixel2latent_indices(px_row_init, px_row_end, px_col_init, px_col_e... function _tile2latent_indices (line 106) | def _tile2latent_indices(tile_row, tile_col, tile_width, tile_height, ti... function _tile2latent_exclusive_indices (line 121) | def _tile2latent_exclusive_indices( function _get_crops_coords_list (line 150) | def _get_crops_coords_list(num_rows, num_cols, output_width): function rescale_noise_cfg (line 196) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_timesteps (line 223) | def retrieve_timesteps( class StableDiffusionXLTilingPipeline (line 283) | class StableDiffusionXLTilingPipeline( method __init__ (line 342) | def __init__( class SeedTilesMode (line 382) | class SeedTilesMode(Enum): method encode_prompt (line 388) | def encode_prompt( method prepare_extra_step_kwargs (line 627) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 644) | def check_inputs(self, prompt, height, width, grid_cols, seed_tiles_mo... method _get_add_time_ids (line 665) | def _get_add_time_ids( method _gaussian_weights (line 683) | def _gaussian_weights(self, tile_width, tile_height, nbatches, device,... method upcast_vae (line 708) | def upcast_vae(self): method get_guidance_scale_embedding (line 713) | def get_guidance_scale_embedding( method guidance_scale (line 744) | def guidance_scale(self): method clip_skip (line 748) | def clip_skip(self): method do_classifier_free_guidance (line 755) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 759) | def cross_attention_kwargs(self): method num_timesteps (line 763) | def num_timesteps(self): method interrupt (line 767) | def interrupt(self): method __call__ (line 772) | def __call__( FILE: examples/community/mod_controlnet_tile_sr_sdxl.py function _adaptive_tile_size (line 161) | def _adaptive_tile_size(image_size, base_tile_size=512, max_tile_size=12... function _tile2pixel_indices (line 186) | def _tile2pixel_indices( function _tile2latent_indices (line 213) | def _tile2latent_indices( function retrieve_latents (line 245) | def retrieve_latents( class StableDiffusionXLControlNetTileSRPipeline (line 258) | class StableDiffusionXLControlNetTileSRPipeline( method __init__ (line 321) | def __init__( method calculate_overlap (line 368) | def calculate_overlap(self, width, height, base_overlap=128): class TileWeightingMethod (line 388) | class TileWeightingMethod(Enum): method encode_prompt (line 395) | def encode_prompt( method prepare_extra_step_kwargs (line 634) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 651) | def check_inputs( method check_image (line 791) | def check_image(self, image, prompt): method prepare_control_image (line 827) | def prepare_control_image( method get_timesteps (line 858) | def get_timesteps(self, num_inference_steps, strength): method prepare_latents (line 870) | def prepare_latents( method _get_add_time_ids (line 957) | def _get_add_time_ids( method _generate_cosine_weights (line 1008) | def _generate_cosine_weights(self, tile_width, tile_height, nbatches, ... method _generate_gaussian_weights (line 1049) | def _generate_gaussian_weights(self, tile_width, tile_height, nbatches... method _get_num_tiles (line 1083) | def _get_num_tiles(self, height, width, tile_height, tile_width, norma... method prepare_tiles (line 1126) | def prepare_tiles( method upcast_vae (line 1220) | def upcast_vae(self): method guidance_scale (line 1225) | def guidance_scale(self): method clip_skip (line 1229) | def clip_skip(self): method do_classifier_free_guidance (line 1236) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1240) | def cross_attention_kwargs(self): method num_timesteps (line 1244) | def num_timesteps(self): method interrupt (line 1248) | def interrupt(self): method __call__ (line 1253) | def __call__( FILE: examples/community/multilingual_stable_diffusion.py function detect_language (line 26) | def detect_language(pipe, prompt, batch_size): function translate_prompt (line 41) | def translate_prompt(prompt, translation_tokenizer, translation_model, d... class MultilingualStableDiffusion (line 51) | class MultilingualStableDiffusion(DiffusionPipeline, StableDiffusionMixin): method __init__ (line 86) | def __init__( method __call__ (line 139) | def __call__( FILE: examples/community/one_step_unet.py class UnetSchedulerOneForwardPipeline (line 7) | class UnetSchedulerOneForwardPipeline(DiffusionPipeline): method __init__ (line 8) | def __init__(self, unet, scheduler): method __call__ (line 13) | def __call__(self): FILE: examples/community/pipeline_animatediff_controlnet.py function tensor2vid (line 95) | def tensor2vid(video: torch.Tensor, processor, output_type="np"): class AnimateDiffControlNetPipeline (line 116) | class AnimateDiffControlNetPipeline( method __init__ (line 155) | def __init__( method encode_prompt (line 198) | def encode_prompt( method encode_image (line 380) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 405) | def prepare_ip_adapter_image_embeds( method decode_latents (line 440) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 464) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 482) | def check_inputs( method check_image (line 629) | def check_image(self, image, prompt, prompt_embeds): method prepare_latents (line 667) | def prepare_latents( method prepare_image (line 693) | def prepare_image( method guidance_scale (line 724) | def guidance_scale(self): method clip_skip (line 728) | def clip_skip(self): method do_classifier_free_guidance (line 735) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 739) | def cross_attention_kwargs(self): method num_timesteps (line 743) | def num_timesteps(self): method __call__ (line 747) | def __call__( FILE: examples/community/pipeline_animatediff_img2video.py function lerp (line 70) | def lerp( function slerp (line 107) | def slerp( function tensor2vid (line 162) | def tensor2vid(video: torch.Tensor, processor, output_type="np"): function retrieve_latents (line 184) | def retrieve_latents( function retrieve_timesteps (line 198) | def retrieve_timesteps( class AnimateDiffImgToVideoPipeline (line 242) | class AnimateDiffImgToVideoPipeline( method __init__ (line 280) | def __init__( method encode_prompt (line 315) | def encode_prompt( method encode_image (line 497) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 522) | def prepare_ip_adapter_image_embeds( method decode_latents (line 557) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 581) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 598) | def check_inputs( method prepare_latents (line 659) | def prepare_latents( method __call__ (line 738) | def __call__( FILE: examples/community/pipeline_animatediff_ipex.py class AnimateDiffPipelineIpex (line 93) | class AnimateDiffPipelineIpex( method __init__ (line 133) | def __init__( method encode_prompt (line 169) | def encode_prompt( method encode_image (line 352) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 377) | def prepare_ip_adapter_image_embeds( method decode_latents (line 429) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 442) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 460) | def check_inputs( method prepare_latents (line 524) | def prepare_latents( method guidance_scale (line 550) | def guidance_scale(self): method clip_skip (line 554) | def clip_skip(self): method do_classifier_free_guidance (line 561) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 565) | def cross_attention_kwargs(self): method num_timesteps (line 569) | def num_timesteps(self): method __call__ (line 574) | def __call__( method prepare_for_ipex (line 829) | def prepare_for_ipex( FILE: examples/community/pipeline_controlnet_xl_kolors.py function retrieve_latents (line 113) | def retrieve_latents( class KolorsControlNetPipeline (line 126) | class KolorsControlNetPipeline( method __init__ (line 189) | def __init__( method encode_prompt (line 232) | def encode_prompt( method prepare_ip_adapter_image_embeds (line 400) | def prepare_ip_adapter_image_embeds( method encode_image (line 433) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_extra_step_kwargs (line 458) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 475) | def check_inputs( method check_image (line 632) | def check_image(self, image, prompt, prompt_embeds): method prepare_control_image (line 670) | def prepare_control_image( method prepare_latents (line 701) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method prepare_latents_t2i (line 719) | def prepare_latents_t2i( method _get_add_time_ids (line 739) | def _get_add_time_ids( method upcast_vae (line 758) | def upcast_vae(self): method guidance_scale (line 763) | def guidance_scale(self): method do_classifier_free_guidance (line 770) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 774) | def cross_attention_kwargs(self): method num_timesteps (line 778) | def num_timesteps(self): method __call__ (line 783) | def __call__( FILE: examples/community/pipeline_controlnet_xl_kolors_img2img.py function retrieve_latents (line 133) | def retrieve_latents( class KolorsControlNetImg2ImgPipeline (line 146) | class KolorsControlNetImg2ImgPipeline( method __init__ (line 210) | def __init__( method encode_prompt (line 253) | def encode_prompt( method encode_image (line 430) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 455) | def prepare_ip_adapter_image_embeds( method prepare_extra_step_kwargs (line 501) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 518) | def check_inputs( method check_image (line 707) | def check_image(self, image, prompt, prompt_embeds): method prepare_control_image (line 745) | def prepare_control_image( method get_timesteps (line 776) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 788) | def prepare_latents( method prepare_latents_t2i (line 858) | def prepare_latents_t2i( method _get_add_time_ids (line 878) | def _get_add_time_ids( method upcast_vae (line 928) | def upcast_vae(self): method guidance_scale (line 933) | def guidance_scale(self): method do_classifier_free_guidance (line 940) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 944) | def cross_attention_kwargs(self): method num_timesteps (line 948) | def num_timesteps(self): method __call__ (line 953) | def __call__( FILE: examples/community/pipeline_controlnet_xl_kolors_inpaint.py function retrieve_latents (line 120) | def retrieve_latents( function retrieve_timesteps (line 134) | def retrieve_timesteps( class KolorsControlNetInpaintPipeline (line 193) | class KolorsControlNetInpaintPipeline( method __init__ (line 259) | def __init__( method encode_prompt (line 305) | def encode_prompt( method encode_image (line 480) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 505) | def prepare_ip_adapter_image_embeds( method prepare_extra_step_kwargs (line 552) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 569) | def check_inputs( method check_image (line 758) | def check_image(self, image, prompt, prompt_embeds): method prepare_control_image (line 796) | def prepare_control_image( method get_timesteps (line 827) | def get_timesteps(self, num_inference_steps, strength, device, denoisi... method prepare_latents (line 864) | def prepare_latents( method prepare_latents_t2i (line 934) | def prepare_latents_t2i( method _get_add_time_ids (line 954) | def _get_add_time_ids( method upcast_vae (line 1004) | def upcast_vae(self): method denoising_end (line 1009) | def denoising_end(self): method denoising_start (line 1013) | def denoising_start(self): method guidance_scale (line 1017) | def guidance_scale(self): method do_classifier_free_guidance (line 1024) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1028) | def cross_attention_kwargs(self): method num_timesteps (line 1032) | def num_timesteps(self): method _encode_vae_image (line 1035) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method prepare_mask_latents (line 1058) | def prepare_mask_latents( method __call__ (line 1113) | def __call__( FILE: examples/community/pipeline_demofusion_sdxl.py function gaussian_kernel (line 58) | def gaussian_kernel(kernel_size=3, sigma=1.0, channels=3): function gaussian_filter (line 68) | def gaussian_filter(latents, kernel_size=3, sigma=1.0): function rescale_noise_cfg (line 77) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): class DemoFusionSDXLPipeline (line 91) | class DemoFusionSDXLPipeline( method __init__ (line 145) | def __init__( method encode_prompt (line 184) | def encode_prompt( method prepare_extra_step_kwargs (line 383) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 400) | def check_inputs( method prepare_latents (line 485) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method _get_add_time_ids (line 507) | def _get_add_time_ids(self, original_size, crops_coords_top_left, targ... method get_views (line 523) | def get_views(self, height, width, window_size=128, stride=64, random_... method tiled_decode (line 573) | def tiled_decode(self, latents, current_height, current_width): method upcast_vae (line 615) | def upcast_vae(self): method __call__ (line 621) | def __call__( method load_lora_weights (line 1279) | def load_lora_weights(self, pretrained_model_name_or_path_or_dict: Uni... method save_lora_weights (line 1341) | def save_lora_weights( method _remove_text_encoder_monkey_patch (line 1380) | def _remove_text_encoder_monkey_patch(self): FILE: examples/community/pipeline_fabric.py class FabricCrossAttnProcessor (line 57) | class FabricCrossAttnProcessor: method __init__ (line 58) | def __init__(self): method __call__ (line 61) | def __call__( class FabricPipeline (line 118) | class FabricPipeline(DiffusionPipeline): method __init__ (line 142) | def __init__( method _encode_prompt (line 190) | def _encode_prompt( method get_unet_hidden_states (line 351) | def get_unet_hidden_states(self, z_all, t, prompt_embd): method unet_forward_with_cached_hidden_states (line 374) | def unet_forward_with_cached_hidden_states( method preprocess_feedback_images (line 458) | def preprocess_feedback_images(self, images, vae, dim, device, dtype, ... method check_inputs (line 465) | def check_inputs( method __call__ (line 498) | def __call__( method image_to_tensor (line 746) | def image_to_tensor(self, image: Union[str, Image.Image], dim: tuple, ... FILE: examples/community/pipeline_faithdiff_stable_diffusion_xl.py function zero_module (line 167) | def zero_module(module): class Encoder (line 174) | class Encoder(nn.Module): method __init__ (line 177) | def __init__( method to_rgb_init (line 251) | def to_rgb_init(self): method enable_tiling (line 259) | def enable_tiling(self): method encode (line 263) | def encode(self, sample: torch.FloatTensor) -> torch.FloatTensor: method blend_v (line 293) | def blend_v(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)... method blend_h (line 300) | def blend_h(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)... method tiled_encode (line 307) | def tiled_encode(self, x: torch.FloatTensor) -> torch.FloatTensor: method forward (line 335) | def forward(self, sample: torch.FloatTensor) -> torch.FloatTensor: class ControlNetConditioningEmbedding (line 344) | class ControlNetConditioningEmbedding(nn.Module): method __init__ (line 347) | def __init__(self, conditioning_embedding_channels: int, conditioning_... method forward (line 355) | def forward(self, conditioning): class QuickGELU (line 364) | class QuickGELU(nn.Module): method forward (line 367) | def forward(self, x: torch.Tensor): class LayerNorm (line 372) | class LayerNorm(nn.LayerNorm): method forward (line 375) | def forward(self, x: torch.Tensor): class ResidualAttentionBlock (line 382) | class ResidualAttentionBlock(nn.Module): method __init__ (line 385) | def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor ... method attention (line 401) | def attention(self, x: torch.Tensor): method forward (line 406) | def forward(self, x: torch.Tensor): class UNet2DConditionOutput (line 414) | class UNet2DConditionOutput(BaseOutput): class UNet2DConditionModel (line 420) | class UNet2DConditionModel(OriginalUNet2DConditionModel, ConfigMixin, UN... method __init__ (line 426) | def __init__( method init_vae_encoder (line 546) | def init_vae_encoder(self, dtype): method init_information_transformer_layes (line 551) | def init_information_transformer_layes(self): method init_ControlNetConditioningEmbedding (line 561) | def init_ControlNetConditioningEmbedding(self, channel=512): method init_extra_weights (line 564) | def init_extra_weights(self): method load_additional_layers (line 567) | def load_additional_layers( method to (line 599) | def to(self, *args, **kwargs): method load_state_dict (line 613) | def load_state_dict(self, state_dict, strict=True): method forward (line 649) | def forward( class LocalAttention (line 881) | class LocalAttention: method __init__ (line 884) | def __init__(self, kernel_size=None, overlap=0.5): method grids_list (line 895) | def grids_list(self, x): method grids (line 941) | def grids(self, x): method _gaussian_weights (line 989) | def _gaussian_weights(self, tile_width, tile_height): method grids_inverse (line 1018) | def grids_inverse(self, outs): method _pad (line 1042) | def _pad(self, x): method forward (line 1059) | def forward(self, x): function rescale_noise_cfg (line 1075) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_latents (line 1098) | def retrieve_latents( function retrieve_timesteps (line 1122) | def retrieve_timesteps( class FaithDiffStableDiffusionXLPipeline (line 1166) | class FaithDiffStableDiffusionXLPipeline( method __init__ (line 1232) | def __init__( method encode_prompt (line 1267) | def encode_prompt( method prepare_extra_step_kwargs (line 1502) | def prepare_extra_step_kwargs(self, generator, eta): method check_image_size (line 1519) | def check_image_size(self, x, padder_size=8): method check_inputs (line 1537) | def check_inputs( method prepare_latents (line 1620) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method upcast_vae (line 1637) | def upcast_vae(self): method get_guidance_scale_embedding (line 1642) | def get_guidance_scale_embedding( method set_encoder_tile_settings (line 1672) | def set_encoder_tile_settings( method enable_vae_tiling (line 1684) | def enable_vae_tiling(self): method disable_vae_tiling (line 1699) | def disable_vae_tiling(self): method guidance_scale (line 1714) | def guidance_scale(self): method guidance_rescale (line 1718) | def guidance_rescale(self): method clip_skip (line 1722) | def clip_skip(self): method do_classifier_free_guidance (line 1729) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1733) | def cross_attention_kwargs(self): method denoising_end (line 1737) | def denoising_end(self): method num_timesteps (line 1741) | def num_timesteps(self): method interrupt (line 1745) | def interrupt(self): method prepare_image_latents (line 1748) | def prepare_image_latents( method __call__ (line 1803) | def __call__( FILE: examples/community/pipeline_flux_differential_img2img.py function calculate_shift (line 85) | def calculate_shift( function retrieve_latents (line 99) | def retrieve_latents( function retrieve_timesteps (line 113) | def retrieve_timesteps( class FluxDifferentialImg2ImgPipeline (line 172) | class FluxDifferentialImg2ImgPipeline(DiffusionPipeline, FluxLoraLoaderM... method __init__ (line 203) | def __init__( method _get_t5_prompt_embeds (line 240) | def _get_t5_prompt_embeds( method _get_clip_prompt_embeds (line 287) | def _get_clip_prompt_embeds( method encode_prompt (line 329) | def encode_prompt( method _encode_vae_image (line 409) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method get_timesteps (line 424) | def get_timesteps(self, num_inference_steps, strength, device): method check_inputs (line 435) | def check_inputs( method _prepare_latent_image_ids (line 506) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype): method _pack_latents (line 521) | def _pack_latents(latents, batch_size, num_channels_latents, height, w... method _unpack_latents (line 530) | def _unpack_latents(latents, height, width, vae_scale_factor): method prepare_latents (line 543) | def prepare_latents( method prepare_mask_latents (line 594) | def prepare_mask_latents( method guidance_scale (line 665) | def guidance_scale(self): method joint_attention_kwargs (line 669) | def joint_attention_kwargs(self): method num_timesteps (line 673) | def num_timesteps(self): method interrupt (line 677) | def interrupt(self): method __call__ (line 682) | def __call__( FILE: examples/community/pipeline_flux_kontext_multiple_images.py function calculate_shift (line 116) | def calculate_shift( function retrieve_timesteps (line 130) | def retrieve_timesteps( function retrieve_latents (line 190) | def retrieve_latents( class FluxKontextPipeline (line 203) | class FluxKontextPipeline( method __init__ (line 240) | def __init__( method _get_t5_prompt_embeds (line 276) | def _get_t5_prompt_embeds( method _get_clip_prompt_embeds (line 326) | def _get_clip_prompt_embeds( method encode_prompt (line 371) | def encode_prompt( method encode_image (line 451) | def encode_image(self, image, device, num_images_per_prompt): method prepare_ip_adapter_image_embeds (line 463) | def prepare_ip_adapter_image_embeds( method check_inputs (line 500) | def check_inputs( method _prepare_latent_image_ids (line 571) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype): method _pack_latents (line 586) | def _pack_latents(latents, batch_size, num_channels_latents, height, w... method _unpack_latents (line 595) | def _unpack_latents(latents, height, width, vae_scale_factor): method _encode_vae_image (line 610) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method enable_vae_slicing (line 625) | def enable_vae_slicing(self): method disable_vae_slicing (line 633) | def disable_vae_slicing(self): method enable_vae_tiling (line 641) | def enable_vae_tiling(self): method disable_vae_tiling (line 656) | def disable_vae_tiling(self): method preprocess_image (line 669) | def preprocess_image(self, image: PipelineImageInput, _auto_resize: bo... method preprocess_images (line 684) | def preprocess_images( method prepare_latents (line 721) | def prepare_latents( method guidance_scale (line 796) | def guidance_scale(self): method joint_attention_kwargs (line 800) | def joint_attention_kwargs(self): method num_timesteps (line 804) | def num_timesteps(self): method current_timestep (line 808) | def current_timestep(self): method interrupt (line 812) | def interrupt(self): method __call__ (line 817) | def __call__( FILE: examples/community/pipeline_flux_rf_inversion.py function calculate_shift (line 93) | def calculate_shift( function retrieve_timesteps (line 107) | def retrieve_timesteps( class RFInversionFluxPipeline (line 166) | class RFInversionFluxPipeline( method __init__ (line 202) | def __init__( method _get_t5_prompt_embeds (line 231) | def _get_t5_prompt_embeds( method _get_clip_prompt_embeds (line 281) | def _get_clip_prompt_embeds( method encode_prompt (line 326) | def encode_prompt( method encode_image (line 407) | def encode_image(self, image, dtype=None, height=None, width=None, res... method check_inputs (line 426) | def check_inputs( method _prepare_latent_image_ids (line 490) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype): method _pack_latents (line 504) | def _pack_latents(latents, batch_size, num_channels_latents, height, w... method _unpack_latents (line 512) | def _unpack_latents(latents, height, width, vae_scale_factor): method enable_vae_slicing (line 525) | def enable_vae_slicing(self): method disable_vae_slicing (line 538) | def disable_vae_slicing(self): method enable_vae_tiling (line 551) | def enable_vae_tiling(self): method disable_vae_tiling (line 565) | def disable_vae_tiling(self): method prepare_latents_inversion (line 578) | def prepare_latents_inversion( method prepare_latents (line 598) | def prepare_latents( method get_timesteps (line 634) | def get_timesteps(self, num_inference_steps, strength=1.0): method guidance_scale (line 647) | def guidance_scale(self): method joint_attention_kwargs (line 651) | def joint_attention_kwargs(self): method num_timesteps (line 655) | def num_timesteps(self): method interrupt (line 659) | def interrupt(self): method __call__ (line 664) | def __call__( method invert (line 957) | def invert( FILE: examples/community/pipeline_flux_semantic_guidance.py function calculate_shift (line 90) | def calculate_shift( function retrieve_timesteps (line 104) | def retrieve_timesteps( class FluxSemanticGuidancePipeline (line 163) | class FluxSemanticGuidancePipeline( method __init__ (line 200) | def __init__( method _get_t5_prompt_embeds (line 235) | def _get_t5_prompt_embeds( method _get_clip_prompt_embeds (line 285) | def _get_clip_prompt_embeds( method encode_prompt (line 330) | def encode_prompt( method encode_text_with_editing (line 409) | def encode_text_with_editing( method encode_image (line 521) | def encode_image(self, image, device, num_images_per_prompt): method prepare_ip_adapter_image_embeds (line 533) | def prepare_ip_adapter_image_embeds( method check_inputs (line 565) | def check_inputs( method _prepare_latent_image_ids (line 644) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype): method _pack_latents (line 659) | def _pack_latents(latents, batch_size, num_channels_latents, height, w... method _unpack_latents (line 668) | def _unpack_latents(latents, height, width, vae_scale_factor): method enable_vae_slicing (line 684) | def enable_vae_slicing(self): method disable_vae_slicing (line 692) | def disable_vae_slicing(self): method enable_vae_tiling (line 700) | def enable_vae_tiling(self): method disable_vae_tiling (line 715) | def disable_vae_tiling(self): method prepare_latents (line 729) | def prepare_latents( method guidance_scale (line 765) | def guidance_scale(self): method joint_attention_kwargs (line 769) | def joint_attention_kwargs(self): method num_timesteps (line 773) | def num_timesteps(self): method interrupt (line 777) | def interrupt(self): method __call__ (line 782) | def __call__( FILE: examples/community/pipeline_flux_with_cfg.py function calculate_shift (line 69) | def calculate_shift( function retrieve_timesteps (line 83) | def retrieve_timesteps( class FluxCFGPipeline (line 142) | class FluxCFGPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FromSingle... method __init__ (line 173) | def __init__( method _get_t5_prompt_embeds (line 201) | def _get_t5_prompt_embeds( method _get_clip_prompt_embeds (line 247) | def _get_clip_prompt_embeds( method encode_prompt (line 288) | def encode_prompt( method check_inputs (line 391) | def check_inputs( method _prepare_latent_image_ids (line 467) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype): method _pack_latents (line 481) | def _pack_latents(latents, batch_size, num_channels_latents, height, w... method _unpack_latents (line 489) | def _unpack_latents(latents, height, width, vae_scale_factor): method enable_vae_slicing (line 502) | def enable_vae_slicing(self): method disable_vae_slicing (line 515) | def disable_vae_slicing(self): method enable_vae_tiling (line 528) | def enable_vae_tiling(self): method disable_vae_tiling (line 542) | def disable_vae_tiling(self): method prepare_latents (line 555) | def prepare_latents( method guidance_scale (line 589) | def guidance_scale(self): method joint_attention_kwargs (line 593) | def joint_attention_kwargs(self): method num_timesteps (line 597) | def num_timesteps(self): method interrupt (line 601) | def interrupt(self): method __call__ (line 606) | def __call__( FILE: examples/community/pipeline_hunyuandit_differential_img2img.py function map_to_standard_shapes (line 121) | def map_to_standard_shapes(target_width, target_height): function get_resize_crop_region_for_grid (line 129) | def get_resize_crop_region_for_grid(src, tgt_size): function rescale_noise_cfg (line 150) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_latents (line 165) | def retrieve_latents( function retrieve_timesteps (line 181) | def retrieve_timesteps( class HunyuanDiTDifferentialImg2ImgPipeline (line 240) | class HunyuanDiTDifferentialImg2ImgPipeline(DiffusionPipeline): method __init__ (line 287) | def __init__( method encode_prompt (line 345) | def encode_prompt( method run_safety_checker (line 516) | def run_safety_checker(self, image, device, dtype): method prepare_extra_step_kwargs (line 531) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 548) | def check_inputs( method get_timesteps (line 624) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 636) | def prepare_latents( method guidance_scale (line 704) | def guidance_scale(self): method guidance_rescale (line 708) | def guidance_rescale(self): method do_classifier_free_guidance (line 715) | def do_classifier_free_guidance(self): method num_timesteps (line 719) | def num_timesteps(self): method interrupt (line 723) | def interrupt(self): method __call__ (line 728) | def __call__( FILE: examples/community/pipeline_kolors_differential_img2img.py function retrieve_latents (line 69) | def retrieve_latents( function retrieve_timesteps (line 83) | def retrieve_timesteps( class KolorsDifferentialImg2ImgPipeline (line 142) | class KolorsDifferentialImg2ImgPipeline( method __init__ (line 188) | def __init__( method encode_prompt (line 225) | def encode_prompt( method encode_image (line 390) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 415) | def prepare_ip_adapter_image_embeds( method prepare_extra_step_kwargs (line 461) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 478) | def check_inputs( method get_timesteps (line 569) | def get_timesteps(self, num_inference_steps, strength, device, denoisi... method prepare_latents (line 606) | def prepare_latents( method _get_add_time_ids (line 693) | def _get_add_time_ids( method upcast_vae (line 711) | def upcast_vae(self): method get_guidance_scale_embedding (line 716) | def get_guidance_scale_embedding( method guidance_scale (line 747) | def guidance_scale(self): method do_classifier_free_guidance (line 754) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 758) | def cross_attention_kwargs(self): method denoising_start (line 762) | def denoising_start(self): method denoising_end (line 766) | def denoising_end(self): method num_timesteps (line 770) | def num_timesteps(self): method interrupt (line 774) | def interrupt(self): method __call__ (line 779) | def __call__( FILE: examples/community/pipeline_kolors_inpainting.py function rescale_noise_cfg (line 92) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function mask_pil_to_torch (line 106) | def mask_pil_to_torch(mask, height, width): function prepare_mask_and_masked_image (line 122) | def prepare_mask_and_masked_image(image, mask, height, width, return_ima... function retrieve_latents (line 241) | def retrieve_latents( function retrieve_timesteps (line 255) | def retrieve_timesteps( class KolorsInpaintPipeline (line 314) | class KolorsInpaintPipeline( method __init__ (line 376) | def __init__( method encode_image (line 416) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 441) | def prepare_ip_adapter_image_embeds( method encode_prompt (line 492) | def encode_prompt( method prepare_extra_step_kwargs (line 667) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 684) | def check_inputs( method prepare_latents (line 774) | def prepare_latents( method _encode_vae_image (line 840) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method prepare_mask_latents (line 863) | def prepare_mask_latents( method get_timesteps (line 917) | def get_timesteps(self, num_inference_steps, strength, device, denoisi... method _get_add_time_ids (line 954) | def _get_add_time_ids( method upcast_vae (line 1004) | def upcast_vae(self): method get_guidance_scale_embedding (line 1009) | def get_guidance_scale_embedding( method guidance_scale (line 1040) | def guidance_scale(self): method guidance_rescale (line 1044) | def guidance_rescale(self): method do_classifier_free_guidance (line 1051) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1055) | def cross_attention_kwargs(self): method denoising_end (line 1059) | def denoising_end(self): method denoising_start (line 1063) | def denoising_start(self): method num_timesteps (line 1067) | def num_timesteps(self): method interrupt (line 1071) | def interrupt(self): method __call__ (line 1076) | def __call__( FILE: examples/community/pipeline_null_text_inversion.py function retrieve_timesteps (line 15) | def retrieve_timesteps( class NullTextPipeline (line 58) | class NullTextPipeline(StableDiffusionPipeline): method get_noise_pred (line 59) | def get_noise_pred(self, latents, t, context): method get_noise_pred_single (line 68) | def get_noise_pred_single(self, latents, t, context): method image2latent (line 73) | def image2latent(self, image_path): method latent2image (line 83) | def latent2image(self, latents): method prev_step (line 89) | def prev_step(self, model_output, timestep, sample): method next_step (line 101) | def next_step(self, model_output, timestep, sample): method null_optimization (line 114) | def null_optimization(self, latents, context, num_inner_steps, epsilon): method ddim_inversion_loop (line 149) | def ddim_inversion_loop(self, latent, context): method get_context (line 162) | def get_context(self, prompt): method invert (line 178) | def invert( method __call__ (line 194) | def __call__( FILE: examples/community/pipeline_prompt2prompt.py function rescale_noise_cfg (line 61) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): class Prompt2PromptPipeline (line 75) | class Prompt2PromptPipeline( method __init__ (line 120) | def __init__( method _encode_prompt (line 217) | def _encode_prompt( method encode_prompt (line 250) | def encode_prompt( method run_safety_checker (line 434) | def run_safety_checker(self, image, device, dtype): method prepare_extra_step_kwargs (line 449) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 467) | def check_inputs( method prepare_latents (line 527) | def prepare_latents( method __call__ (line 560) | def __call__( method register_attention_control (line 778) | def register_attention_control(self, controller): class P2PCrossAttnProcessor (line 803) | class P2PCrossAttnProcessor: method __init__ (line 804) | def __init__(self, controller, place_in_unet): method __call__ (line 809) | def __call__( function create_controller (line 846) | def create_controller( class AttentionControl (line 930) | class AttentionControl(abc.ABC): method step_callback (line 931) | def step_callback(self, x_t): method between_steps (line 934) | def between_steps(self): method num_uncond_att_layers (line 938) | def num_uncond_att_layers(self): method forward (line 942) | def forward(self, attn, is_cross: bool, place_in_unet: str): method __call__ (line 945) | def __call__(self, attn, is_cross: bool, place_in_unet: str): method reset (line 956) | def reset(self): method __init__ (line 960) | def __init__(self): class EmptyControl (line 966) | class EmptyControl(AttentionControl): method forward (line 967) | def forward(self, attn, is_cross: bool, place_in_unet: str): class AttentionStore (line 971) | class AttentionStore(AttentionControl): method get_empty_store (line 973) | def get_empty_store(): method forward (line 983) | def forward(self, attn, is_cross: bool, place_in_unet: str): method between_steps (line 989) | def between_steps(self): method get_average_attention (line 998) | def get_average_attention(self): method reset (line 1004) | def reset(self): method __init__ (line 1009) | def __init__(self): class LocalBlend (line 1015) | class LocalBlend: method __call__ (line 1016) | def __call__(self, x_t, attention_store): method __init__ (line 1030) | def __init__( class AttentionControlEdit (line 1052) | class AttentionControlEdit(AttentionStore, abc.ABC): method step_callback (line 1053) | def step_callback(self, x_t): method replace_self_attention (line 1058) | def replace_self_attention(self, attn_base, att_replace): method replace_cross_attention (line 1065) | def replace_cross_attention(self, attn_base, att_replace): method forward (line 1068) | def forward(self, attn, is_cross: bool, place_in_unet: str): method __init__ (line 1087) | def __init__( class AttentionReplace (line 1113) | class AttentionReplace(AttentionControlEdit): method replace_cross_attention (line 1114) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 1117) | def __init__( class AttentionRefine (line 1139) | class AttentionRefine(AttentionControlEdit): method replace_cross_attention (line 1140) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 1145) | def __init__( class AttentionReweight (line 1169) | class AttentionReweight(AttentionControlEdit): method replace_cross_attention (line 1170) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 1176) | def __init__( function update_alpha_time_word (line 1202) | def update_alpha_time_word( function get_time_words_attention_alpha (line 1219) | def get_time_words_attention_alpha( function get_word_inds (line 1244) | def get_word_inds(text: str, word_place: int, tokenizer): function get_replacement_mapper_ (line 1266) | def get_replacement_mapper_(x: str, y: str, tokenizer, max_len=77): function get_replacement_mapper (line 1304) | def get_replacement_mapper(prompts, tokenizer, max_len=77): function get_equalizer (line 1314) | def get_equalizer( class ScoreParams (line 1331) | class ScoreParams: method __init__ (line 1332) | def __init__(self, gap, match, mismatch): method mis_match_char (line 1337) | def mis_match_char(self, x, y): function get_matrix (line 1344) | def get_matrix(size_x, size_y, gap): function get_traceback_matrix (line 1351) | def get_traceback_matrix(size_x, size_y): function global_align (line 1359) | def global_align(x, y, score): function get_aligned_sequences (line 1377) | def get_aligned_sequences(x, y, trace_back): function get_mapper (line 1405) | def get_mapper(x: str, y: str, tokenizer, max_len=77): function get_refinement_mapper (line 1419) | def get_refinement_mapper(prompts, tokenizer, max_len=77): FILE: examples/community/pipeline_sdxl_style_aligned.py function expand_first (line 134) | def expand_first(feat: torch.Tensor, scale: float = 1.0) -> torch.Tensor: function concat_first (line 145) | def concat_first(feat: torch.Tensor, dim: int = 2, scale: float = 1.0) -... function calc_mean_std (line 150) | def calc_mean_std(feat: torch.Tensor, eps: float = 1e-5) -> Tuple[torch.... function adain (line 156) | def adain(feat: torch.Tensor) -> torch.Tensor: function get_switch_vec (line 165) | def get_switch_vec(total_num_layers, level): class SharedAttentionProcessor (line 182) | class SharedAttentionProcessor(AttnProcessor2_0): method __init__ (line 183) | def __init__( method shifted_scaled_dot_product_attention (line 203) | def shifted_scaled_dot_product_attention( method shared_call (line 211) | def shared_call( method __call__ (line 284) | def __call__( function rescale_noise_cfg (line 313) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_timesteps (line 328) | def retrieve_timesteps( function retrieve_latents (line 373) | def retrieve_latents( class StyleAlignedSDXLPipeline (line 386) | class StyleAlignedSDXLPipeline( method __init__ (line 461) | def __init__( method encode_prompt (line 508) | def encode_prompt( method encode_image (line 746) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_extra_step_kwargs (line 771) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 788) | def check_inputs( method get_timesteps (line 867) | def get_timesteps(self, num_inference_steps, strength, device, denoisi... method prepare_latents (line 903) | def prepare_latents( method prepare_mask_latents (line 1059) | def prepare_mask_latents( method _encode_vae_image (line 1112) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method _get_add_time_ids (line 1135) | def _get_add_time_ids(self, original_size, crops_coords_top_left, targ... method upcast_vae (line 1151) | def upcast_vae(self): method _enable_shared_attention_processors (line 1155) | def _enable_shared_attention_processors( method _disable_shared_attention_processors (line 1192) | def _disable_shared_attention_processors(self): method _register_shared_norm (line 1204) | def _register_shared_norm(self, share_group_norm: bool = True, share_l... method style_aligned_enabled (line 1241) | def style_aligned_enabled(self): method enable_style_aligned (line 1245) | def enable_style_aligned( method disable_style_aligned (line 1292) | def disable_style_aligned(self): method get_guidance_scale_embedding (line 1302) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 1331) | def guidance_scale(self): method guidance_rescale (line 1335) | def guidance_rescale(self): method clip_skip (line 1339) | def clip_skip(self): method do_classifier_free_guidance (line 1346) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1350) | def cross_attention_kwargs(self): method denoising_end (line 1354) | def denoising_end(self): method denoising_start (line 1358) | def denoising_start(self): method num_timesteps (line 1362) | def num_timesteps(self): method interrupt (line 1366) | def interrupt(self): method __call__ (line 1371) | def __call__( FILE: examples/community/pipeline_stable_diffusion_3_differential_img2img.py function retrieve_latents (line 70) | def retrieve_latents( function retrieve_timesteps (line 84) | def retrieve_timesteps( class StableDiffusion3DifferentialImg2ImgPipeline (line 143) | class StableDiffusion3DifferentialImg2ImgPipeline(DiffusionPipeline): method __init__ (line 181) | def __init__( method _get_t5_prompt_embeds (line 218) | def _get_t5_prompt_embeds( method _get_clip_prompt_embeds (line 275) | def _get_clip_prompt_embeds( method encode_prompt (line 331) | def encode_prompt( method check_inputs (line 500) | def check_inputs( method get_timesteps (line 589) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 598) | def prepare_latents( method guidance_scale (line 645) | def guidance_scale(self): method clip_skip (line 649) | def clip_skip(self): method do_classifier_free_guidance (line 656) | def do_classifier_free_guidance(self): method num_timesteps (line 660) | def num_timesteps(self): method interrupt (line 664) | def interrupt(self): method __call__ (line 669) | def __call__( FILE: examples/community/pipeline_stable_diffusion_3_instruct_pix2pix.py function calculate_shift (line 90) | def calculate_shift( function retrieve_latents (line 104) | def retrieve_latents( function retrieve_timesteps (line 118) | def retrieve_timesteps( class StableDiffusion3InstructPix2PixPipeline (line 177) | class StableDiffusion3InstructPix2PixPipeline( method __init__ (line 221) | def __init__( method _get_t5_prompt_embeds (line 264) | def _get_t5_prompt_embeds( method _get_clip_prompt_embeds (line 320) | def _get_clip_prompt_embeds( method encode_prompt (line 375) | def encode_prompt( method check_inputs (line 568) | def check_inputs( method prepare_latents (line 664) | def prepare_latents( method prepare_image_latents (line 695) | def prepare_image_latents( method guidance_scale (line 746) | def guidance_scale(self): method image_guidance_scale (line 750) | def image_guidance_scale(self): method skip_guidance_layers (line 754) | def skip_guidance_layers(self): method clip_skip (line 758) | def clip_skip(self): method do_classifier_free_guidance (line 765) | def do_classifier_free_guidance(self): method joint_attention_kwargs (line 769) | def joint_attention_kwargs(self): method num_timesteps (line 773) | def num_timesteps(self): method interrupt (line 777) | def interrupt(self): method encode_image (line 781) | def encode_image(self, image: PipelineImageInput, device: torch.device... method prepare_ip_adapter_image_embeds (line 801) | def prepare_ip_adapter_image_embeds( method enable_sequential_cpu_offload (line 847) | def enable_sequential_cpu_offload(self, *args, **kwargs): method __call__ (line 859) | def __call__( FILE: examples/community/pipeline_stable_diffusion_boxdiff.py class GaussianSmoothing (line 71) | class GaussianSmoothing(nn.Module): method __init__ (line 86) | def __init__(self, channels, kernel_size, sigma, dim=2): method forward (line 120) | def forward(self, input): class AttendExciteCrossAttnProcessor (line 131) | class AttendExciteCrossAttnProcessor: method __init__ (line 132) | def __init__(self, attnstore, place_in_unet): method __call__ (line 137) | def __call__( class AttentionControl (line 171) | class AttentionControl(abc.ABC): method step_callback (line 172) | def step_callback(self, x_t): method between_steps (line 175) | def between_steps(self): method forward (line 183) | def forward(self, attn, is_cross: bool, place_in_unet: str): method __call__ (line 186) | def __call__(self, attn, is_cross: bool, place_in_unet: str): method reset (line 195) | def reset(self): method __init__ (line 199) | def __init__(self): class AttentionStore (line 205) | class AttentionStore(AttentionControl): method get_empty_store (line 207) | def get_empty_store(): method forward (line 210) | def forward(self, attn, is_cross: bool, place_in_unet: str): method between_steps (line 216) | def between_steps(self): method get_average_attention (line 229) | def get_average_attention(self): method get_average_global_attention (line 233) | def get_average_global_attention(self): method reset (line 239) | def reset(self): method __init__ (line 245) | def __init__(self, save_global_store=False): function aggregate_attention (line 259) | def aggregate_attention( function register_attention_control (line 282) | def register_attention_control(model, controller): function rescale_noise_cfg (line 307) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_timesteps (line 321) | def retrieve_timesteps( class StableDiffusionBoxDiffPipeline (line 365) | class StableDiffusionBoxDiffPipeline( method __init__ (line 406) | def __init__( method enable_vae_slicing (line 502) | def enable_vae_slicing(self): method disable_vae_slicing (line 515) | def disable_vae_slicing(self): method enable_vae_tiling (line 528) | def enable_vae_tiling(self): method disable_vae_tiling (line 542) | def disable_vae_tiling(self): method _encode_prompt (line 555) | def _encode_prompt( method encode_prompt (line 587) | def encode_prompt( method encode_image (line 768) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method run_safety_checker (line 792) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 806) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 817) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 834) | def check_inputs( method prepare_latents (line 902) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method enable_freeu (line 919) | def enable_freeu(self, s1: float, s2: float, b1: float, b2: float): method disable_freeu (line 941) | def disable_freeu(self): method fuse_qkv_projections (line 946) | def fuse_qkv_projections(self, unet: bool = True, vae: bool = True): method unfuse_qkv_projections (line 975) | def unfuse_qkv_projections(self, unet: bool = True, vae: bool = True): method get_guidance_scale_embedding (line 1001) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 1030) | def guidance_scale(self): method guidance_rescale (line 1034) | def guidance_rescale(self): method clip_skip (line 1038) | def clip_skip(self): method do_classifier_free_guidance (line 1045) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1049) | def cross_attention_kwargs(self): method num_timesteps (line 1053) | def num_timesteps(self): method interrupt (line 1057) | def interrupt(self): method _compute_max_attention_per_index (line 1060) | def _compute_max_attention_per_index( method _aggregate_and_get_max_attention_per_token (line 1143) | def _aggregate_and_get_max_attention_per_token( method _compute_loss (line 1178) | def _compute_loss( method _update_latent (line 1195) | def _update_latent(latents: torch.Tensor, loss: torch.Tensor, step_siz... method _perform_iterative_refinement_step (line 1201) | def _perform_iterative_refinement_step( method __call__ (line 1312) | def __call__( FILE: examples/community/pipeline_stable_diffusion_pag.py class PAGIdentitySelfAttnProcessor (line 53) | class PAGIdentitySelfAttnProcessor: method __init__ (line 58) | def __init__(self): method __call__ (line 62) | def __call__( class PAGCFGIdentitySelfAttnProcessor (line 167) | class PAGCFGIdentitySelfAttnProcessor: method __init__ (line 172) | def __init__(self): method __call__ (line 176) | def __call__( function rescale_noise_cfg (line 279) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_timesteps (line 293) | def retrieve_timesteps( class StableDiffusionPAGPipeline (line 335) | class StableDiffusionPAGPipeline( method __init__ (line 373) | def __init__( method enable_vae_slicing (line 469) | def enable_vae_slicing(self): method disable_vae_slicing (line 482) | def disable_vae_slicing(self): method enable_vae_tiling (line 495) | def enable_vae_tiling(self): method disable_vae_tiling (line 509) | def disable_vae_tiling(self): method _encode_prompt (line 522) | def _encode_prompt( method encode_prompt (line 554) | def encode_prompt( method encode_image (line 734) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 758) | def prepare_ip_adapter_image_embeds( method run_safety_checker (line 792) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 806) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 817) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 834) | def check_inputs( method prepare_latents (line 893) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method enable_freeu (line 915) | def enable_freeu(self, s1: float, s2: float, b1: float, b2: float): method disable_freeu (line 934) | def disable_freeu(self): method fuse_qkv_projections (line 939) | def fuse_qkv_projections(self, unet: bool = True, vae: bool = True): method unfuse_qkv_projections (line 966) | def unfuse_qkv_projections(self, unet: bool = True, vae: bool = True): method get_guidance_scale_embedding (line 989) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method pred_z0 (line 1015) | def pred_z0(self, sample, model_output, timestep): method pred_x0 (line 1035) | def pred_x0(self, latents, noise_pred, t, generator, device, prompt_em... method guidance_scale (line 1045) | def guidance_scale(self): method guidance_rescale (line 1049) | def guidance_rescale(self): method clip_skip (line 1053) | def clip_skip(self): method do_classifier_free_guidance (line 1060) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1064) | def cross_attention_kwargs(self): method num_timesteps (line 1068) | def num_timesteps(self): method interrupt (line 1072) | def interrupt(self): method pag_scale (line 1076) | def pag_scale(self): method do_perturbed_attention_guidance (line 1080) | def do_perturbed_attention_guidance(self): method pag_adaptive_scaling (line 1084) | def pag_adaptive_scaling(self): method do_pag_adaptive_scaling (line 1088) | def do_pag_adaptive_scaling(self): method pag_applied_layers_index (line 1092) | def pag_applied_layers_index(self): method __call__ (line 1097) | def __call__( FILE: examples/community/pipeline_stable_diffusion_upscale_ldm3d.py class StableDiffusionUpscaleLDM3DPipeline (line 71) | class StableDiffusionUpscaleLDM3DPipeline( method __init__ (line 111) | def __init__( method _encode_prompt (line 160) | def _encode_prompt( method encode_prompt (line 193) | def encode_prompt( method run_safety_checker (line 374) | def run_safety_checker(self, image, device, dtype): method prepare_extra_step_kwargs (line 390) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 407) | def check_inputs( method prepare_latents (line 493) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method upcast_vae (line 506) | def upcast_vae(self): method __call__ (line 511) | def __call__( FILE: examples/community/pipeline_stable_diffusion_xl_attentive_eraser.py class AttentionBase (line 148) | class AttentionBase: method __init__ (line 149) | def __init__(self): method after_step (line 154) | def after_step(self): method __call__ (line 157) | def __call__(self, q, k, v, sim, attn, is_cross, place_in_unet, num_he... method forward (line 167) | def forward(self, q, k, v, sim, attn, is_cross, place_in_unet, num_hea... method reset (line 172) | def reset(self): class AAS_XL (line 177) | class AAS_XL(AttentionBase): method __init__ (line 180) | def __init__( method attn_batch (line 221) | def attn_batch(self, q, k, v, sim, attn, is_cross, place_in_unet, num_... method forward (line 243) | def forward(self, q, k, v, sim, attn, is_cross, place_in_unet, num_hea... function rescale_noise_cfg (line 295) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function mask_pil_to_torch (line 309) | def mask_pil_to_torch(mask, height, width): function prepare_mask_and_masked_image (line 325) | def prepare_mask_and_masked_image(image, mask, height, width, return_ima... function retrieve_latents (line 437) | def retrieve_latents( function retrieve_timesteps (line 451) | def retrieve_timesteps( class StableDiffusionXL_AE_Pipeline (line 495) | class StableDiffusionXL_AE_Pipeline( method __init__ (line 573) | def __init__( method encode_image (line 617) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 642) | def prepare_ip_adapter_image_embeds( method encode_prompt (line 694) | def encode_prompt( method prepare_extra_step_kwargs (line 929) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 946) | def check_inputs( method prepare_latents (line 1050) | def prepare_latents( method _encode_vae_image (line 1111) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method prepare_mask_latents (line 1134) | def prepare_mask_latents( method get_timesteps (line 1189) | def get_timesteps(self, num_inference_steps, strength, device, denoisi... method _get_add_time_ids (line 1226) | def _get_add_time_ids( method upcast_vae (line 1278) | def upcast_vae(self): method get_guidance_scale_embedding (line 1283) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 1312) | def guidance_scale(self): method guidance_rescale (line 1316) | def guidance_rescale(self): method clip_skip (line 1320) | def clip_skip(self): method do_self_attention_redirection_guidance (line 1324) | def do_self_attention_redirection_guidance(self): # SARG method do_classifier_free_guidance (line 1331) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1339) | def cross_attention_kwargs(self): method denoising_end (line 1343) | def denoising_end(self): method denoising_start (line 1347) | def denoising_start(self): method num_timesteps (line 1351) | def num_timesteps(self): method interrupt (line 1355) | def interrupt(self): method image2latent (line 1359) | def image2latent(self, image: torch.Tensor, generator: torch.Generator): method next_step (line 1372) | def next_step(self, model_output: torch.FloatTensor, timestep: int, x:... method invert (line 1389) | def invert( method opt (line 1523) | def opt( method regiter_attention_editor_diffusers (line 1539) | def regiter_attention_editor_diffusers(self, unet, editor: AttentionBa... method __call__ (line 1608) | def __call__( FILE: examples/community/pipeline_stable_diffusion_xl_controlnet_adapter.py function _preprocess_adapter_image (line 113) | def _preprocess_adapter_image(image, height, width): function rescale_noise_cfg (line 141) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): class StableDiffusionXLControlNetAdapterPipeline (line 155) | class StableDiffusionXLControlNetAdapterPipeline( method __init__ (line 199) | def __init__( method encode_prompt (line 241) | def encode_prompt( method prepare_extra_step_kwargs (line 479) | def prepare_extra_step_kwargs(self, generator, eta): method check_image (line 497) | def check_image(self, image, prompt, prompt_embeds): method check_inputs (line 535) | def check_inputs( method check_conditions (line 614) | def check_conditions( method prepare_latents (line 755) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method _get_add_time_ids (line 778) | def _get_add_time_ids( method upcast_vae (line 796) | def upcast_vae(self): method _default_height_width (line 801) | def _default_height_width(self, height, width, image): method prepare_control_image (line 828) | def prepare_control_image( method __call__ (line 860) | def __call__( FILE: examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py function _preprocess_adapter_image (line 131) | def _preprocess_adapter_image(image, height, width): function mask_pil_to_torch (line 158) | def mask_pil_to_torch(mask, height, width): function prepare_mask_and_masked_image (line 174) | def prepare_mask_and_masked_image(image, mask, height, width, return_ima... function rescale_noise_cfg (line 287) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): class StableDiffusionXLControlNetAdapterInpaintPipeline (line 301) | class StableDiffusionXLControlNetAdapterInpaintPipeline( method __init__ (line 344) | def __init__( method encode_prompt (line 388) | def encode_prompt( method prepare_extra_step_kwargs (line 626) | def prepare_extra_step_kwargs(self, generator, eta): method check_image (line 644) | def check_image(self, image, prompt, prompt_embeds): method check_inputs (line 682) | def check_inputs( method check_conditions (line 761) | def check_conditions( method prepare_latents (line 901) | def prepare_latents( method _encode_vae_image (line 967) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method prepare_mask_latents (line 990) | def prepare_mask_latents( method get_timesteps (line 1051) | def get_timesteps(self, num_inference_steps, strength, device, denoisi... method _get_add_time_ids (line 1087) | def _get_add_time_ids( method upcast_vae (line 1133) | def upcast_vae(self): method _default_height_width (line 1138) | def _default_height_width(self, height, width, image): method prepare_control_image (line 1165) | def prepare_control_image( method __call__ (line 1197) | def __call__( FILE: examples/community/pipeline_stable_diffusion_xl_differential_img2img.py function rescale_noise_cfg (line 88) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_latents (line 103) | def retrieve_latents( function retrieve_timesteps (line 117) | def retrieve_timesteps( class StableDiffusionXLDifferentialImg2ImgPipeline (line 161) | class StableDiffusionXLDifferentialImg2ImgPipeline( method __init__ (line 227) | def __init__( method encode_prompt (line 268) | def encode_prompt( method prepare_extra_step_kwargs (line 506) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 523) | def check_inputs( method get_timesteps (line 613) | def get_timesteps(self, num_inference_steps, strength, device, denoisi... method prepare_latents (line 649) | def prepare_latents( method encode_image (line 718) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 743) | def prepare_ip_adapter_image_embeds( method _get_add_time_ids (line 794) | def _get_add_time_ids( method upcast_vae (line 846) | def upcast_vae(self): method get_guidance_scale_embedding (line 851) | def get_guidance_scale_embedding( method guidance_scale (line 882) | def guidance_scale(self): method guidance_rescale (line 886) | def guidance_rescale(self): method clip_skip (line 890) | def clip_skip(self): method do_classifier_free_guidance (line 897) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 901) | def cross_attention_kwargs(self): method denoising_end (line 905) | def denoising_end(self): method denoising_start (line 909) | def denoising_start(self): method num_timesteps (line 913) | def num_timesteps(self): method interrupt (line 917) | def interrupt(self): method __call__ (line 922) | def __call__( FILE: examples/community/pipeline_stable_diffusion_xl_instandid_img2img.py function FeedForward (line 55) | def FeedForward(dim, mult=4): function reshape_tensor (line 65) | def reshape_tensor(x, heads): class PerceiverAttention (line 76) | class PerceiverAttention(nn.Module): method __init__ (line 77) | def __init__(self, *, dim, dim_head=64, heads=8): method forward (line 91) | def forward(self, x, latents): class Resampler (line 123) | class Resampler(nn.Module): method __init__ (line 124) | def __init__( method forward (line 155) | def forward(self, x): class AttnProcessor (line 167) | class AttnProcessor(nn.Module): method __init__ (line 172) | def __init__( method __call__ (line 179) | def __call__( class IPAttnProcessor (line 240) | class IPAttnProcessor(nn.Module): method __init__ (line 254) | def __init__(self, hidden_size, cross_attention_dim=None, scale=1.0, n... method __call__ (line 265) | def __call__( method _memory_efficient_attention_xformers (line 351) | def _memory_efficient_attention_xformers(self, query, key, value, atte... function draw_kps (line 415) | def draw_kps(image_pil, kps, color_list=[(255, 0, 0), (0, 255, 0), (0, 0... class StableDiffusionXLInstantIDImg2ImgPipeline (line 446) | class StableDiffusionXLInstantIDImg2ImgPipeline(StableDiffusionXLControl... method cuda (line 447) | def cuda(self, dtype=torch.float16, use_xformers=False): method load_ip_adapter_instantid (line 467) | def load_ip_adapter_instantid(self, model_ckpt, image_emb_dim=512, num... method set_image_proj_model (line 471) | def set_image_proj_model(self, model_ckpt, image_emb_dim=512, num_toke... method set_ip_adapter (line 493) | def set_ip_adapter(self, model_ckpt, num_tokens, scale): method set_ip_adapter_scale (line 523) | def set_ip_adapter_scale(self, scale): method _encode_prompt_image_emb (line 529) | def _encode_prompt_image_emb(self, prompt_image_emb, device, dtype, do... method __call__ (line 548) | def __call__( FILE: examples/community/pipeline_stable_diffusion_xl_instantid.py function FeedForward (line 55) | def FeedForward(dim, mult=4): function reshape_tensor (line 65) | def reshape_tensor(x, heads): class PerceiverAttention (line 76) | class PerceiverAttention(nn.Module): method __init__ (line 77) | def __init__(self, *, dim, dim_head=64, heads=8): method forward (line 91) | def forward(self, x, latents): class Resampler (line 123) | class Resampler(nn.Module): method __init__ (line 124) | def __init__( method forward (line 155) | def forward(self, x): class AttnProcessor (line 167) | class AttnProcessor(nn.Module): method __init__ (line 172) | def __init__( method __call__ (line 179) | def __call__( class IPAttnProcessor (line 240) | class IPAttnProcessor(nn.Module): method __init__ (line 254) | def __init__(self, hidden_size, cross_attention_dim=None, scale=1.0, n... method __call__ (line 265) | def __call__( method _memory_efficient_attention_xformers (line 351) | def _memory_efficient_attention_xformers(self, query, key, value, atte... function draw_kps (line 415) | def draw_kps(image_pil, kps, color_list=[(255, 0, 0), (0, 255, 0), (0, 0... class StableDiffusionXLInstantIDPipeline (line 446) | class StableDiffusionXLInstantIDPipeline(StableDiffusionXLControlNetPipe... method cuda (line 447) | def cuda(self, dtype=torch.float16, use_xformers=False): method load_ip_adapter_instantid (line 467) | def load_ip_adapter_instantid(self, model_ckpt, image_emb_dim=512, num... method set_image_proj_model (line 471) | def set_image_proj_model(self, model_ckpt, image_emb_dim=512, num_toke... method set_ip_adapter (line 493) | def set_ip_adapter(self, model_ckpt, num_tokens, scale): method set_ip_adapter_scale (line 523) | def set_ip_adapter_scale(self, scale): method _encode_prompt_image_emb (line 529) | def _encode_prompt_image_emb(self, prompt_image_emb, device, dtype, do... method __call__ (line 548) | def __call__( FILE: examples/community/pipeline_stable_diffusion_xl_ipex.py function rescale_noise_cfg (line 98) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_timesteps (line 113) | def retrieve_timesteps( class StableDiffusionXLPipelineIpex (line 157) | class StableDiffusionXLPipelineIpex( method __init__ (line 224) | def __init__( method encode_prompt (line 268) | def encode_prompt( method encode_image (line 506) | def encode_image(self, image, device, num_images_per_prompt): method prepare_extra_step_kwargs (line 520) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 537) | def check_inputs( method prepare_latents (line 617) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method _get_add_time_ids (line 639) | def _get_add_time_ids( method upcast_vae (line 657) | def upcast_vae(self): method get_guidance_scale_embedding (line 662) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 691) | def guidance_scale(self): method guidance_rescale (line 695) | def guidance_rescale(self): method clip_skip (line 699) | def clip_skip(self): method do_classifier_free_guidance (line 706) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 710) | def cross_attention_kwargs(self): method denoising_end (line 714) | def denoising_end(self): method num_timesteps (line 718) | def num_timesteps(self): method __call__ (line 723) | def __call__( method prepare_for_ipex (line 1162) | def prepare_for_ipex( FILE: examples/community/pipeline_stable_diffusion_xl_t5.py class LinearWithDtype (line 54) | class LinearWithDtype(nn.Linear): method dtype (line 56) | def dtype(self): class StableDiffusionXL_T5Pipeline (line 60) | class StableDiffusionXL_T5Pipeline(StableDiffusionXLPipeline): method __init__ (line 81) | def __init__( method encode_prompt (line 148) | def encode_prompt( FILE: examples/community/pipeline_stg_cogvideox.py function forward_with_stg (line 77) | def forward_with_stg( function get_resize_crop_region_for_grid (line 123) | def get_resize_crop_region_for_grid(src, tgt_width, tgt_height): function retrieve_timesteps (line 142) | def retrieve_timesteps( class CogVideoXSTGPipeline (line 201) | class CogVideoXSTGPipeline(DiffusionPipeline, CogVideoXLoraLoaderMixin): method __init__ (line 233) | def __init__( method _get_t5_prompt_embeds (line 256) | def _get_t5_prompt_embeds( method encode_prompt (line 298) | def encode_prompt( method prepare_latents (line 379) | def prepare_latents( method decode_latents (line 405) | def decode_latents(self, latents: torch.Tensor) -> torch.Tensor: method prepare_extra_step_kwargs (line 413) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 431) | def check_inputs( method fuse_qkv_projections (line 482) | def fuse_qkv_projections(self) -> None: method unfuse_qkv_projections (line 487) | def unfuse_qkv_projections(self) -> None: method _prepare_rotary_positional_embeddings (line 495) | def _prepare_rotary_positional_embeddings( method guidance_scale (line 540) | def guidance_scale(self): method do_spatio_temporal_guidance (line 544) | def do_spatio_temporal_guidance(self): method num_timesteps (line 548) | def num_timesteps(self): method attention_kwargs (line 552) | def attention_kwargs(self): method current_timestep (line 556) | def current_timestep(self): method interrupt (line 560) | def interrupt(self): method __call__ (line 565) | def __call__( FILE: examples/community/pipeline_stg_hunyuan_video.py function forward_with_stg (line 92) | def forward_with_stg( function forward_without_stg (line 103) | def forward_without_stg( function retrieve_timesteps (line 146) | def retrieve_timesteps( class HunyuanVideoSTGPipeline (line 205) | class HunyuanVideoSTGPipeline(DiffusionPipeline, HunyuanVideoLoraLoaderM... method __init__ (line 234) | def __init__( method _get_llama_prompt_embeds (line 260) | def _get_llama_prompt_embeds( method _get_clip_prompt_embeds (line 326) | def _get_clip_prompt_embeds( method encode_prompt (line 365) | def encode_prompt( method check_inputs (line 401) | def check_inputs( method prepare_latents (line 448) | def prepare_latents( method enable_vae_slicing (line 479) | def enable_vae_slicing(self): method disable_vae_slicing (line 492) | def disable_vae_slicing(self): method enable_vae_tiling (line 505) | def enable_vae_tiling(self): method disable_vae_tiling (line 519) | def disable_vae_tiling(self): method guidance_scale (line 533) | def guidance_scale(self): method do_spatio_temporal_guidance (line 537) | def do_spatio_temporal_guidance(self): method num_timesteps (line 541) | def num_timesteps(self): method attention_kwargs (line 545) | def attention_kwargs(self): method current_timestep (line 549) | def current_timestep(self): method interrupt (line 553) | def interrupt(self): method __call__ (line 558) | def __call__( FILE: examples/community/pipeline_stg_ltx.py function forward_with_stg (line 78) | def forward_with_stg( function calculate_shift (line 123) | def calculate_shift( function retrieve_timesteps (line 137) | def retrieve_timesteps( class LTXSTGPipeline (line 196) | class LTXSTGPipeline(DiffusionPipeline, FromSingleFileMixin, LTXVideoLor... method __init__ (line 224) | def __init__( method _get_t5_prompt_embeds (line 260) | def _get_t5_prompt_embeds( method encode_prompt (line 309) | def encode_prompt( method check_inputs (line 392) | def check_inputs( method _pack_latents (line 446) | def _pack_latents(latents: torch.Tensor, patch_size: int = 1, patch_si... method _unpack_latents (line 469) | def _unpack_latents( method _normalize_latents (line 481) | def _normalize_latents( method _denormalize_latents (line 491) | def _denormalize_latents( method prepare_latents (line 500) | def prepare_latents( method guidance_scale (line 534) | def guidance_scale(self): method do_classifier_free_guidance (line 538) | def do_classifier_free_guidance(self): method do_spatio_temporal_guidance (line 542) | def do_spatio_temporal_guidance(self): method num_timesteps (line 546) | def num_timesteps(self): method attention_kwargs (line 550) | def attention_kwargs(self): method interrupt (line 554) | def interrupt(self): method __call__ (line 559) | def __call__( FILE: examples/community/pipeline_stg_ltx_image2video.py function forward_with_stg (line 83) | def forward_with_stg( function calculate_shift (line 128) | def calculate_shift( function retrieve_timesteps (line 142) | def retrieve_timesteps( function retrieve_latents (line 202) | def retrieve_latents( class LTXImageToVideoSTGPipeline (line 215) | class LTXImageToVideoSTGPipeline(DiffusionPipeline, FromSingleFileMixin,... method __init__ (line 243) | def __init__( method _get_t5_prompt_embeds (line 283) | def _get_t5_prompt_embeds( method encode_prompt (line 332) | def encode_prompt( method check_inputs (line 416) | def check_inputs( method _pack_latents (line 471) | def _pack_latents(latents: torch.Tensor, patch_size: int = 1, patch_si... method _unpack_latents (line 495) | def _unpack_latents( method _normalize_latents (line 508) | def _normalize_latents( method _denormalize_latents (line 519) | def _denormalize_latents( method prepare_latents (line 528) | def prepare_latents( method guidance_scale (line 593) | def guidance_scale(self): method do_classifier_free_guidance (line 597) | def do_classifier_free_guidance(self): method do_spatio_temporal_guidance (line 601) | def do_spatio_temporal_guidance(self): method num_timesteps (line 605) | def num_timesteps(self): method attention_kwargs (line 609) | def attention_kwargs(self): method interrupt (line 613) | def interrupt(self): method __call__ (line 618) | def __call__( FILE: examples/community/pipeline_stg_mochi.py function forward_with_stg (line 73) | def forward_with_stg( function linear_quadratic_schedule (line 123) | def linear_quadratic_schedule(num_steps, threshold_noise, linear_steps=N... function retrieve_timesteps (line 141) | def retrieve_timesteps( class MochiSTGPipeline (line 200) | class MochiSTGPipeline(DiffusionPipeline, Mochi1LoraLoaderMixin): method __init__ (line 228) | def __init__( method _get_t5_prompt_embeds (line 259) | def _get_t5_prompt_embeds( method encode_prompt (line 316) | def encode_prompt( method check_inputs (line 399) | def check_inputs( method enable_vae_slicing (line 452) | def enable_vae_slicing(self): method disable_vae_slicing (line 465) | def disable_vae_slicing(self): method enable_vae_tiling (line 478) | def enable_vae_tiling(self): method disable_vae_tiling (line 492) | def disable_vae_tiling(self): method prepare_latents (line 505) | def prepare_latents( method guidance_scale (line 536) | def guidance_scale(self): method do_classifier_free_guidance (line 540) | def do_classifier_free_guidance(self): method do_spatio_temporal_guidance (line 544) | def do_spatio_temporal_guidance(self): method num_timesteps (line 548) | def num_timesteps(self): method attention_kwargs (line 552) | def attention_kwargs(self): method current_timestep (line 556) | def current_timestep(self): method interrupt (line 560) | def interrupt(self): method __call__ (line 565) | def __call__( FILE: examples/community/pipeline_stg_wan.py function basic_clean (line 84) | def basic_clean(text): function whitespace_clean (line 90) | def whitespace_clean(text): function prompt_clean (line 96) | def prompt_clean(text): function forward_with_stg (line 101) | def forward_with_stg( function forward_without_stg (line 111) | def forward_without_stg( class WanSTGPipeline (line 140) | class WanSTGPipeline(DiffusionPipeline, WanLoraLoaderMixin): method __init__ (line 165) | def __init__( method _get_t5_prompt_embeds (line 187) | def _get_t5_prompt_embeds( method encode_prompt (line 228) | def encode_prompt( method check_inputs (line 309) | def check_inputs( method prepare_latents (line 350) | def prepare_latents( method guidance_scale (line 383) | def guidance_scale(self): method do_classifier_free_guidance (line 387) | def do_classifier_free_guidance(self): method do_spatio_temporal_guidance (line 391) | def do_spatio_temporal_guidance(self): method num_timesteps (line 395) | def num_timesteps(self): method current_timestep (line 399) | def current_timestep(self): method interrupt (line 403) | def interrupt(self): method attention_kwargs (line 407) | def attention_kwargs(self): method __call__ (line 412) | def __call__( FILE: examples/community/pipeline_z_image_differential_img2img.py function calculate_shift (line 69) | def calculate_shift( function retrieve_latents (line 83) | def retrieve_latents( function retrieve_timesteps (line 97) | def retrieve_timesteps( class ZImageDifferentialImg2ImgPipeline (line 156) | class ZImageDifferentialImg2ImgPipeline(DiffusionPipeline, ZImageLoraLoa... method __init__ (line 177) | def __init__( method encode_prompt (line 209) | def encode_prompt( method _encode_prompt (line 244) | def _encode_prompt( method get_timesteps (line 296) | def get_timesteps(self, num_inference_steps, strength, device): method _prepare_latent_image_ids (line 308) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype): method prepare_latents (line 321) | def prepare_latents( method prepare_mask_latents (line 375) | def prepare_mask_latents( method guidance_scale (line 430) | def guidance_scale(self): method do_classifier_free_guidance (line 434) | def do_classifier_free_guidance(self): method joint_attention_kwargs (line 438) | def joint_attention_kwargs(self): method num_timesteps (line 442) | def num_timesteps(self): method interrupt (line 446) | def interrupt(self): method __call__ (line 451) | def __call__( FILE: examples/community/pipeline_zero1to3.py class CCProjection (line 58) | class CCProjection(ModelMixin, ConfigMixin): method __init__ (line 59) | def __init__(self, in_channel=772, out_channel=768): method forward (line 65) | def forward(self, x): class Zero1to3StableDiffusionPipeline (line 69) | class Zero1to3StableDiffusionPipeline(DiffusionPipeline, StableDiffusion... method __init__ (line 98) | def __init__( method _encode_prompt (line 192) | def _encode_prompt( method CLIP_preprocess (line 330) | def CLIP_preprocess(self, x): method _encode_image (line 349) | def _encode_image(self, image, device, num_images_per_prompt, do_class... method _encode_pose (line 406) | def _encode_pose(self, pose, device, num_images_per_prompt, do_classif... method _encode_image_with_pose (line 434) | def _encode_image_with_pose(self, image, pose, device, num_images_per_... method run_safety_checker (line 446) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 456) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 464) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 481) | def check_inputs(self, image, height, width, callback_steps): method prepare_latents (line 503) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method prepare_img_latents (line 525) | def prepare_img_latents(self, image, batch_size, dtype, device, genera... method __call__ (line 600) | def __call__( FILE: examples/community/pipline_flux_fill_controlnet_Inpaint.py function calculate_shift (line 87) | def calculate_shift( function retrieve_latents (line 101) | def retrieve_latents( function retrieve_latents_fill (line 114) | def retrieve_latents_fill( function retrieve_timesteps (line 128) | def retrieve_timesteps( class FluxControlNetFillInpaintPipeline (line 187) | class FluxControlNetFillInpaintPipeline(DiffusionPipeline, FluxLoraLoade... method __init__ (line 218) | def __init__( method _get_t5_prompt_embeds (line 264) | def _get_t5_prompt_embeds( method _get_clip_prompt_embeds (line 314) | def _get_clip_prompt_embeds( method encode_prompt (line 359) | def encode_prompt( method _encode_vae_image (line 439) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method get_timesteps (line 454) | def get_timesteps(self, num_inference_steps, strength, device): method check_inputs (line 465) | def check_inputs( method _prepare_latent_image_ids (line 538) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype): method _pack_latents (line 553) | def _pack_latents(latents, batch_size, num_channels_latents, height, w... method _unpack_latents (line 562) | def _unpack_latents(latents, height, width, vae_scale_factor): method prepare_latents (line 577) | def prepare_latents( method prepare_mask_latents (line 630) | def prepare_mask_latents( method prepare_image (line 702) | def prepare_image( method prepare_mask_latents_fill (line 736) | def prepare_mask_latents_fill( method guidance_scale (line 817) | def guidance_scale(self): method joint_attention_kwargs (line 821) | def joint_attention_kwargs(self): method num_timesteps (line 825) | def num_timesteps(self): method interrupt (line 829) | def interrupt(self): method __call__ (line 834) | def __call__( FILE: examples/community/regional_prompting_stable_diffusion.py class RegionalPromptingStableDiffusionPipeline (line 53) | class RegionalPromptingStableDiffusionPipeline( method __init__ (line 105) | def __init__( method __call__ (line 141) | def __call__( method prepare_extra_step_kwargs (line 490) | def prepare_extra_step_kwargs(self, generator, eta): method prepare_latents (line 508) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method encode_prompt (line 531) | def encode_prompt( method check_inputs (line 714) | def check_inputs( method stable_diffusion_call (line 785) | def stable_diffusion_call( method _encode_prompt (line 1115) | def _encode_prompt( method encode_image (line 1238) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 1263) | def prepare_ip_adapter_image_embeds( method run_safety_checker (line 1301) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 1324) | def decode_latents(self, latents): method guidance_scale (line 1334) | def guidance_scale(self): method guidance_rescale (line 1338) | def guidance_rescale(self): method get_guidance_scale_embedding (line 1342) | def get_guidance_scale_embedding( method clip_skip (line 1373) | def clip_skip(self): method num_timesteps (line 1377) | def num_timesteps(self): method interrupt (line 1381) | def interrupt(self): method cross_attention_kwargs (line 1385) | def cross_attention_kwargs(self): method do_classifier_free_guidance (line 1389) | def do_classifier_free_guidance(self): function promptsmaker (line 1394) | def promptsmaker(prompts, batch): function make_cells (line 1414) | def make_cells(ratios): function make_emblist (line 1443) | def make_emblist(self, prompts): function split_dims (line 1456) | def split_dims(xs, height, width): function get_attn_maps (line 1470) | def get_attn_maps(self, attn): function reset_attnmaps (line 1493) | def reset_attnmaps(self): # init parameters in every batch function saveattnmaps (line 1502) | def saveattnmaps(self, output, h, w, th, step, regions): function makepmask (line 1516) | def makepmask( function tokendealer (line 1536) | def tokendealer(self, all_prompts): function scaled_dot_product_attention (line 1573) | def scaled_dot_product_attention( function retrieve_timesteps (line 1608) | def retrieve_timesteps( function rescale_noise_cfg (line 1667) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): FILE: examples/community/rerender_a_video.py function coords_grid (line 47) | def coords_grid(b, h, w, homogeneous=False, device=None): function bilinear_sample (line 66) | def bilinear_sample(img, sample_coords, mode="bilinear", padding_mode="z... function flow_warp (line 90) | def flow_warp(feature, flow, mask=False, mode="bilinear", padding_mode="... function forward_backward_consistency_check (line 99) | def forward_backward_consistency_check(fwd_flow, bwd_flow, alpha=0.01, b... function get_warped_and_mask (line 122) | def get_warped_and_mask(flow_model, image1, image2, image3=None, pixel_c... class TextToVideoSDPipelineOutput (line 147) | class TextToVideoSDPipelineOutput(BaseOutput): function find_flat_region (line 161) | def find_flat_region(mask): class AttnState (line 172) | class AttnState: method __init__ (line 177) | def __init__(self): method state (line 181) | def state(self): method timestep (line 185) | def timestep(self): method set_timestep (line 188) | def set_timestep(self, t): method reset (line 191) | def reset(self): method to_load (line 195) | def to_load(self): method to_load_and_store_prev (line 198) | def to_load_and_store_prev(self): class CrossFrameAttnProcessor (line 202) | class CrossFrameAttnProcessor(AttnProcessor): method __init__ (line 210) | def __init__(self, attn_state: AttnState): method __call__ (line 216) | def __call__(self, attn: Attention, hidden_states, encoder_hidden_stat... function prepare_image (line 237) | def prepare_image(image): class RerenderAVideoPipeline (line 261) | class RerenderAVideoPipeline(StableDiffusionControlNetImg2ImgPipeline): method __init__ (line 298) | def __init__( method check_inputs (line 391) | def check_inputs( method prepare_control_image (line 497) | def prepare_control_image( method get_timesteps (line 528) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 538) | def prepare_latents(self, image, timestep, batch_size, num_images_per_... method __call__ (line 596) | def __call__( class InputPadder (line 1189) | class InputPadder: method __init__ (line 1192) | def __init__(self, dims, mode="sintel", padding_factor=8): method pad (line 1201) | def pad(self, *inputs): method unpad (line 1204) | def unpad(self, x): FILE: examples/community/run_onnx_controlnet.py function prepare_image (line 77) | def prepare_image(image): class OnnxStableDiffusionControlNetImg2ImgPipeline (line 101) | class OnnxStableDiffusionControlNetImg2ImgPipeline(DiffusionPipeline): method __init__ (line 109) | def __init__( method _encode_prompt (line 134) | def _encode_prompt( method decode_latents (line 238) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 252) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 269) | def check_inputs( method check_image (line 378) | def check_image(self, image, prompt, prompt_embeds): method prepare_control_image (line 416) | def prepare_control_image( method get_timesteps (line 447) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 456) | def prepare_latents(self, image, timestep, batch_size, num_images_per_... method __call__ (line 504) | def __call__( FILE: examples/community/run_tensorrt_controlnet.py function load_engine (line 40) | def load_engine(trt_runtime, engine_path): class TensorRTModel (line 47) | class TensorRTModel: method __init__ (line 48) | def __init__( method __call__ (line 105) | def __call__(self, **kwargs): function prepare_image (line 181) | def prepare_image(image): class TensorRTStableDiffusionControlNetImg2ImgPipeline (line 205) | class TensorRTStableDiffusionControlNetImg2ImgPipeline(DiffusionPipeline): method __init__ (line 213) | def __init__( method _encode_prompt (line 238) | def _encode_prompt( method decode_latents (line 342) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 356) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 373) | def check_inputs( method check_image (line 482) | def check_image(self, image, prompt, prompt_embeds): method prepare_control_image (line 520) | def prepare_control_image( method get_timesteps (line 551) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 560) | def prepare_latents(self, image, timestep, batch_size, num_images_per_... method __call__ (line 608) | def __call__( FILE: examples/community/scheduling_ufogen.py class UFOGenSchedulerOutput (line 32) | class UFOGenSchedulerOutput(BaseOutput): function betas_for_alpha_bar (line 50) | def betas_for_alpha_bar( function rescale_zero_terminal_snr (line 95) | def rescale_zero_terminal_snr(betas): class UFOGenScheduler (line 131) | class UFOGenScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 187) | def __init__( method scale_model_input (line 243) | def scale_model_input(self, sample: torch.Tensor, timestep: Optional[i... method set_timesteps (line 260) | def set_timesteps( method _threshold_sample (line 342) | def _threshold_sample(self, sample: torch.Tensor) -> torch.Tensor: method step (line 375) | def step( method add_noise (line 461) | def add_noise( method get_velocity (line 485) | def get_velocity(self, sample: torch.Tensor, noise: torch.Tensor, time... method __len__ (line 503) | def __len__(self): method previous_timestep (line 507) | def previous_timestep(self, timestep): FILE: examples/community/sd_text2img_k_diffusion.py class ModelWrapper (line 30) | class ModelWrapper: method __init__ (line 31) | def __init__(self, model, alphas_cumprod): method apply_model (line 35) | def apply_model(self, *args, **kwargs): class StableDiffusionPipeline (line 44) | class StableDiffusionPipeline(DiffusionPipeline, StableDiffusionMixin): method __init__ (line 74) | def __init__( method set_sampler (line 114) | def set_sampler(self, scheduler_type: str): method set_scheduler (line 118) | def set_scheduler(self, scheduler_type: str): method _encode_prompt (line 123) | def _encode_prompt(self, prompt, device, num_images_per_prompt, do_cla... method run_safety_checker (line 228) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 238) | def decode_latents(self, latents): method check_inputs (line 246) | def check_inputs(self, prompt, height, width, callback_steps): method prepare_latents (line 261) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method __call__ (line 278) | def __call__( FILE: examples/community/sde_drag.py class SdeDragPipeline (line 26) | class SdeDragPipeline(DiffusionPipeline): method __init__ (line 50) | def __init__( method __call__ (line 63) | def __call__( method train_lora (line 207) | def train_lora(self, prompt, image, lora_step=100, lora_rank=16, gener... method _tokenize_prompt (line 332) | def _tokenize_prompt(self, prompt, tokenizer_max_length=None): method _encode_prompt (line 348) | def _encode_prompt(self, input_ids, attention_mask, text_encoder_use_a... method _get_text_embed (line 365) | def _get_text_embed(self, prompt): method _copy_and_paste (line 376) | def _copy_and_paste( method _get_img_latent (line 412) | def _get_img_latent(self, image, height=None, weight=None): method _get_eps (line 425) | def _get_eps(self, latent, timestep, guidance_scale, text_embeddings, ... method _forward_sde (line 450) | def _forward_sde( method _sample (line 486) | def _sample( method _forward (line 536) | def _forward(self, latent, steps, t0, lora_scale_min, text_embeddings,... method _backward (line 572) | def _backward( FILE: examples/community/seed_resize_stable_diffusion.py class SeedResizeStableDiffusionPipeline (line 23) | class SeedResizeStableDiffusionPipeline(DiffusionPipeline, StableDiffusi... method __init__ (line 51) | def __init__( method __call__ (line 73) | def __call__( FILE: examples/community/speech_to_image_diffusion.py class SpeechToImagePipeline (line 30) | class SpeechToImagePipeline(DiffusionPipeline, StableDiffusionMixin): method __init__ (line 31) | def __init__( method __call__ (line 67) | def __call__( FILE: examples/community/stable_diffusion_comparison.py class StableDiffusionComparisonPipeline (line 26) | class StableDiffusionComparisonPipeline(DiffusionPipeline, StableDiffusi... method __init__ (line 54) | def __init__( method layers (line 84) | def layers(self) -> dict[str, Any]: method text2img_sd1_1 (line 88) | def text2img_sd1_1( method text2img_sd1_2 (line 125) | def text2img_sd1_2( method text2img_sd1_3 (line 162) | def text2img_sd1_3( method text2img_sd1_4 (line 199) | def text2img_sd1_4( method _call_ (line 236) | def _call_( FILE: examples/community/stable_diffusion_controlnet_img2img.py function prepare_image (line 64) | def prepare_image(image): function prepare_controlnet_conditioning_image (line 88) | def prepare_controlnet_conditioning_image( class StableDiffusionControlNetImg2ImgPipeline (line 132) | class StableDiffusionControlNetImg2ImgPipeline(DiffusionPipeline, Stable... method __init__ (line 139) | def __init__( method _encode_prompt (line 185) | def _encode_prompt( method run_safety_checker (line 322) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 332) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 340) | def prepare_extra_step_kwargs(self, generator, eta): method check_controlnet_conditioning_image (line 357) | def check_controlnet_conditioning_image(self, image, prompt, prompt_em... method check_inputs (line 393) | def check_inputs( method get_timesteps (line 524) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 533) | def prepare_latents(self, image, timestep, batch_size, num_images_per_... method _default_height_width (line 574) | def _default_height_width(self, height, width, image): method __call__ (line 598) | def __call__( FILE: examples/community/stable_diffusion_controlnet_inpaint.py function prepare_image (line 127) | def prepare_image(image): function prepare_mask_image (line 151) | def prepare_mask_image(mask_image): function prepare_controlnet_conditioning_image (line 186) | def prepare_controlnet_conditioning_image( class StableDiffusionControlNetInpaintPipeline (line 230) | class StableDiffusionControlNetInpaintPipeline(DiffusionPipeline, Stable... method __init__ (line 237) | def __init__( method _encode_prompt (line 284) | def _encode_prompt( method run_safety_checker (line 421) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 431) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 439) | def prepare_extra_step_kwargs(self, generator, eta): method check_controlnet_conditioning_image (line 456) | def check_controlnet_conditioning_image(self, image, prompt, prompt_em... method check_inputs (line 492) | def check_inputs( method prepare_latents (line 637) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method prepare_mask_latents (line 660) | def prepare_mask_latents(self, mask_image, batch_size, height, width, ... method prepare_masked_image_latents (line 683) | def prepare_masked_image_latents( method _default_height_width (line 717) | def _default_height_width(self, height, width, image): method __call__ (line 741) | def __call__( FILE: examples/community/stable_diffusion_controlnet_inpaint_img2img.py function prepare_image (line 126) | def prepare_image(image): function prepare_mask_image (line 150) | def prepare_mask_image(mask_image): function prepare_controlnet_conditioning_image (line 185) | def prepare_controlnet_conditioning_image( class StableDiffusionControlNetInpaintImg2ImgPipeline (line 219) | class StableDiffusionControlNetInpaintImg2ImgPipeline(DiffusionPipeline,... method __init__ (line 226) | def __init__( method _encode_prompt (line 269) | def _encode_prompt( method run_safety_checker (line 406) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 416) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 424) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 441) | def check_inputs( method get_timesteps (line 597) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 606) | def prepare_latents(self, image, timestep, batch_size, num_images_per_... method prepare_mask_latents (line 647) | def prepare_mask_latents(self, mask_image, batch_size, height, width, ... method prepare_masked_image_latents (line 670) | def prepare_masked_image_latents( method _default_height_width (line 704) | def _default_height_width(self, height, width, image): method __call__ (line 728) | def __call__( FILE: examples/community/stable_diffusion_controlnet_reference.py function torch_dfs (line 60) | def torch_dfs(model: torch.nn.Module): class StableDiffusionControlNetReferencePipeline (line 67) | class StableDiffusionControlNetReferencePipeline(StableDiffusionControlN... method prepare_ref_latents (line 68) | def prepare_ref_latents(self, refimage, batch_size, dtype, device, gen... method __call__ (line 99) | def __call__( FILE: examples/community/stable_diffusion_ipex.py class StableDiffusionIPEXPipeline (line 63) | class StableDiffusionIPEXPipeline( method __init__ (line 95) | def __init__( method get_input_example (line 188) | def get_input_example(self, prompt, height=None, width=None, guidance_... method prepare_for_ipex (line 248) | def prepare_for_ipex(self, promt, dtype=torch.float32, height=None, wi... method _encode_prompt (line 311) | def _encode_prompt( method run_safety_checker (line 457) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 467) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 475) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 492) | def check_inputs( method prepare_latents (line 539) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method __call__ (line 563) | def __call__( FILE: examples/community/stable_diffusion_mega.py class StableDiffusionMegaPipeline (line 27) | class StableDiffusionMegaPipeline(DiffusionPipeline, StableDiffusionMixin): method __init__ (line 57) | def __init__( method components (line 95) | def components(self) -> dict[str, Any]: method inpaint (line 99) | def inpaint( method img2img (line 134) | def img2img( method text2img (line 169) | def text2img( FILE: examples/community/stable_diffusion_reference.py function torch_dfs (line 67) | def torch_dfs(model: torch.nn.Module): class StableDiffusionReferencePipeline (line 83) | class StableDiffusionReferencePipeline( method __init__ (line 122) | def __init__( method _default_height_width (line 230) | def _default_height_width( method check_inputs (line 273) | def check_inputs( method _encode_prompt (line 362) | def _encode_prompt( method encode_prompt (line 412) | def encode_prompt( method prepare_latents (line 594) | def prepare_latents( method prepare_extra_step_kwargs (line 643) | def prepare_extra_step_kwargs( method prepare_image (line 672) | def prepare_image( method prepare_ref_latents (line 742) | def prepare_ref_latents( method run_safety_checker (line 793) | def run_safety_checker( method __call__ (line 822) | def __call__( FILE: examples/community/stable_diffusion_repaint.py function prepare_mask_and_masked_image (line 42) | def prepare_mask_and_masked_image(image, mask): class StableDiffusionRepaintPipeline (line 142) | class StableDiffusionRepaintPipeline( method __init__ (line 177) | def __init__( method _encode_prompt (line 285) | def _encode_prompt( method run_safety_checker (line 431) | def run_safety_checker(self, image, device, dtype): method prepare_extra_step_kwargs (line 442) | def prepare_extra_step_kwargs(self, generator, eta): method decode_latents (line 460) | def decode_latents(self, latents): method check_inputs (line 469) | def check_inputs( method prepare_latents (line 517) | def prepare_latents( method prepare_mask_latents (line 549) | def prepare_mask_latents( method __call__ (line 610) | def __call__( FILE: examples/community/stable_diffusion_tensorrt_img2img.py function preprocess_image (line 93) | def preprocess_image(image): class Engine (line 106) | class Engine: method __init__ (line 107) | def __init__(self, engine_path): method __del__ (line 114) | def __del__(self): method build (line 121) | def build( method load (line 147) | def load(self): method activate (line 151) | def activate(self): method allocate_buffers (line 154) | def allocate_buffers(self, shape_dict=None, device="cuda"): method infer (line 167) | def infer(self, feed_dict, stream): class Optimizer (line 179) | class Optimizer: method __init__ (line 180) | def __init__(self, onnx_graph): method cleanup (line 183) | def cleanup(self, return_onnx=False): method select_outputs (line 188) | def select_outputs(self, keep, names=None): method fold_constants (line 194) | def fold_constants(self, return_onnx=False): method infer_shapes (line 200) | def infer_shapes(self, return_onnx=False): class BaseModel (line 212) | class BaseModel: method __init__ (line 213) | def __init__(self, model, fp16=False, device="cuda", max_batch_size=16... method get_model (line 229) | def get_model(self): method get_input_names (line 232) | def get_input_names(self): method get_output_names (line 235) | def get_output_names(self): method get_dynamic_axes (line 238) | def get_dynamic_axes(self): method get_sample_input (line 241) | def get_sample_input(self, batch_size, image_height, image_width): method get_input_profile (line 244) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 247) | def get_shape_dict(self, batch_size, image_height, image_width): method optimize (line 250) | def optimize(self, onnx_graph): method check_dims (line 258) | def check_dims(self, batch_size, image_height, image_width): method get_minmax_dims (line 267) | def get_minmax_dims(self, batch_size, image_height, image_width, stati... function getOnnxPath (line 294) | def getOnnxPath(model_name, onnx_dir, opt=True): function getEnginePath (line 298) | def getEnginePath(model_name, engine_dir): function build_engines (line 302) | def build_engines( function runEngine (line 392) | def runEngine(engine, feed_dict, stream): class CLIP (line 396) | class CLIP(BaseModel): method __init__ (line 397) | def __init__(self, model, device, max_batch_size, embedding_dim): method get_input_names (line 403) | def get_input_names(self): method get_output_names (line 406) | def get_output_names(self): method get_dynamic_axes (line 409) | def get_dynamic_axes(self): method get_input_profile (line 412) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 421) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 428) | def get_sample_input(self, batch_size, image_height, image_width): method optimize (line 432) | def optimize(self, onnx_graph): function make_CLIP (line 443) | def make_CLIP(model, device, max_batch_size, embedding_dim, inpaint=False): class UNet (line 447) | class UNet(BaseModel): method __init__ (line 448) | def __init__( method get_input_names (line 462) | def get_input_names(self): method get_output_names (line 465) | def get_output_names(self): method get_dynamic_axes (line 468) | def get_dynamic_axes(self): method get_input_profile (line 475) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 502) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 510) | def get_sample_input(self, batch_size, image_height, image_width): function make_UNet (line 522) | def make_UNet(model, device, max_batch_size, embedding_dim, inpaint=False): class VAE (line 533) | class VAE(BaseModel): method __init__ (line 534) | def __init__(self, model, device, max_batch_size, embedding_dim): method get_input_names (line 540) | def get_input_names(self): method get_output_names (line 543) | def get_output_names(self): method get_dynamic_axes (line 546) | def get_dynamic_axes(self): method get_input_profile (line 549) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 571) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 578) | def get_sample_input(self, batch_size, image_height, image_width): function make_VAE (line 583) | def make_VAE(model, device, max_batch_size, embedding_dim, inpaint=False): class TorchVAEEncoder (line 587) | class TorchVAEEncoder(torch.nn.Module): method __init__ (line 588) | def __init__(self, model): method forward (line 592) | def forward(self, x): class VAEEncoder (line 596) | class VAEEncoder(BaseModel): method __init__ (line 597) | def __init__(self, model, device, max_batch_size, embedding_dim): method get_model (line 603) | def get_model(self): method get_input_names (line 607) | def get_input_names(self): method get_output_names (line 610) | def get_output_names(self): method get_dynamic_axes (line 613) | def get_dynamic_axes(self): method get_input_profile (line 616) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 642) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 649) | def get_sample_input(self, batch_size, image_height, image_width): function make_VAEEncoder (line 654) | def make_VAEEncoder(model, device, max_batch_size, embedding_dim, inpain... class TensorRTStableDiffusionImg2ImgPipeline (line 658) | class TensorRTStableDiffusionImg2ImgPipeline(DiffusionPipeline): method __init__ (line 688) | def __init__( method __loadModels (line 817) | def __loadModels(self): method run_safety_checker (line 836) | def run_safety_checker( method set_cached_folder (line 864) | def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Uni... method to (line 884) | def to(self, torch_device: Optional[Union[str, torch.device]] = None, ... method __initialize_timesteps (line 914) | def __initialize_timesteps(self, timesteps, strength): method __preprocess_images (line 923) | def __preprocess_images(self, batch_size, images=()): method __encode_image (line 931) | def __encode_image(self, init_image): method __encode_prompt (line 936) | def __encode_prompt(self, prompt, negative_prompt): method __denoise_latent (line 987) | def __denoise_latent( method __decode_latent (line 1017) | def __decode_latent(self, latents): method __loadResources (line 1022) | def __loadResources(self, image_height, image_width, batch_size): method __call__ (line 1032) | def __call__( FILE: examples/community/stable_diffusion_tensorrt_inpaint.py function preprocess_image (line 97) | def preprocess_image(image): class Engine (line 110) | class Engine: method __init__ (line 111) | def __init__(self, engine_path): method __del__ (line 118) | def __del__(self): method build (line 125) | def build( method load (line 151) | def load(self): method activate (line 155) | def activate(self): method allocate_buffers (line 158) | def allocate_buffers(self, shape_dict=None, device="cuda"): method infer (line 171) | def infer(self, feed_dict, stream): class Optimizer (line 183) | class Optimizer: method __init__ (line 184) | def __init__(self, onnx_graph): method cleanup (line 187) | def cleanup(self, return_onnx=False): method select_outputs (line 192) | def select_outputs(self, keep, names=None): method fold_constants (line 198) | def fold_constants(self, return_onnx=False): method infer_shapes (line 204) | def infer_shapes(self, return_onnx=False): class BaseModel (line 216) | class BaseModel: method __init__ (line 217) | def __init__(self, model, fp16=False, device="cuda", max_batch_size=16... method get_model (line 233) | def get_model(self): method get_input_names (line 236) | def get_input_names(self): method get_output_names (line 239) | def get_output_names(self): method get_dynamic_axes (line 242) | def get_dynamic_axes(self): method get_sample_input (line 245) | def get_sample_input(self, batch_size, image_height, image_width): method get_input_profile (line 248) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 251) | def get_shape_dict(self, batch_size, image_height, image_width): method optimize (line 254) | def optimize(self, onnx_graph): method check_dims (line 262) | def check_dims(self, batch_size, image_height, image_width): method get_minmax_dims (line 271) | def get_minmax_dims(self, batch_size, image_height, image_width, stati... function getOnnxPath (line 298) | def getOnnxPath(model_name, onnx_dir, opt=True): function getEnginePath (line 302) | def getEnginePath(model_name, engine_dir): function build_engines (line 306) | def build_engines( function runEngine (line 396) | def runEngine(engine, feed_dict, stream): class CLIP (line 400) | class CLIP(BaseModel): method __init__ (line 401) | def __init__(self, model, device, max_batch_size, embedding_dim): method get_input_names (line 407) | def get_input_names(self): method get_output_names (line 410) | def get_output_names(self): method get_dynamic_axes (line 413) | def get_dynamic_axes(self): method get_input_profile (line 416) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 425) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 432) | def get_sample_input(self, batch_size, image_height, image_width): method optimize (line 436) | def optimize(self, onnx_graph): function make_CLIP (line 447) | def make_CLIP(model, device, max_batch_size, embedding_dim, inpaint=False): class UNet (line 451) | class UNet(BaseModel): method __init__ (line 452) | def __init__( method get_input_names (line 466) | def get_input_names(self): method get_output_names (line 469) | def get_output_names(self): method get_dynamic_axes (line 472) | def get_dynamic_axes(self): method get_input_profile (line 479) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 506) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 514) | def get_sample_input(self, batch_size, image_height, image_width): function make_UNet (line 526) | def make_UNet(model, device, max_batch_size, embedding_dim, inpaint=Fals... class VAE (line 537) | class VAE(BaseModel): method __init__ (line 538) | def __init__(self, model, device, max_batch_size, embedding_dim): method get_input_names (line 544) | def get_input_names(self): method get_output_names (line 547) | def get_output_names(self): method get_dynamic_axes (line 550) | def get_dynamic_axes(self): method get_input_profile (line 553) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 575) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 582) | def get_sample_input(self, batch_size, image_height, image_width): function make_VAE (line 587) | def make_VAE(model, device, max_batch_size, embedding_dim, inpaint=False): class TorchVAEEncoder (line 591) | class TorchVAEEncoder(torch.nn.Module): method __init__ (line 592) | def __init__(self, model): method forward (line 596) | def forward(self, x): class VAEEncoder (line 600) | class VAEEncoder(BaseModel): method __init__ (line 601) | def __init__(self, model, device, max_batch_size, embedding_dim): method get_model (line 607) | def get_model(self): method get_input_names (line 611) | def get_input_names(self): method get_output_names (line 614) | def get_output_names(self): method get_dynamic_axes (line 617) | def get_dynamic_axes(self): method get_input_profile (line 620) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 646) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 653) | def get_sample_input(self, batch_size, image_height, image_width): function make_VAEEncoder (line 658) | def make_VAEEncoder(model, device, max_batch_size, embedding_dim, inpain... class TensorRTStableDiffusionInpaintPipeline (line 662) | class TensorRTStableDiffusionInpaintPipeline(DiffusionPipeline): method __init__ (line 692) | def __init__( method __loadModels (line 821) | def __loadModels(self): method _encode_vae_image (line 841) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method prepare_latents (line 855) | def prepare_latents( method run_safety_checker (line 919) | def run_safety_checker( method set_cached_folder (line 947) | def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Uni... method to (line 967) | def to(self, torch_device: Optional[Union[str, torch.device]] = None, ... method __initialize_timesteps (line 997) | def __initialize_timesteps(self, num_inference_steps, strength): method __preprocess_images (line 1006) | def __preprocess_images(self, batch_size, images=()): method __encode_image (line 1014) | def __encode_image(self, init_image): method __encode_prompt (line 1019) | def __encode_prompt(self, prompt, negative_prompt): method __denoise_latent (line 1070) | def __denoise_latent( method __decode_latent (line 1100) | def __decode_latent(self, latents): method __loadResources (line 1105) | def __loadResources(self, image_height, image_width, batch_size): method __call__ (line 1115) | def __call__( FILE: examples/community/stable_diffusion_tensorrt_txt2img.py class Engine (line 93) | class Engine: method __init__ (line 94) | def __init__(self, engine_path): method __del__ (line 101) | def __del__(self): method build (line 108) | def build( method load (line 134) | def load(self): method activate (line 138) | def activate(self): method allocate_buffers (line 141) | def allocate_buffers(self, shape_dict=None, device="cuda"): method infer (line 154) | def infer(self, feed_dict, stream): class Optimizer (line 166) | class Optimizer: method __init__ (line 167) | def __init__(self, onnx_graph): method cleanup (line 170) | def cleanup(self, return_onnx=False): method select_outputs (line 175) | def select_outputs(self, keep, names=None): method fold_constants (line 181) | def fold_constants(self, return_onnx=False): method infer_shapes (line 187) | def infer_shapes(self, return_onnx=False): class BaseModel (line 199) | class BaseModel: method __init__ (line 200) | def __init__(self, model, fp16=False, device="cuda", max_batch_size=16... method get_model (line 216) | def get_model(self): method get_input_names (line 219) | def get_input_names(self): method get_output_names (line 222) | def get_output_names(self): method get_dynamic_axes (line 225) | def get_dynamic_axes(self): method get_sample_input (line 228) | def get_sample_input(self, batch_size, image_height, image_width): method get_input_profile (line 231) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 234) | def get_shape_dict(self, batch_size, image_height, image_width): method optimize (line 237) | def optimize(self, onnx_graph): method check_dims (line 245) | def check_dims(self, batch_size, image_height, image_width): method get_minmax_dims (line 254) | def get_minmax_dims(self, batch_size, image_height, image_width, stati... function getOnnxPath (line 281) | def getOnnxPath(model_name, onnx_dir, opt=True): function getEnginePath (line 285) | def getEnginePath(model_name, engine_dir): function build_engines (line 289) | def build_engines( function runEngine (line 379) | def runEngine(engine, feed_dict, stream): class CLIP (line 383) | class CLIP(BaseModel): method __init__ (line 384) | def __init__(self, model, device, max_batch_size, embedding_dim): method get_input_names (line 390) | def get_input_names(self): method get_output_names (line 393) | def get_output_names(self): method get_dynamic_axes (line 396) | def get_dynamic_axes(self): method get_input_profile (line 399) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 408) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 415) | def get_sample_input(self, batch_size, image_height, image_width): method optimize (line 419) | def optimize(self, onnx_graph): function make_CLIP (line 430) | def make_CLIP(model, device, max_batch_size, embedding_dim, inpaint=False): class UNet (line 434) | class UNet(BaseModel): method __init__ (line 435) | def __init__( method get_input_names (line 449) | def get_input_names(self): method get_output_names (line 452) | def get_output_names(self): method get_dynamic_axes (line 455) | def get_dynamic_axes(self): method get_input_profile (line 462) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 489) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 497) | def get_sample_input(self, batch_size, image_height, image_width): function make_UNet (line 509) | def make_UNet(model, device, max_batch_size, embedding_dim, inpaint=False): class VAE (line 520) | class VAE(BaseModel): method __init__ (line 521) | def __init__(self, model, device, max_batch_size, embedding_dim): method get_input_names (line 527) | def get_input_names(self): method get_output_names (line 530) | def get_output_names(self): method get_dynamic_axes (line 533) | def get_dynamic_axes(self): method get_input_profile (line 536) | def get_input_profile(self, batch_size, image_height, image_width, sta... method get_shape_dict (line 558) | def get_shape_dict(self, batch_size, image_height, image_width): method get_sample_input (line 565) | def get_sample_input(self, batch_size, image_height, image_width): function make_VAE (line 570) | def make_VAE(model, device, max_batch_size, embedding_dim, inpaint=False): class TensorRTStableDiffusionPipeline (line 574) | class TensorRTStableDiffusionPipeline(DiffusionPipeline): method __init__ (line 604) | def __init__( method __loadModels (line 733) | def __loadModels(self): method prepare_latents (line 750) | def prepare_latents( method run_safety_checker (line 792) | def run_safety_checker( method set_cached_folder (line 820) | def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Uni... method to (line 840) | def to(self, torch_device: Optional[Union[str, torch.device]] = None, ... method __encode_prompt (line 870) | def __encode_prompt(self, prompt, negative_prompt): method __denoise_latent (line 921) | def __denoise_latent( method __decode_latent (line 951) | def __decode_latent(self, latents): method __loadResources (line 956) | def __loadResources(self, image_height, image_width, batch_size): method __call__ (line 966) | def __call__( FILE: examples/community/stable_diffusion_xl_controlnet_reference.py function torch_dfs (line 83) | def torch_dfs(model: torch.nn.Module): function retrieve_timesteps (line 91) | def retrieve_timesteps( class StableDiffusionXLControlNetReferencePipeline (line 150) | class StableDiffusionXLControlNetReferencePipeline(StableDiffusionXLCont... method prepare_ref_latents (line 194) | def prepare_ref_latents(self, refimage, batch_size, dtype, device, gen... method prepare_ref_image (line 234) | def prepare_ref_image( method check_ref_inputs (line 287) | def check_ref_inputs( method __call__ (line 323) | def __call__( FILE: examples/community/stable_diffusion_xl_reference.py function torch_dfs (line 57) | def torch_dfs(model: torch.nn.Module): function rescale_noise_cfg (line 65) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): function retrieve_timesteps (line 80) | def retrieve_timesteps( class StableDiffusionXLReferencePipeline (line 139) | class StableDiffusionXLReferencePipeline(StableDiffusionXLPipeline): method prepare_ref_latents (line 140) | def prepare_ref_latents(self, refimage, batch_size, dtype, device, gen... method prepare_ref_image (line 180) | def prepare_ref_image( method check_ref_inputs (line 233) | def check_ref_inputs( method __call__ (line 269) | def __call__( FILE: examples/community/stable_unclip.py function _encode_image (line 18) | def _encode_image(self, image, device, num_images_per_prompt, do_classif... class StableUnCLIPPipeline (line 39) | class StableUnCLIPPipeline(DiffusionPipeline): method __init__ (line 40) | def __init__( method _encode_prompt (line 68) | def _encode_prompt( method _execution_device (line 153) | def _execution_device(self): method prepare_latents (line 170) | def prepare_latents(self, shape, dtype, device, generator, latents, sc... method to (line 181) | def to(self, torch_device: Optional[Union[str, torch.device]] = None): method __call__ (line 186) | def __call__( FILE: examples/community/text_inpainting.py class TextInpainting (line 26) | class TextInpainting(DiffusionPipeline, StableDiffusionMixin): method __init__ (line 60) | def __init__( method __call__ (line 125) | def __call__( FILE: examples/community/tiled_upscaling.py function make_transparency_mask (line 29) | def make_transparency_mask(size, overlap_pixels, remove_borders=[]): function clamp (line 52) | def clamp(n, smallest, largest): function clamp_rect (line 56) | def clamp_rect(rect: [int], min: [int], max: [int]): function add_overlap_rect (line 65) | def add_overlap_rect(rect: [int], overlap: int, image_size: [int]): function squeeze_tile (line 75) | def squeeze_tile(tile, original_image, original_slice, slice_x): function unsqueeze_tile (line 87) | def unsqueeze_tile(tile, original_image_slice): function next_divisible (line 93) | def next_divisible(n, d): class StableDiffusionTiledUpscalePipeline (line 98) | class StableDiffusionTiledUpscalePipeline(StableDiffusionUpscalePipeline): method __init__ (line 125) | def __init__( method _process_tile (line 145) | def _process_tile(self, original_image_slice, x, y, tile_size, tile_bo... method __call__ (line 185) | def __call__( function main (line 282) | def main(): FILE: examples/community/unclip_image_interpolation.py function slerp (line 29) | def slerp(val, low, high): class UnCLIPImageInterpolationPipeline (line 41) | class UnCLIPImageInterpolationPipeline(DiffusionPipeline): method __init__ (line 88) | def __init__( method prepare_latents (line 117) | def prepare_latents(self, shape, dtype, device, generator, latents, sc... method _encode_prompt (line 129) | def _encode_prompt(self, prompt, device, num_images_per_prompt, do_cla... method _encode_image (line 193) | def _encode_image(self, image, device, num_images_per_prompt, image_em... method __call__ (line 208) | def __call__( FILE: examples/community/unclip_text_interpolation.py function slerp (line 25) | def slerp(val, low, high): class UnCLIPTextInterpolationPipeline (line 37) | class UnCLIPTextInterpolationPipeline(DiffusionPipeline): method __init__ (line 82) | def __init__( method prepare_latents (line 111) | def prepare_latents(self, shape, dtype, device, generator, latents, sc... method _encode_prompt (line 123) | def _encode_prompt( method __call__ (line 215) | def __call__( FILE: examples/community/wildcard_stable_diffusion.py function get_filename (line 25) | def get_filename(path: str): function read_wildcard_values (line 30) | def read_wildcard_values(path: str): function grab_wildcard_values (line 35) | def grab_wildcard_values(wildcard_option_dict: Dict[str, List[str]] = {}... function replace_prompt_with_wildcards (line 45) | def replace_prompt_with_wildcards( class WildcardStableDiffusionOutput (line 62) | class WildcardStableDiffusionOutput(StableDiffusionPipelineOutput): class WildcardStableDiffusionPipeline (line 66) | class WildcardStableDiffusionPipeline(DiffusionPipeline, StableDiffusion... method __init__ (line 111) | def __init__( method __call__ (line 158) | def __call__( FILE: examples/conftest.py function pytest_addoption (line 39) | def pytest_addoption(parser): function pytest_terminal_summary (line 45) | def pytest_terminal_summary(terminalreporter): FILE: examples/consistency_distillation/test_lcm_lora.py class TextToImageLCM (line 35) | class TextToImageLCM(ExamplesTestsAccelerate): method test_text_to_image_lcm_lora_sdxl (line 36) | def test_text_to_image_lcm_lora_sdxl(self): method test_text_to_image_lcm_lora_sdxl_checkpointing (line 63) | def test_text_to_image_lcm_lora_sdxl_checkpointing(self): FILE: examples/consistency_distillation/train_lcm_distill_lora_sd_wds.py function get_module_kohya_state_dict (line 82) | def get_module_kohya_state_dict(module, prefix: str, dtype: torch.dtype,... function filter_keys (line 99) | def filter_keys(key_set): function group_by_keys_nothrow (line 106) | def group_by_keys_nothrow(data, keys=base_plus_ext, lcase=True, suffixes... function tarfile_to_samples_nothrow (line 134) | def tarfile_to_samples_nothrow(src, handler=wds.warn_and_continue): class WebdatasetFilter (line 142) | class WebdatasetFilter: method __init__ (line 143) | def __init__(self, min_size=1024, max_pwatermark=0.5): method __call__ (line 147) | def __call__(self, x): class SDText2ImageDataset (line 162) | class SDText2ImageDataset: method __init__ (line 163) | def __init__( method train_dataset (line 233) | def train_dataset(self): method train_dataloader (line 237) | def train_dataloader(self): function log_validation (line 241) | def log_validation(vae, unet, args, accelerator, weight_dtype, step): function guidance_scale_embedding (line 327) | def guidance_scale_embedding(w, embedding_dim=512, dtype=torch.float32): function append_dims (line 356) | def append_dims(x, target_dims): function scalings_for_boundary_conditions (line 365) | def scalings_for_boundary_conditions(timestep, sigma_data=0.5, timestep_... function get_predicted_original_sample (line 373) | def get_predicted_original_sample(model_output, timesteps, sample, predi... function get_predicted_noise (line 392) | def get_predicted_noise(model_output, timesteps, sample, prediction_type... function extract_into_tensor (line 410) | def extract_into_tensor(a, t, x_shape): class DDIMSolver (line 416) | class DDIMSolver: method __init__ (line 417) | def __init__(self, alpha_cumprods, timesteps=1000, ddim_timesteps=50): method to (line 430) | def to(self, device): method ddim_step (line 436) | def ddim_step(self, pred_x0, pred_noise, timestep_index): function update_ema (line 444) | def update_ema(target_params, source_params, rate=0.99): function import_model_class_from_model_name_or_path (line 457) | def import_model_class_from_model_name_or_path( function parse_args (line 477) | def parse_args(): function encode_prompt (line 852) | def encode_prompt(prompt_batch, text_encoder, tokenizer, proportion_empt... function main (line 877) | def main(args): FILE: examples/consistency_distillation/train_lcm_distill_lora_sdxl.py class DDIMSolver (line 79) | class DDIMSolver: method __init__ (line 80) | def __init__(self, alpha_cumprods, timesteps=1000, ddim_timesteps=50): method to (line 94) | def to(self, device): method ddim_step (line 100) | def ddim_step(self, pred_x0, pred_noise, timestep_index): function log_validation (line 107) | def log_validation(vae, args, accelerator, weight_dtype, step, unet=None... function append_dims (line 199) | def append_dims(x, target_dims): function scalings_for_boundary_conditions (line 208) | def scalings_for_boundary_conditions(timestep, sigma_data=0.5, timestep_... function get_predicted_original_sample (line 216) | def get_predicted_original_sample(model_output, timesteps, sample, predi... function get_predicted_noise (line 235) | def get_predicted_noise(model_output, timesteps, sample, prediction_type... function extract_into_tensor (line 253) | def extract_into_tensor(a, t, x_shape): function import_model_class_from_model_name_or_path (line 259) | def import_model_class_from_model_name_or_path( function parse_args (line 279) | def parse_args(): function encode_prompt (line 671) | def encode_prompt(prompt_batch, text_encoders, tokenizers, is_train=True): function main (line 709) | def main(args): FILE: examples/consistency_distillation/train_lcm_distill_lora_sdxl_wds.py function get_module_kohya_state_dict (line 88) | def get_module_kohya_state_dict(module, prefix: str, dtype: torch.dtype,... function filter_keys (line 105) | def filter_keys(key_set): function group_by_keys_nothrow (line 112) | def group_by_keys_nothrow(data, keys=base_plus_ext, lcase=True, suffixes... function tarfile_to_samples_nothrow (line 140) | def tarfile_to_samples_nothrow(src, handler=wds.warn_and_continue): class WebdatasetFilter (line 148) | class WebdatasetFilter: method __init__ (line 149) | def __init__(self, min_size=1024, max_pwatermark=0.5): method __call__ (line 153) | def __call__(self, x): class SDXLText2ImageDataset (line 168) | class SDXLText2ImageDataset: method __init__ (line 169) | def __init__( method train_dataset (line 251) | def train_dataset(self): method train_dataloader (line 255) | def train_dataloader(self): function log_validation (line 259) | def log_validation(vae, unet, args, accelerator, weight_dtype, step): function append_dims (line 343) | def append_dims(x, target_dims): function scalings_for_boundary_conditions (line 352) | def scalings_for_boundary_conditions(timestep, sigma_data=0.5, timestep_... function get_predicted_original_sample (line 360) | def get_predicted_original_sample(model_output, timesteps, sample, predi... function get_predicted_noise (line 379) | def get_predicted_noise(model_output, timesteps, sample, prediction_type... function extract_into_tensor (line 397) | def extract_into_tensor(a, t, x_shape): class DDIMSolver (line 403) | class DDIMSolver: method __init__ (line 404) | def __init__(self, alpha_cumprods, timesteps=1000, ddim_timesteps=50): method to (line 418) | def to(self, device): method ddim_step (line 424) | def ddim_step(self, pred_x0, pred_noise, timestep_index): function import_model_class_from_model_name_or_path (line 431) | def import_model_class_from_model_name_or_path( function parse_args (line 451) | def parse_args(): function encode_prompt (line 832) | def encode_prompt(prompt_batch, text_encoders, tokenizers, proportion_em... function main (line 872) | def main(args): FILE: examples/consistency_distillation/train_lcm_distill_sd_wds.py function filter_keys (line 81) | def filter_keys(key_set): function group_by_keys_nothrow (line 88) | def group_by_keys_nothrow(data, keys=base_plus_ext, lcase=True, suffixes... function tarfile_to_samples_nothrow (line 116) | def tarfile_to_samples_nothrow(src, handler=wds.warn_and_continue): class WebdatasetFilter (line 124) | class WebdatasetFilter: method __init__ (line 125) | def __init__(self, min_size=1024, max_pwatermark=0.5): method __call__ (line 129) | def __call__(self, x): class SDText2ImageDataset (line 144) | class SDText2ImageDataset: method __init__ (line 145) | def __init__( method train_dataset (line 215) | def train_dataset(self): method train_dataloader (line 219) | def train_dataloader(self): function log_validation (line 223) | def log_validation(vae, unet, args, accelerator, weight_dtype, step, nam... function guidance_scale_embedding (line 305) | def guidance_scale_embedding(w, embedding_dim=512, dtype=torch.float32): function append_dims (line 334) | def append_dims(x, target_dims): function scalings_for_boundary_conditions (line 343) | def scalings_for_boundary_conditions(timestep, sigma_data=0.5, timestep_... function get_predicted_original_sample (line 351) | def get_predicted_original_sample(model_output, timesteps, sample, predi... function get_predicted_noise (line 370) | def get_predicted_noise(model_output, timesteps, sample, prediction_type... function extract_into_tensor (line 388) | def extract_into_tensor(a, t, x_shape): class DDIMSolver (line 394) | class DDIMSolver: method __init__ (line 395) | def __init__(self, alpha_cumprods, timesteps=1000, ddim_timesteps=50): method to (line 408) | def to(self, device): method ddim_step (line 414) | def ddim_step(self, pred_x0, pred_noise, timestep_index): function update_ema (line 422) | def update_ema(target_params, source_params, rate=0.99): function import_model_class_from_model_name_or_path (line 435) | def import_model_class_from_model_name_or_path( function parse_args (line 455) | def parse_args(): function encode_prompt (line 817) | def encode_prompt(prompt_batch, text_encoder, tokenizer, proportion_empt... function main (line 842) | def main(args): FILE: examples/consistency_distillation/train_lcm_distill_sdxl_wds.py function filter_keys (line 87) | def filter_keys(key_set): function group_by_keys_nothrow (line 94) | def group_by_keys_nothrow(data, keys=base_plus_ext, lcase=True, suffixes... function tarfile_to_samples_nothrow (line 122) | def tarfile_to_samples_nothrow(src, handler=wds.warn_and_continue): class WebdatasetFilter (line 130) | class WebdatasetFilter: method __init__ (line 131) | def __init__(self, min_size=1024, max_pwatermark=0.5): method __call__ (line 135) | def __call__(self, x): class SDXLText2ImageDataset (line 150) | class SDXLText2ImageDataset: method __init__ (line 151) | def __init__( method train_dataset (line 233) | def train_dataset(self): method train_dataloader (line 237) | def train_dataloader(self): function log_validation (line 241) | def log_validation(vae, unet, args, accelerator, weight_dtype, step, nam... function append_dims (line 322) | def append_dims(x, target_dims): function scalings_for_boundary_conditions (line 331) | def scalings_for_boundary_conditions(timestep, sigma_data=0.5, timestep_... function get_predicted_original_sample (line 339) | def get_predicted_original_sample(model_output, timesteps, sample, predi... function get_predicted_noise (line 358) | def get_predicted_noise(model_output, timesteps, sample, prediction_type... function extract_into_tensor (line 376) | def extract_into_tensor(a, t, x_shape): function update_ema (line 383) | def update_ema(target_params, source_params, rate=0.99): function guidance_scale_embedding (line 397) | def guidance_scale_embedding(w, embedding_dim=512, dtype=torch.float32): class DDIMSolver (line 426) | class DDIMSolver: method __init__ (line 427) | def __init__(self, alpha_cumprods, timesteps=1000, ddim_timesteps=50): method to (line 441) | def to(self, device): method ddim_step (line 447) | def ddim_step(self, pred_x0, pred_noise, timestep_index): function import_model_class_from_model_name_or_path (line 454) | def import_model_class_from_model_name_or_path( function parse_args (line 474) | def parse_args(): function encode_prompt (line 842) | def encode_prompt(prompt_batch, text_encoders, tokenizers, proportion_em... function main (line 882) | def main(args): FILE: examples/controlnet/test_controlnet.py class ControlNet (line 33) | class ControlNet(ExamplesTestsAccelerate): method test_controlnet_checkpointing_checkpoints_total_limit (line 34) | def test_controlnet_checkpointing_checkpoints_total_limit(self): method test_controlnet_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 57) | def test_controlnet_checkpointing_checkpoints_total_limit_removes_mult... class ControlNetSDXL (line 99) | class ControlNetSDXL(ExamplesTestsAccelerate): method test_controlnet_sdxl (line 100) | def test_controlnet_sdxl(self): class ControlNetSD3 (line 120) | class ControlNetSD3(ExamplesTestsAccelerate): method test_controlnet_sd3 (line 121) | def test_controlnet_sd3(self): class ControlNetSD35 (line 141) | class ControlNetSD35(ExamplesTestsAccelerate): method test_controlnet_sd3 (line 142) | def test_controlnet_sd3(self): class ControlNetflux (line 162) | class ControlNetflux(ExamplesTestsAccelerate): method test_controlnet_flux (line 163) | def test_controlnet_flux(self): FILE: examples/controlnet/train_controlnet.py function image_grid (line 69) | def image_grid(imgs, rows, cols): function log_validation (line 80) | def log_validation( function import_model_class_from_model_name_or_path (line 189) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function save_model_card (line 209) | def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_... function parse_args (line 251) | def parse_args(input_args=None): function make_train_dataset (line 602) | def make_train_dataset(args, tokenizer, accelerator): function collate_fn (line 718) | def collate_fn(examples): function main (line 734) | def main(args): FILE: examples/controlnet/train_controlnet_flax.py function log_validation (line 69) | def log_validation(pipeline, pipeline_params, controlnet_params, tokeniz... function save_model_card (line 137) | def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_... function parse_args (line 180) | def parse_args(): function make_train_dataset (line 506) | def make_train_dataset(args, tokenizer, batch_size=None): function collate_fn (line 641) | def collate_fn(examples): function get_params_to_save (line 659) | def get_params_to_save(params): function main (line 663) | def main(): FILE: examples/controlnet/train_controlnet_flux.py function log_validation (line 76) | def log_validation( function save_model_card (line 201) | def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_... function parse_args (line 248) | def parse_args(input_args=None): function get_train_dataset (line 693) | def get_train_dataset(args, accelerator): function prepare_train_dataset (line 748) | def prepare_train_dataset(dataset, accelerator): function collate_fn (line 794) | def collate_fn(examples): function main (line 814) | def main(args): FILE: examples/controlnet/train_controlnet_sd3.py function log_validation (line 71) | def log_validation(controlnet, args, accelerator, weight_dtype, step, is... function load_text_encoders (line 214) | def load_text_encoders(class_one, class_two, class_three): function import_model_class_from_model_name_or_path (line 228) | def import_model_class_from_model_name_or_path( function save_model_card (line 247) | def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_... function parse_args (line 292) | def parse_args(input_args=None): function make_train_dataset (line 682) | def make_train_dataset(args, tokenizer_one, tokenizer_two, tokenizer_thr... function collate_fn (line 795) | def collate_fn(examples): function _encode_prompt_with_t5 (line 814) | def _encode_prompt_with_t5( function _encode_prompt_with_clip (line 849) | def _encode_prompt_with_clip( function encode_prompt (line 883) | def encode_prompt( function main (line 929) | def main(args): FILE: examples/controlnet/train_controlnet_sdxl.py function log_validation (line 72) | def log_validation(vae, unet, controlnet, args, accelerator, weight_dtyp... function import_model_class_from_model_name_or_path (line 212) | def import_model_class_from_model_name_or_path( function save_model_card (line 232) | def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_... function parse_args (line 275) | def parse_args(input_args=None): function get_train_dataset (line 656) | def get_train_dataset(args, accelerator): function encode_prompt (line 722) | def encode_prompt(prompt_batch, text_encoders, tokenizers, proportion_em... function prepare_train_dataset (line 762) | def prepare_train_dataset(dataset, accelerator): function collate_fn (line 809) | def collate_fn(examples): function main (line 829) | def main(args): FILE: examples/custom_diffusion/retrieve.py function retrieve (line 25) | def retrieve(class_prompt, class_data_dir, num_class_images): function parse_args (line 79) | def parse_args(): FILE: examples/custom_diffusion/test_custom_diffusion.py class CustomDiffusion (line 37) | class CustomDiffusion(ExamplesTestsAccelerate): method test_custom_diffusion (line 38) | def test_custom_diffusion(self): method test_custom_diffusion_checkpointing_checkpoints_total_limit (line 63) | def test_custom_diffusion_checkpointing_checkpoints_total_limit(self): method test_custom_diffusion_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 85) | def test_custom_diffusion_checkpointing_checkpoints_total_limit_remove... FILE: examples/custom_diffusion/train_custom_diffusion.py function freeze_params (line 72) | def freeze_params(params): function save_model_card (line 77) | def save_model_card(repo_id: str, images=None, base_model=str, prompt=st... function import_model_class_from_model_name_or_path (line 114) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function collate_fn (line 134) | def collate_fn(examples, with_prior_preservation): class PromptDataset (line 155) | class PromptDataset(Dataset): method __init__ (line 158) | def __init__(self, prompt, num_samples): method __len__ (line 162) | def __len__(self): method __getitem__ (line 165) | def __getitem__(self, index): class CustomDiffusionDataset (line 172) | class CustomDiffusionDataset(Dataset): method __init__ (line 178) | def __init__( method __len__ (line 236) | def __len__(self): method preprocess (line 239) | def preprocess(self, image, scale, resample): method __getitem__ (line 260) | def __getitem__(self, index): function save_new_embed (line 311) | def save_new_embed(text_encoder, modifier_token_id, accelerator, args, o... function parse_args (line 327) | def parse_args(input_args=None): function main (line 663) | def main(args): FILE: examples/dreambooth/test_dreambooth.py class DreamBooth (line 36) | class DreamBooth(ExamplesTestsAccelerate): method test_dreambooth (line 37) | def test_dreambooth(self): method test_dreambooth_if (line 60) | def test_dreambooth_if(self): method test_dreambooth_checkpointing (line 86) | def test_dreambooth_checkpointing(self): method test_dreambooth_checkpointing_checkpoints_total_limit (line 165) | def test_dreambooth_checkpointing_checkpoints_total_limit(self): method test_dreambooth_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 188) | def test_dreambooth_checkpointing_checkpoints_total_limit_removes_mult... FILE: examples/dreambooth/test_dreambooth_flux.py class DreamBoothFlux (line 36) | class DreamBoothFlux(ExamplesTestsAccelerate): method test_dreambooth (line 42) | def test_dreambooth(self): method test_dreambooth_checkpointing (line 65) | def test_dreambooth_checkpointing(self): method test_dreambooth_checkpointing_checkpoints_total_limit (line 141) | def test_dreambooth_checkpointing_checkpoints_total_limit(self): method test_dreambooth_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 164) | def test_dreambooth_checkpointing_checkpoints_total_limit_removes_mult... FILE: examples/dreambooth/test_dreambooth_lora.py class DreamBoothLoRA (line 37) | class DreamBoothLoRA(ExamplesTestsAccelerate): method test_dreambooth_lora (line 38) | def test_dreambooth_lora(self): method test_dreambooth_lora_with_text_encoder (line 70) | def test_dreambooth_lora_with_text_encoder(self): method test_dreambooth_lora_checkpointing_checkpoints_total_limit (line 104) | def test_dreambooth_lora_checkpointing_checkpoints_total_limit(self): method test_dreambooth_lora_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 127) | def test_dreambooth_lora_checkpointing_checkpoints_total_limit_removes... method test_dreambooth_lora_if_model (line 165) | def test_dreambooth_lora_if_model(self): class DreamBoothLoRASDXL (line 201) | class DreamBoothLoRASDXL(ExamplesTestsAccelerate): method test_dreambooth_lora_sdxl (line 202) | def test_dreambooth_lora_sdxl(self): method test_dreambooth_lora_sdxl_with_text_encoder (line 234) | def test_dreambooth_lora_sdxl_with_text_encoder(self): method test_dreambooth_lora_sdxl_custom_captions (line 270) | def test_dreambooth_lora_sdxl_custom_captions(self): method test_dreambooth_lora_sdxl_text_encoder_custom_captions (line 291) | def test_dreambooth_lora_sdxl_text_encoder_custom_captions(self): method test_dreambooth_lora_sdxl_checkpointing_checkpoints_total_limit (line 313) | def test_dreambooth_lora_sdxl_checkpointing_checkpoints_total_limit(se... method test_dreambooth_lora_sdxl_text_encoder_checkpointing_checkpoints_total_limit (line 345) | def test_dreambooth_lora_sdxl_text_encoder_checkpointing_checkpoints_t... FILE: examples/dreambooth/test_dreambooth_lora_edm.py class DreamBoothLoRASDXLWithEDM (line 35) | class DreamBoothLoRASDXLWithEDM(ExamplesTestsAccelerate): method test_dreambooth_lora_sdxl_with_edm (line 36) | def test_dreambooth_lora_sdxl_with_edm(self): method test_dreambooth_lora_playground (line 69) | def test_dreambooth_lora_playground(self): FILE: examples/dreambooth/test_dreambooth_lora_flux.py class DreamBoothLoRAFlux (line 38) | class DreamBoothLoRAFlux(ExamplesTestsAccelerate): method test_dreambooth_lora_flux (line 45) | def test_dreambooth_lora_flux(self): method test_dreambooth_lora_text_encoder_flux (line 77) | def test_dreambooth_lora_text_encoder_flux(self): method test_dreambooth_lora_latent_caching (line 110) | def test_dreambooth_lora_latent_caching(self): method test_dreambooth_lora_layers (line 143) | def test_dreambooth_lora_layers(self): method test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit (line 180) | def test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit(se... method test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 203) | def test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit_re... method test_dreambooth_lora_with_metadata (line 241) | def test_dreambooth_lora_with_metadata(self): FILE: examples/dreambooth/test_dreambooth_lora_flux2.py class DreamBoothLoRAFlux2 (line 38) | class DreamBoothLoRAFlux2(ExamplesTestsAccelerate): method test_dreambooth_lora_flux2 (line 45) | def test_dreambooth_lora_flux2(self): method test_dreambooth_lora_latent_caching (line 79) | def test_dreambooth_lora_latent_caching(self): method test_dreambooth_lora_layers (line 114) | def test_dreambooth_lora_layers(self): method test_dreambooth_lora_flux2_checkpointing_checkpoints_total_limit (line 153) | def test_dreambooth_lora_flux2_checkpointing_checkpoints_total_limit(s... method test_dreambooth_lora_flux2_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 178) | def test_dreambooth_lora_flux2_checkpointing_checkpoints_total_limit_r... method test_dreambooth_lora_with_metadata (line 220) | def test_dreambooth_lora_with_metadata(self): FILE: examples/dreambooth/test_dreambooth_lora_flux2_klein.py class DreamBoothLoRAFlux2Klein (line 38) | class DreamBoothLoRAFlux2Klein(ExamplesTestsAccelerate): method test_dreambooth_lora_flux2 (line 45) | def test_dreambooth_lora_flux2(self): method test_dreambooth_lora_latent_caching (line 79) | def test_dreambooth_lora_latent_caching(self): method test_dreambooth_lora_layers (line 114) | def test_dreambooth_lora_layers(self): method test_dreambooth_lora_flux2_checkpointing_checkpoints_total_limit (line 153) | def test_dreambooth_lora_flux2_checkpointing_checkpoints_total_limit(s... method test_dreambooth_lora_flux2_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 178) | def test_dreambooth_lora_flux2_checkpointing_checkpoints_total_limit_r... method test_dreambooth_lora_with_metadata (line 220) | def test_dreambooth_lora_with_metadata(self): FILE: examples/dreambooth/test_dreambooth_lora_flux_kontext.py class DreamBoothLoRAFluxKontext (line 38) | class DreamBoothLoRAFluxKontext(ExamplesTestsAccelerate): method test_dreambooth_lora_flux_kontext (line 45) | def test_dreambooth_lora_flux_kontext(self): method test_dreambooth_lora_text_encoder_flux_kontext (line 77) | def test_dreambooth_lora_text_encoder_flux_kontext(self): method test_dreambooth_lora_latent_caching (line 110) | def test_dreambooth_lora_latent_caching(self): method test_dreambooth_lora_layers (line 143) | def test_dreambooth_lora_layers(self): method test_dreambooth_lora_flux_kontext_checkpointing_checkpoints_total_limit (line 180) | def test_dreambooth_lora_flux_kontext_checkpointing_checkpoints_total_... method test_dreambooth_lora_flux_kontext_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 203) | def test_dreambooth_lora_flux_kontext_checkpointing_checkpoints_total_... method test_dreambooth_lora_with_metadata (line 241) | def test_dreambooth_lora_with_metadata(self): FILE: examples/dreambooth/test_dreambooth_lora_hidream.py class DreamBoothLoRAHiDreamImage (line 35) | class DreamBoothLoRAHiDreamImage(ExamplesTestsAccelerate): method test_dreambooth_lora_hidream (line 43) | def test_dreambooth_lora_hidream(self): method test_dreambooth_lora_latent_caching (line 78) | def test_dreambooth_lora_latent_caching(self): method test_dreambooth_lora_layers (line 114) | def test_dreambooth_lora_layers(self): method test_dreambooth_lora_hidream_checkpointing_checkpoints_total_limit (line 152) | def test_dreambooth_lora_hidream_checkpointing_checkpoints_total_limit... method test_dreambooth_lora_hidream_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 178) | def test_dreambooth_lora_hidream_checkpointing_checkpoints_total_limit... FILE: examples/dreambooth/test_dreambooth_lora_lumina2.py class DreamBoothLoRAlumina2 (line 35) | class DreamBoothLoRAlumina2(ExamplesTestsAccelerate): method test_dreambooth_lora_lumina2 (line 41) | def test_dreambooth_lora_lumina2(self): method test_dreambooth_lora_latent_caching (line 74) | def test_dreambooth_lora_latent_caching(self): method test_dreambooth_lora_layers (line 108) | def test_dreambooth_lora_layers(self): method test_dreambooth_lora_lumina2_checkpointing_checkpoints_total_limit (line 144) | def test_dreambooth_lora_lumina2_checkpointing_checkpoints_total_limit... method test_dreambooth_lora_lumina2_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 168) | def test_dreambooth_lora_lumina2_checkpointing_checkpoints_total_limit... FILE: examples/dreambooth/test_dreambooth_lora_qwenimage.py class DreamBoothLoRAQwenImage (line 38) | class DreamBoothLoRAQwenImage(ExamplesTestsAccelerate): method test_dreambooth_lora_qwen (line 45) | def test_dreambooth_lora_qwen(self): method test_dreambooth_lora_latent_caching (line 77) | def test_dreambooth_lora_latent_caching(self): method test_dreambooth_lora_layers (line 110) | def test_dreambooth_lora_layers(self): method test_dreambooth_lora_qwen_checkpointing_checkpoints_total_limit (line 147) | def test_dreambooth_lora_qwen_checkpointing_checkpoints_total_limit(se... method test_dreambooth_lora_qwen_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 170) | def test_dreambooth_lora_qwen_checkpointing_checkpoints_total_limit_re... method test_dreambooth_lora_with_metadata (line 208) | def test_dreambooth_lora_with_metadata(self): FILE: examples/dreambooth/test_dreambooth_lora_sana.py class DreamBoothLoRASANA (line 38) | class DreamBoothLoRASANA(ExamplesTestsAccelerate): method test_dreambooth_lora_sana (line 44) | def test_dreambooth_lora_sana(self): method test_dreambooth_lora_latent_caching (line 77) | def test_dreambooth_lora_latent_caching(self): method test_dreambooth_lora_layers (line 111) | def test_dreambooth_lora_layers(self): method test_dreambooth_lora_sana_checkpointing_checkpoints_total_limit (line 147) | def test_dreambooth_lora_sana_checkpointing_checkpoints_total_limit(se... method test_dreambooth_lora_sana_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 171) | def test_dreambooth_lora_sana_checkpointing_checkpoints_total_limit_re... method test_dreambooth_lora_sana_with_metadata (line 211) | def test_dreambooth_lora_sana_with_metadata(self): FILE: examples/dreambooth/test_dreambooth_lora_sd3.py class DreamBoothLoRASD3 (line 35) | class DreamBoothLoRASD3(ExamplesTestsAccelerate): method test_dreambooth_lora_sd3 (line 44) | def test_dreambooth_lora_sd3(self): method test_dreambooth_lora_text_encoder_sd3 (line 76) | def test_dreambooth_lora_text_encoder_sd3(self): method test_dreambooth_lora_latent_caching (line 109) | def test_dreambooth_lora_latent_caching(self): method test_dreambooth_lora_block (line 142) | def test_dreambooth_lora_block(self): method test_dreambooth_lora_layer (line 178) | def test_dreambooth_lora_layer(self): method test_dreambooth_lora_sd3_checkpointing_checkpoints_total_limit (line 210) | def test_dreambooth_lora_sd3_checkpointing_checkpoints_total_limit(self): method test_dreambooth_lora_sd3_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 233) | def test_dreambooth_lora_sd3_checkpointing_checkpoints_total_limit_rem... FILE: examples/dreambooth/test_dreambooth_sd3.py class DreamBoothSD3 (line 36) | class DreamBoothSD3(ExamplesTestsAccelerate): method test_dreambooth (line 42) | def test_dreambooth(self): method test_dreambooth_checkpointing (line 65) | def test_dreambooth_checkpointing(self): method test_dreambooth_checkpointing_checkpoints_total_limit (line 141) | def test_dreambooth_checkpointing_checkpoints_total_limit(self): method test_dreambooth_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 164) | def test_dreambooth_checkpointing_checkpoints_total_limit_removes_mult... FILE: examples/dreambooth/train_dreambooth.py function save_model_card (line 72) | def save_model_card( function log_validation (line 116) | def log_validation( function import_model_class_from_model_name_or_path (line 208) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function parse_args (line 232) | def parse_args(input_args=None): class DreamBoothDataset (line 611) | class DreamBoothDataset(Dataset): method __init__ (line 617) | def __init__( method __len__ (line 669) | def __len__(self): method __getitem__ (line 672) | def __getitem__(self, index): function collate_fn (line 710) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 745) | class PromptDataset(Dataset): method __init__ (line 748) | def __init__(self, prompt, num_samples): method __len__ (line 752) | def __len__(self): method __getitem__ (line 755) | def __getitem__(self, index): function model_has_vae (line 762) | def model_has_vae(args): function tokenize_prompt (line 772) | def tokenize_prompt(tokenizer, prompt, tokenizer_max_length=None): function encode_prompt (line 789) | def encode_prompt(text_encoder, input_ids, attention_mask, text_encoder_... function main (line 807) | def main(args): FILE: examples/dreambooth/train_dreambooth_flax.py function parse_args (line 46) | def parse_args(): class DreamBoothDataset (line 220) | class DreamBoothDataset(Dataset): method __init__ (line 226) | def __init__( method __len__ (line 272) | def __len__(self): method __getitem__ (line 275) | def __getitem__(self, index): class PromptDataset (line 303) | class PromptDataset(Dataset): method __init__ (line 306) | def __init__(self, prompt, num_samples): method __len__ (line 310) | def __len__(self): method __getitem__ (line 313) | def __getitem__(self, index): function get_params_to_save (line 320) | def get_params_to_save(params): function main (line 324) | def main(): FILE: examples/dreambooth/train_dreambooth_flux.py function save_model_card (line 94) | def save_model_card( function load_text_encoders (line 163) | def load_text_encoders(class_one, class_two): function log_validation (line 173) | def log_validation( function import_model_class_from_model_name_or_path (line 220) | def import_model_class_from_model_name_or_path( function parse_args (line 239) | def parse_args(input_args=None): class DreamBoothDataset (line 677) | class DreamBoothDataset(Dataset): method __init__ (line 683) | def __init__( method __len__ (line 819) | def __len__(self): method __getitem__ (line 822) | def __getitem__(self, index): function collate_fn (line 849) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 866) | class PromptDataset(Dataset): method __init__ (line 869) | def __init__(self, prompt, num_samples): method __len__ (line 873) | def __len__(self): method __getitem__ (line 876) | def __getitem__(self, index): function tokenize_prompt (line 883) | def tokenize_prompt(tokenizer, prompt, max_sequence_length): function _encode_prompt_with_t5 (line 897) | def _encode_prompt_with_t5( function _encode_prompt_with_clip (line 941) | def _encode_prompt_with_clip( function encode_prompt (line 985) | def encode_prompt( function main (line 1028) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora.py function save_model_card (line 83) | def save_model_card( function log_validation (line 124) | def log_validation( function import_model_class_from_model_name_or_path (line 190) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function parse_args (line 214) | def parse_args(input_args=None): class DreamBoothDataset (line 568) | class DreamBoothDataset(Dataset): method __init__ (line 574) | def __init__( method __len__ (line 630) | def __len__(self): method __getitem__ (line 633) | def __getitem__(self, index): function collate_fn (line 671) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 704) | class PromptDataset(Dataset): method __init__ (line 707) | def __init__(self, prompt, num_samples): method __len__ (line 711) | def __len__(self): method __getitem__ (line 714) | def __getitem__(self, index): function tokenize_prompt (line 721) | def tokenize_prompt(tokenizer, prompt, tokenizer_max_length=None): function encode_prompt (line 738) | def encode_prompt(text_encoder, input_ids, attention_mask, text_encoder_... function main (line 756) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_flux.py function save_model_card (line 100) | def save_model_card( function load_text_encoders (line 177) | def load_text_encoders(class_one, class_two): function log_validation (line 187) | def log_validation( function import_model_class_from_model_name_or_path (line 240) | def import_model_class_from_model_name_or_path( function parse_args (line 259) | def parse_args(input_args=None): class DreamBoothDataset (line 726) | class DreamBoothDataset(Dataset): method __init__ (line 732) | def __init__( method __len__ (line 865) | def __len__(self): method __getitem__ (line 868) | def __getitem__(self, index): function collate_fn (line 895) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 912) | class PromptDataset(Dataset): method __init__ (line 915) | def __init__(self, prompt, num_samples): method __len__ (line 919) | def __len__(self): method __getitem__ (line 922) | def __getitem__(self, index): function tokenize_prompt (line 929) | def tokenize_prompt(tokenizer, prompt, max_sequence_length): function _encode_prompt_with_t5 (line 943) | def _encode_prompt_with_t5( function _encode_prompt_with_clip (line 987) | def _encode_prompt_with_clip( function encode_prompt (line 1031) | def encode_prompt( function main (line 1071) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_flux2.py function save_model_card (line 112) | def save_model_card( function log_validation (line 189) | def log_validation( function module_filter_fn (line 240) | def module_filter_fn(mod: torch.nn.Module, fqn: str): function parse_args (line 251) | def parse_args(input_args=None): class DreamBoothDataset (line 766) | class DreamBoothDataset(Dataset): method __init__ (line 772) | def __init__( method __len__ (line 902) | def __len__(self): method __getitem__ (line 905) | def __getitem__(self, index): method train_transform (line 931) | def train_transform(self, image, size=(224, 224), center_crop=False, r... function collate_fn (line 959) | def collate_fn(examples, with_prior_preservation=False): class BucketBatchSampler (line 976) | class BucketBatchSampler(BatchSampler): method __init__ (line 977) | def __init__(self, dataset: DreamBoothDataset, batch_size: int, drop_l... method __iter__ (line 1007) | def __iter__(self): method __len__ (line 1013) | def __len__(self): class PromptDataset (line 1017) | class PromptDataset(Dataset): method __init__ (line 1020) | def __init__(self, prompt, num_samples): method __len__ (line 1024) | def __len__(self): method __getitem__ (line 1027) | def __getitem__(self, index): function main (line 1034) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_flux2_img2img.py function save_model_card (line 112) | def save_model_card( function log_validation (line 189) | def log_validation( function module_filter_fn (line 241) | def module_filter_fn(mod: torch.nn.Module, fqn: str): function parse_args (line 252) | def parse_args(input_args=None): class DreamBoothDataset (line 729) | class DreamBoothDataset(Dataset): method __init__ (line 735) | def __init__( method __len__ (line 896) | def __len__(self): method __getitem__ (line 899) | def __getitem__(self, index): method paired_transform (line 920) | def paired_transform(self, image, dest_image=None, size=(224, 224), ce... function collate_fn (line 958) | def collate_fn(examples): class BucketBatchSampler (line 974) | class BucketBatchSampler(BatchSampler): method __init__ (line 975) | def __init__(self, dataset: DreamBoothDataset, batch_size: int, drop_l... method __iter__ (line 1005) | def __iter__(self): method __len__ (line 1011) | def __len__(self): class PromptDataset (line 1015) | class PromptDataset(Dataset): method __init__ (line 1018) | def __init__(self, prompt, num_samples): method __len__ (line 1022) | def __len__(self): method __getitem__ (line 1025) | def __getitem__(self, index): function main (line 1032) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_flux2_klein.py function save_model_card (line 112) | def save_model_card( function log_validation (line 189) | def log_validation( function module_filter_fn (line 240) | def module_filter_fn(mod: torch.nn.Module, fqn: str): function parse_args (line 251) | def parse_args(input_args=None): class DreamBoothDataset (line 761) | class DreamBoothDataset(Dataset): method __init__ (line 767) | def __init__( method __len__ (line 897) | def __len__(self): method __getitem__ (line 900) | def __getitem__(self, index): method train_transform (line 926) | def train_transform(self, image, size=(224, 224), center_crop=False, r... function collate_fn (line 954) | def collate_fn(examples, with_prior_preservation=False): class BucketBatchSampler (line 971) | class BucketBatchSampler(BatchSampler): method __init__ (line 972) | def __init__(self, dataset: DreamBoothDataset, batch_size: int, drop_l... method __iter__ (line 1002) | def __iter__(self): method __len__ (line 1008) | def __len__(self): class PromptDataset (line 1012) | class PromptDataset(Dataset): method __init__ (line 1015) | def __init__(self, prompt, num_samples): method __len__ (line 1019) | def __len__(self): method __getitem__ (line 1022) | def __getitem__(self, index): function main (line 1029) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_flux2_klein_img2img.py function save_model_card (line 112) | def save_model_card( function log_validation (line 189) | def log_validation( function module_filter_fn (line 242) | def module_filter_fn(mod: torch.nn.Module, fqn: str): function parse_args (line 253) | def parse_args(input_args=None): class DreamBoothDataset (line 725) | class DreamBoothDataset(Dataset): method __init__ (line 731) | def __init__( method __len__ (line 892) | def __len__(self): method __getitem__ (line 895) | def __getitem__(self, index): method paired_transform (line 916) | def paired_transform(self, image, dest_image=None, size=(224, 224), ce... function collate_fn (line 954) | def collate_fn(examples): class BucketBatchSampler (line 970) | class BucketBatchSampler(BatchSampler): method __init__ (line 971) | def __init__(self, dataset: DreamBoothDataset, batch_size: int, drop_l... method __iter__ (line 1001) | def __iter__(self): method __len__ (line 1007) | def __len__(self): class PromptDataset (line 1011) | class PromptDataset(Dataset): method __init__ (line 1014) | def __init__(self, prompt, num_samples): method __len__ (line 1018) | def __len__(self): method __getitem__ (line 1021) | def __getitem__(self, index): function main (line 1028) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_flux_kontext.py function save_model_card (line 103) | def save_model_card( function load_text_encoders (line 180) | def load_text_encoders(class_one, class_two): function log_validation (line 190) | def log_validation( function import_model_class_from_model_name_or_path (line 246) | def import_model_class_from_model_name_or_path( function parse_args (line 265) | def parse_args(input_args=None): class DreamBoothDataset (line 770) | class DreamBoothDataset(Dataset): method __init__ (line 776) | def __init__( method __len__ (line 926) | def __len__(self): method __getitem__ (line 929) | def __getitem__(self, index): method paired_transform (line 959) | def paired_transform(self, image, dest_image=None, size=(224, 224), ce... function collate_fn (line 997) | def collate_fn(examples, with_prior_preservation=False): class BucketBatchSampler (line 1019) | class BucketBatchSampler(BatchSampler): method __init__ (line 1020) | def __init__(self, dataset: DreamBoothDataset, batch_size: int, drop_l... method __iter__ (line 1050) | def __iter__(self): method __len__ (line 1056) | def __len__(self): class PromptDataset (line 1060) | class PromptDataset(Dataset): method __init__ (line 1063) | def __init__(self, prompt, num_samples): method __len__ (line 1067) | def __len__(self): method __getitem__ (line 1070) | def __getitem__(self, index): function tokenize_prompt (line 1077) | def tokenize_prompt(tokenizer, prompt, max_sequence_length): function _encode_prompt_with_t5 (line 1091) | def _encode_prompt_with_t5( function _encode_prompt_with_clip (line 1135) | def _encode_prompt_with_clip( function encode_prompt (line 1179) | def encode_prompt( function main (line 1219) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_hidream.py function save_model_card (line 86) | def save_model_card( function load_text_encoders (line 174) | def load_text_encoders(class_one, class_two, class_three): function log_validation (line 193) | def log_validation( function import_model_class_from_model_name_or_path (line 248) | def import_model_class_from_model_name_or_path( function parse_args (line 267) | def parse_args(input_args=None): class DreamBoothDataset (line 733) | class DreamBoothDataset(Dataset): method __init__ (line 739) | def __init__( method __len__ (line 872) | def __len__(self): method __getitem__ (line 875) | def __getitem__(self, index): function collate_fn (line 902) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 919) | class PromptDataset(Dataset): method __init__ (line 922) | def __init__(self, prompt, num_samples): method __len__ (line 926) | def __len__(self): method __getitem__ (line 929) | def __getitem__(self, index): function main (line 936) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_lumina2.py function save_model_card (line 84) | def save_model_card( function log_validation (line 154) | def log_validation( function parse_args (line 198) | def parse_args(input_args=None): class DreamBoothDataset (line 652) | class DreamBoothDataset(Dataset): method __init__ (line 658) | def __init__( method __len__ (line 795) | def __len__(self): method __getitem__ (line 798) | def __getitem__(self, index): function collate_fn (line 825) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 842) | class PromptDataset(Dataset): method __init__ (line 845) | def __init__(self, prompt, num_samples): method __len__ (line 849) | def __len__(self): method __getitem__ (line 852) | def __getitem__(self, index): function main (line 859) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_qwen_image.py function save_model_card (line 104) | def save_model_card( function log_validation (line 181) | def log_validation( function parse_args (line 232) | def parse_args(input_args=None): class DreamBoothDataset (line 703) | class DreamBoothDataset(Dataset): method __init__ (line 709) | def __init__( method __len__ (line 842) | def __len__(self): method __getitem__ (line 845) | def __getitem__(self, index): function collate_fn (line 872) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 892) | class PromptDataset(Dataset): method __init__ (line 895) | def __init__(self, prompt, num_samples): method __len__ (line 899) | def __len__(self): method __getitem__ (line 902) | def __getitem__(self, index): function main (line 909) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_sana.py function save_model_card (line 102) | def save_model_card( function log_validation (line 173) | def log_validation( function parse_args (line 218) | def parse_args(input_args=None): class DreamBoothDataset (line 667) | class DreamBoothDataset(Dataset): method __init__ (line 673) | def __init__( method __len__ (line 806) | def __len__(self): method __getitem__ (line 809) | def __getitem__(self, index): function collate_fn (line 836) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 853) | class PromptDataset(Dataset): method __init__ (line 856) | def __init__(self, prompt, num_samples): method __len__ (line 860) | def __len__(self): method __getitem__ (line 863) | def __getitem__(self, index): function main (line 870) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_sd3.py function save_model_card (line 81) | def save_model_card( function load_text_encoders (line 173) | def load_text_encoders(class_one, class_two, class_three): function log_validation (line 186) | def log_validation( function import_model_class_from_model_name_or_path (line 230) | def import_model_class_from_model_name_or_path( function parse_args (line 249) | def parse_args(input_args=None): class DreamBoothDataset (line 720) | class DreamBoothDataset(Dataset): method __init__ (line 726) | def __init__( method __len__ (line 859) | def __len__(self): method __getitem__ (line 862) | def __getitem__(self, index): function collate_fn (line 889) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 906) | class PromptDataset(Dataset): method __init__ (line 909) | def __init__(self, prompt, num_samples): method __len__ (line 913) | def __len__(self): method __getitem__ (line 916) | def __getitem__(self, index): function tokenize_prompt (line 923) | def tokenize_prompt(tokenizer, prompt): function _encode_prompt_with_t5 (line 935) | def _encode_prompt_with_t5( function _encode_prompt_with_clip (line 975) | def _encode_prompt_with_clip( function encode_prompt (line 1014) | def encode_prompt( function main (line 1063) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_sdxl.py function determine_scheduler_type (line 88) | def determine_scheduler_type(pretrained_model_name_or_path, revision): function save_model_card (line 102) | def save_model_card( function log_validation (line 179) | def log_validation( function import_model_class_from_model_name_or_path (line 243) | def import_model_class_from_model_name_or_path( function parse_args (line 263) | def parse_args(input_args=None): class DreamBoothDataset (line 716) | class DreamBoothDataset(Dataset): method __init__ (line 722) | def __init__( method __len__ (line 866) | def __len__(self): method __getitem__ (line 869) | def __getitem__(self, index): function collate_fn (line 900) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 926) | class PromptDataset(Dataset): method __init__ (line 929) | def __init__(self, prompt, num_samples): method __len__ (line 933) | def __len__(self): method __getitem__ (line 936) | def __getitem__(self, index): function tokenize_prompt (line 943) | def tokenize_prompt(tokenizer, prompt): function encode_prompt (line 956) | def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list... function main (line 983) | def main(args): FILE: examples/dreambooth/train_dreambooth_lora_z_image.py function save_model_card (line 112) | def save_model_card( function log_validation (line 188) | def log_validation( function module_filter_fn (line 240) | def module_filter_fn(mod: torch.nn.Module, fqn: str): function parse_args (line 251) | def parse_args(input_args=None): class DreamBoothDataset (line 755) | class DreamBoothDataset(Dataset): method __init__ (line 761) | def __init__( method __len__ (line 891) | def __len__(self): method __getitem__ (line 894) | def __getitem__(self, index): method train_transform (line 920) | def train_transform(self, image, size=(224, 224), center_crop=False, r... function collate_fn (line 948) | def collate_fn(examples, with_prior_preservation=False): class BucketBatchSampler (line 965) | class BucketBatchSampler(BatchSampler): method __init__ (line 966) | def __init__(self, dataset: DreamBoothDataset, batch_size: int, drop_l... method __iter__ (line 996) | def __iter__(self): method __len__ (line 1002) | def __len__(self): class PromptDataset (line 1006) | class PromptDataset(Dataset): method __init__ (line 1009) | def __init__(self, prompt, num_samples): method __len__ (line 1013) | def __len__(self): method __getitem__ (line 1016) | def __getitem__(self, index): function main (line 1023) | def main(args): FILE: examples/dreambooth/train_dreambooth_sd3.py function save_model_card (line 72) | def save_model_card( function load_text_encoders (line 149) | def load_text_encoders(class_one, class_two, class_three): function log_validation (line 162) | def log_validation( function import_model_class_from_model_name_or_path (line 206) | def import_model_class_from_model_name_or_path( function parse_args (line 225) | def parse_args(input_args=None): class DreamBoothDataset (line 652) | class DreamBoothDataset(Dataset): method __init__ (line 658) | def __init__( method __len__ (line 791) | def __len__(self): method __getitem__ (line 794) | def __getitem__(self, index): function collate_fn (line 821) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 838) | class PromptDataset(Dataset): method __init__ (line 841) | def __init__(self, prompt, num_samples): method __len__ (line 845) | def __len__(self): method __getitem__ (line 848) | def __getitem__(self, index): function tokenize_prompt (line 855) | def tokenize_prompt(tokenizer, prompt): function _encode_prompt_with_t5 (line 867) | def _encode_prompt_with_t5( function _encode_prompt_with_clip (line 901) | def _encode_prompt_with_clip( function encode_prompt (line 940) | def encode_prompt( function main (line 988) | def main(args): FILE: examples/flux-control/train_control_flux.py function encode_images (line 65) | def encode_images(pixels: torch.Tensor, vae: torch.nn.Module, weight_dty... function log_validation (line 71) | def log_validation(flux_transformer, args, accelerator, weight_dtype, st... function save_model_card (line 176) | def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_... function parse_args (line 223) | def parse_args(input_args=None): function get_train_dataset (line 595) | def get_train_dataset(args, accelerator): function prepare_train_dataset (line 650) | def prepare_train_dataset(dataset, accelerator): function collate_fn (line 688) | def collate_fn(examples): function main (line 697) | def main(args): FILE: examples/flux-control/train_control_lora_flux.py function encode_images (line 68) | def encode_images(pixels: torch.Tensor, vae: torch.nn.Module, weight_dty... function log_validation (line 74) | def log_validation(flux_transformer, args, accelerator, weight_dtype, st... function save_model_card (line 186) | def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_... function parse_args (line 234) | def parse_args(input_args=None): function get_train_dataset (line 623) | def get_train_dataset(args, accelerator): function prepare_train_dataset (line 678) | def prepare_train_dataset(dataset, accelerator): function collate_fn (line 716) | def collate_fn(examples): function main (line 725) | def main(args): FILE: examples/instruct_pix2pix/test_instruct_pix2pix.py class InstructPix2Pix (line 33) | class InstructPix2Pix(ExamplesTestsAccelerate): method test_instruct_pix2pix_checkpointing_checkpoints_total_limit (line 34) | def test_instruct_pix2pix_checkpointing_checkpoints_total_limit(self): method test_instruct_pix2pix_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 57) | def test_instruct_pix2pix_checkpointing_checkpoints_total_limit_remove... FILE: examples/instruct_pix2pix/train_instruct_pix2pix.py function log_validation (line 71) | def log_validation( function parse_args (line 113) | def parse_args(): function convert_to_np (line 416) | def convert_to_np(image, resolution): function download_image (line 421) | def download_image(url): function main (line 428) | def main(): FILE: examples/instruct_pix2pix/train_instruct_pix2pix_sdxl.py function log_validation (line 74) | def log_validation(pipeline, args, accelerator, generator, global_step, ... function import_model_class_from_model_name_or_path (line 123) | def import_model_class_from_model_name_or_path( function parse_args (line 143) | def parse_args(): function convert_to_np (line 473) | def convert_to_np(image, resolution): function main (line 480) | def main(): FILE: examples/kandinsky2_2/text_to_image/train_text_to_image_decoder.py function save_model_card (line 61) | def save_model_card( function log_validation (line 138) | def log_validation(vae, image_encoder, image_processor, unet, args, acce... function parse_args (line 189) | def parse_args(): function main (line 442) | def main(): FILE: examples/kandinsky2_2/text_to_image/train_text_to_image_lora_decoder.py function save_model_card (line 54) | def save_model_card(repo_id: str, images=None, base_model=str, dataset_n... function parse_args (line 82) | def parse_args(): function main (line 327) | def main(): FILE: examples/kandinsky2_2/text_to_image/train_text_to_image_lora_prior.py function save_model_card (line 54) | def save_model_card(repo_id: str, images=None, base_model=str, dataset_n... function parse_args (line 82) | def parse_args(): function main (line 339) | def main(): FILE: examples/kandinsky2_2/text_to_image/train_text_to_image_prior.py function save_model_card (line 64) | def save_model_card( function log_validation (line 141) | def log_validation( function parse_args (line 192) | def parse_args(): function main (line 443) | def main(): FILE: examples/model_search/pipeline_easy.py class RepoStatus (line 247) | class RepoStatus: class ModelStatus (line 266) | class ModelStatus: class ExtraStatus (line 291) | class ExtraStatus: class SearchResult (line 304) | class SearchResult: function load_pipeline_from_single_file (line 330) | def load_pipeline_from_single_file(pretrained_model_or_path, pipeline_ma... function get_keyword_types (line 404) | def get_keyword_types(keyword): function file_downloader (line 484) | def file_downloader( function search_huggingface (line 552) | def search_huggingface(search_word: str, **kwargs) -> Union[str, SearchR... function search_civitai (line 741) | def search_civitai(search_word: str, **kwargs) -> Union[str, SearchResul... function add_methods (line 931) | def add_methods(pipeline): class AutoConfig (line 946) | class AutoConfig: method auto_load_textual_inversion (line 947) | def auto_load_textual_inversion( method auto_load_lora_weights (line 1092) | def auto_load_lora_weights( class EasyPipelineForText2Image (line 1140) | class EasyPipelineForText2Image(AutoPipelineForText2Image): method __init__ (line 1157) | def __init__(self, *args, **kwargs): method from_huggingface (line 1163) | def from_huggingface(cls, pretrained_model_link_or_path, **kwargs): method from_civitai (line 1289) | def from_civitai(cls, pretrained_model_link_or_path, **kwargs): class EasyPipelineForImage2Image (line 1391) | class EasyPipelineForImage2Image(AutoPipelineForImage2Image): method __init__ (line 1409) | def __init__(self, *args, **kwargs): method from_huggingface (line 1415) | def from_huggingface(cls, pretrained_model_link_or_path, **kwargs): method from_civitai (line 1542) | def from_civitai(cls, pretrained_model_link_or_path, **kwargs): class EasyPipelineForInpainting (line 1644) | class EasyPipelineForInpainting(AutoPipelineForInpainting): method __init__ (line 1662) | def __init__(self, *args, **kwargs): method from_huggingface (line 1668) | def from_huggingface(cls, pretrained_model_link_or_path, **kwargs): method from_civitai (line 1794) | def from_civitai(cls, pretrained_model_link_or_path, **kwargs): FILE: examples/reinforcement_learning/diffusion_policy.py class ObservationEncoder (line 37) | class ObservationEncoder(nn.Module): method __init__ (line 48) | def __init__(self, state_dim): method forward (line 52) | def forward(self, x): class ObservationProjection (line 56) | class ObservationProjection(nn.Module): method __init__ (line 67) | def __init__(self): method forward (line 72) | def forward(self, x): # pad 256-dim input to 512-dim with zeros class DiffusionPolicy (line 78) | class DiffusionPolicy: method __init__ (line 88) | def __init__(self, state_dim=5, device="cpu"): method normalize_data (line 128) | def normalize_data(self, data, stats): method unnormalize_data (line 132) | def unnormalize_data(self, ndata, stats): method predict (line 136) | def predict(self, observation): FILE: examples/research_projects/anytext/anytext.py class Checker (line 75) | class Checker: method __init__ (line 76) | def __init__(self): method _is_chinese_char (line 79) | def _is_chinese_char(self, cp): method _clean_text (line 103) | def _clean_text(self, text): method _is_control (line 116) | def _is_control(self, char): method _is_whitespace (line 127) | def _is_whitespace(self, char): function get_clip_token_for_string (line 179) | def get_clip_token_for_string(tokenizer, string): function get_recog_emb (line 196) | def get_recog_emb(encoder, img_list): class EmbeddingManager (line 203) | class EmbeddingManager(ModelMixin, ConfigMixin): method __init__ (line 205) | def __init__( method encode_text (line 229) | def encode_text(self, text_info): method forward (line 254) | def forward( method embedding_parameters (line 273) | def embedding_parameters(self): function min_bounding_rect (line 280) | def min_bounding_rect(img): function adjust_image (line 305) | def adjust_image(box, img): function crop_image (line 324) | def crop_image(src_img, mask): function create_predictor (line 332) | def create_predictor(model_lang="ch", device="cpu", use_fp16=False): function _check_image_file (line 367) | def _check_image_file(path): function get_image_file_list (line 372) | def get_image_file_list(img_file): class TextRecognizer (line 389) | class TextRecognizer(object): method __init__ (line 390) | def __init__(self, args, predictor): method resize_norm_img (line 400) | def resize_norm_img(self, img, max_wh_ratio): method pred_imglist (line 425) | def pred_imglist(self, img_list, show_debug=False): method get_char_dict (line 483) | def get_char_dict(self, character_dict_path): method get_text (line 494) | def get_text(self, order): method decode (line 498) | def decode(self, mat): method get_ctcloss (line 507) | def get_ctcloss(self, preds, gt_text, weight): class AbstractEncoder (line 525) | class AbstractEncoder(nn.Module): method __init__ (line 526) | def __init__(self): method encode (line 529) | def encode(self, *args, **kwargs): class FrozenCLIPEmbedderT3 (line 533) | class FrozenCLIPEmbedderT3(AbstractEncoder, ModelMixin, ConfigMixin): method __init__ (line 537) | def __init__( method freeze (line 680) | def freeze(self): method forward (line 685) | def forward(self, text, **kwargs): method encode (line 704) | def encode(self, text, **kwargs): method split_chunks (line 707) | def split_chunks(self, input_ids, chunk_size=75): class TextEmbeddingModule (line 733) | class TextEmbeddingModule(ModelMixin, ConfigMixin): method __init__ (line 735) | def __init__(self, font_path, use_fp16=False, device="cpu"): method forward (line 757) | def forward( method arr2tensor (line 875) | def arr2tensor(self, arr, bs): method separate_pos_imgs (line 883) | def separate_pos_imgs(self, img, sort_priority, gap=102): method find_polygon (line 900) | def find_polygon(self, image, min_rect=False): method draw_glyph (line 916) | def draw_glyph(self, font, text): method draw_glyph2 (line 937) | def draw_glyph2(self, font, text, polygon, vertAng=10, scale=1, width=... method insert_spaces (line 1010) | def insert_spaces(self, string, nSpace): function retrieve_latents (line 1020) | def retrieve_latents( class AuxiliaryLatentModule (line 1033) | class AuxiliaryLatentModule(ModelMixin, ConfigMixin): method __init__ (line 1035) | def __init__( method forward (line 1043) | def forward( method check_channels (line 1096) | def check_channels(self, image): method resize_image (line 1104) | def resize_image(self, img, max_length=768): method insert_spaces (line 1118) | def insert_spaces(self, string, nSpace): function retrieve_timesteps (line 1128) | def retrieve_timesteps( class AnyTextPipeline (line 1187) | class AnyTextPipeline( method __init__ (line 1237) | def __init__( method modify_prompt (line 1300) | def modify_prompt(self, prompt): method is_chinese (line 1318) | def is_chinese(self, text): method _encode_prompt (line 1327) | def _encode_prompt( method encode_prompt (line 1360) | def encode_prompt( method encode_image (line 1543) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 1568) | def prepare_ip_adapter_image_embeds( method run_safety_checker (line 1614) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 1629) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 1641) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 1658) | def check_inputs( method check_image (line 1789) | def check_image(self, image, prompt, prompt_embeds): method prepare_image (line 1826) | def prepare_image( method prepare_latents (line 1857) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method get_guidance_scale_embedding (line 1880) | def get_guidance_scale_embedding( method guidance_scale (line 1911) | def guidance_scale(self): method clip_skip (line 1915) | def clip_skip(self): method do_classifier_free_guidance (line 1922) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1926) | def cross_attention_kwargs(self): method num_timesteps (line 1930) | def num_timesteps(self): method __call__ (line 1935) | def __call__( method to (line 2362) | def to(self, *args, **kwargs): FILE: examples/research_projects/anytext/anytext_controlnet.py class AnyTextControlNetConditioningEmbedding (line 38) | class AnyTextControlNetConditioningEmbedding(nn.Module): method __init__ (line 48) | def __init__( method forward (line 96) | def forward(self, glyphs, positions, text_info): class AnyTextControlNetModel (line 104) | class AnyTextControlNetModel(ControlNetModel): method __init__ (line 176) | def __init__( method forward (line 258) | def forward( function zero_module (line 460) | def zero_module(module): FILE: examples/research_projects/anytext/ocr_recog/RNN.py class Swish (line 7) | class Swish(nn.Module): method __int__ (line 8) | def __int__(self): method forward (line 11) | def forward(self, x): class Im2Im (line 15) | class Im2Im(nn.Module): method __init__ (line 16) | def __init__(self, in_channels, **kwargs): method forward (line 20) | def forward(self, x): class Im2Seq (line 24) | class Im2Seq(nn.Module): method __init__ (line 25) | def __init__(self, in_channels, **kwargs): method forward (line 29) | def forward(self, x): class EncoderWithRNN (line 37) | class EncoderWithRNN(nn.Module): method __init__ (line 38) | def __init__(self, in_channels, **kwargs): method forward (line 44) | def forward(self, x): class SequenceEncoder (line 50) | class SequenceEncoder(nn.Module): method __init__ (line 51) | def __init__(self, in_channels, encoder_type="rnn", **kwargs): method forward (line 68) | def forward(self, x): class ConvBNLayer (line 80) | class ConvBNLayer(nn.Module): method __init__ (line 81) | def __init__( method forward (line 98) | def forward(self, inputs): class EncoderWithSVTR (line 105) | class EncoderWithSVTR(nn.Module): method __init__ (line 106) | def __init__( method _init_weights (line 157) | def _init_weights(self, m): method forward (line 178) | def forward(self, x): FILE: examples/research_projects/anytext/ocr_recog/RecCTCHead.py class CTCHead (line 4) | class CTCHead(nn.Module): method __init__ (line 5) | def __init__( method forward (line 31) | def forward(self, x, labels=None): FILE: examples/research_projects/anytext/ocr_recog/RecModel.py class RecModel (line 13) | class RecModel(nn.Module): method __init__ (line 14) | def __init__(self, config): method load_3rd_state_dict (line 31) | def load_3rd_state_dict(self, _3rd_name, _state): method forward (line 36) | def forward(self, x): method encode (line 45) | def encode(self, x): FILE: examples/research_projects/anytext/ocr_recog/RecMv1_enhance.py class ConvBNLayer (line 8) | class ConvBNLayer(nn.Module): method __init__ (line 9) | def __init__( method forward (line 30) | def forward(self, inputs): class DepthwiseSeparable (line 38) | class DepthwiseSeparable(nn.Module): method __init__ (line 39) | def __init__( method forward (line 62) | def forward(self, inputs): class MobileNetV1Enhance (line 70) | class MobileNetV1Enhance(nn.Module): method __init__ (line 71) | def __init__(self, in_channels=3, scale=0.5, last_conv_stride=1, last_... method forward (line 167) | def forward(self, inputs): function hardsigmoid (line 174) | def hardsigmoid(x): class SEModule (line 178) | class SEModule(nn.Module): method __init__ (line 179) | def __init__(self, channel, reduction=4): method forward (line 189) | def forward(self, inputs): FILE: examples/research_projects/anytext/ocr_recog/RecSVTR.py function drop_path (line 8) | def drop_path(x, drop_prob=0.0, training=False): class Swish (line 23) | class Swish(nn.Module): method __int__ (line 24) | def __int__(self): method forward (line 27) | def forward(self, x): class ConvBNLayer (line 31) | class ConvBNLayer(nn.Module): method __init__ (line 32) | def __init__( method forward (line 49) | def forward(self, inputs): class DropPath (line 56) | class DropPath(nn.Module): method __init__ (line 59) | def __init__(self, drop_prob=None): method forward (line 63) | def forward(self, x): class Identity (line 67) | class Identity(nn.Module): method __init__ (line 68) | def __init__(self): method forward (line 71) | def forward(self, input): class Mlp (line 75) | class Mlp(nn.Module): method __init__ (line 76) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 88) | def forward(self, x): class ConvMixer (line 97) | class ConvMixer(nn.Module): method __init__ (line 98) | def __init__( method forward (line 118) | def forward(self, x): class Attention (line 127) | class Attention(nn.Module): method __init__ (line 128) | def __init__( method forward (line 169) | def forward(self, x): class Block (line 190) | class Block(nn.Module): method __init__ (line 191) | def __init__( method forward (line 241) | def forward(self, x): class PatchEmbed (line 251) | class PatchEmbed(nn.Module): method __init__ (line 254) | def __init__(self, img_size=(32, 100), in_channels=3, embed_dim=768, s... method forward (line 313) | def forward(self, x): class SubSample (line 322) | class SubSample(nn.Module): method __init__ (line 323) | def __init__(self, in_channels, out_channels, types="Pool", stride=(2,... method forward (line 345) | def forward(self, x): class SVTRNet (line 361) | class SVTRNet(nn.Module): method __init__ (line 362) | def __init__( method _init_weights (line 518) | def _init_weights(self, m): method forward_features (line 527) | def forward_features(self, x): method forward (line 545) | def forward(self, x): FILE: examples/research_projects/anytext/ocr_recog/common.py class Hswish (line 6) | class Hswish(nn.Module): method __init__ (line 7) | def __init__(self, inplace=True): method forward (line 11) | def forward(self, x): class Hsigmoid (line 17) | class Hsigmoid(nn.Module): method __init__ (line 18) | def __init__(self, inplace=True): method forward (line 22) | def forward(self, x): class GELU (line 28) | class GELU(nn.Module): method __init__ (line 29) | def __init__(self, inplace=True): method forward (line 33) | def forward(self, x): class Swish (line 37) | class Swish(nn.Module): method __init__ (line 38) | def __init__(self, inplace=True): method forward (line 42) | def forward(self, x): class Activation (line 50) | class Activation(nn.Module): method __init__ (line 51) | def __init__(self, act_type, inplace=True): method forward (line 73) | def forward(self, inputs): FILE: examples/research_projects/autoencoder_rae/train_autoencoder_rae.py function parse_args (line 40) | def parse_args(): function build_transforms (line 134) | def build_transforms(args): function compute_losses (line 145) | def compute_losses( function _strip_final_layernorm_affine (line 181) | def _strip_final_layernorm_affine(state_dict, prefix=""): function _load_pretrained_encoder_weights (line 187) | def _load_pretrained_encoder_weights(model, encoder_type, encoder_name_o... function main (line 213) | def main(): FILE: examples/research_projects/autoencoderkl/train_autoencoderkl.py function log_validation (line 65) | def log_validation(vae, args, accelerator, weight_dtype, step, is_final_... function save_model_card (line 117) | def save_model_card(repo_id: str, images=None, base_model=str, repo_fold... function parse_args (line 152) | def parse_args(input_args=None): function make_train_dataset (line 494) | def make_train_dataset(args, accelerator): function collate_fn (line 561) | def collate_fn(examples): function main (line 568) | def main(args): FILE: examples/research_projects/colossalai/train_dreambooth_colossalai.py function import_model_class_from_model_name_or_path (line 33) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function parse_args (line 53) | def parse_args(input_args=None): class DreamBoothDataset (line 250) | class DreamBoothDataset(Dataset): method __init__ (line 256) | def __init__( method __len__ (line 298) | def __len__(self): method __getitem__ (line 301) | def __getitem__(self, index): class PromptDataset (line 329) | class PromptDataset(Dataset): method __init__ (line 332) | def __init__(self, prompt, num_samples): method __len__ (line 336) | def __len__(self): method __getitem__ (line 339) | def __getitem__(self, index): function gemini_zero_dpp (line 347) | def gemini_zero_dpp(model: torch.nn.Module, placememt_policy: str = "aut... function main (line 356) | def main(args): FILE: examples/research_projects/consistency_training/train_cm_ct_unconditional.py function _extract_into_tensor (line 59) | def _extract_into_tensor(arr, timesteps, broadcast_shape): function append_dims (line 77) | def append_dims(x, target_dims): function extract_into_tensor (line 85) | def extract_into_tensor(a, t, x_shape): function get_discretization_steps (line 91) | def get_discretization_steps(global_step: int, max_train_steps: int, s_0... function get_skip_steps (line 104) | def get_skip_steps(global_step, initial_skip: int = 1): function get_karras_sigmas (line 109) | def get_karras_sigmas( function get_discretized_lognormal_weights (line 129) | def get_discretized_lognormal_weights(noise_levels: torch.Tensor, p_mean... function get_loss_weighting_schedule (line 140) | def get_loss_weighting_schedule(noise_levels: torch.Tensor): function add_noise (line 147) | def add_noise(original_samples: torch.Tensor, noise: torch.Tensor, times... function get_noise_preconditioning (line 158) | def get_noise_preconditioning(sigmas, noise_precond_type: str = "cm"): function get_input_preconditioning (line 176) | def get_input_preconditioning(sigmas, sigma_data=0.5, input_precond_type... function scalings_for_boundary_conditions (line 191) | def scalings_for_boundary_conditions(timestep, sigma_data=0.5, timestep_... function log_validation (line 198) | def log_validation(unet, scheduler, args, accelerator, weight_dtype, ste... function parse_args (line 278) | def parse_args(): function main (line 786) | def main(args): FILE: examples/research_projects/controlnet/train_controlnet_webdataset.py function filter_keys (line 79) | def filter_keys(key_set): function group_by_keys_nothrow (line 86) | def group_by_keys_nothrow(data, keys=base_plus_ext, lcase=True, suffixes... function tarfile_to_samples_nothrow (line 114) | def tarfile_to_samples_nothrow(src, handler=wds.warn_and_continue): function control_transform (line 122) | def control_transform(image): function canny_image_transform (line 135) | def canny_image_transform(example, resolution=1024): function depth_image_transform (line 154) | def depth_image_transform(example, feature_extractor, resolution=1024): class WebdatasetFilter (line 173) | class WebdatasetFilter: method __init__ (line 174) | def __init__(self, min_size=1024, max_pwatermark=0.5): method __call__ (line 178) | def __call__(self, x): class Text2ImageDataset (line 193) | class Text2ImageDataset: method __init__ (line 194) | def __init__( method train_dataset (line 293) | def train_dataset(self): method train_dataloader (line 297) | def train_dataloader(self): method eval_dataset (line 301) | def eval_dataset(self): method eval_dataloader (line 305) | def eval_dataloader(self): function image_grid (line 309) | def image_grid(imgs, rows, cols): function log_validation (line 320) | def log_validation(vae, unet, controlnet, args, accelerator, weight_dtyp... function import_model_class_from_model_name_or_path (line 418) | def import_model_class_from_model_name_or_path( function save_model_card (line 438) | def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_... function parse_args (line 477) | def parse_args(input_args=None): function encode_prompt (line 859) | def encode_prompt(prompt_batch, text_encoders, tokenizers, proportion_em... function main (line 899) | def main(args): FILE: examples/research_projects/diffusion_dpo/train_diffusion_dpo.py function import_model_class_from_model_name_or_path (line 73) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function log_validation (line 89) | def log_validation(args, unet, accelerator, weight_dtype, epoch, is_fina... function parse_args (line 154) | def parse_args(input_args=None): function tokenize_captions (line 446) | def tokenize_captions(tokenizer, examples): function encode_prompt (line 460) | def encode_prompt(text_encoder, input_ids): function main (line 470) | def main(args): FILE: examples/research_projects/diffusion_dpo/train_diffusion_dpo_sdxl.py function import_model_class_from_model_name_or_path (line 74) | def import_model_class_from_model_name_or_path( function log_validation (line 94) | def log_validation(args, unet, vae, accelerator, weight_dtype, epoch, is... function parse_args (line 173) | def parse_args(input_args=None): function tokenize_captions (line 473) | def tokenize_captions(tokenizers, examples): function encode_prompt (line 489) | def encode_prompt(text_encoders, text_input_ids_list): function main (line 512) | def main(args): FILE: examples/research_projects/diffusion_orpo/train_diffusion_orpo_sdxl_lora.py function import_model_class_from_model_name_or_path (line 74) | def import_model_class_from_model_name_or_path( function log_validation (line 94) | def log_validation(args, unet, vae, accelerator, weight_dtype, epoch, is... function parse_args (line 171) | def parse_args(input_args=None): function tokenize_captions (line 463) | def tokenize_captions(tokenizers, examples): function encode_prompt (line 479) | def encode_prompt(text_encoders, text_input_ids_list): function main (line 502) | def main(args): FILE: examples/research_projects/diffusion_orpo/train_diffusion_orpo_sdxl_lora_wds.py function import_model_class_from_model_name_or_path (line 72) | def import_model_class_from_model_name_or_path( function log_validation (line 92) | def log_validation(args, unet, vae, accelerator, weight_dtype, epoch, is... function parse_args (line 169) | def parse_args(input_args=None): function tokenize_captions (line 444) | def tokenize_captions(tokenizers, sample): function encode_prompt (line 464) | def encode_prompt(text_encoders, text_input_ids_list): function get_dataset (line 487) | def get_dataset(args): function get_loader (line 504) | def get_loader(args, tokenizer_one, tokenizer_two): function main (line 609) | def main(args): FILE: examples/research_projects/dreambooth_inpaint/train_dreambooth_inpaint.py function prepare_mask_and_masked_image (line 40) | def prepare_mask_and_masked_image(image, mask): function random_mask (line 58) | def random_mask(im_shape, ratio=1, mask_full_image=False): function parse_args (line 82) | def parse_args(): class DreamBoothDataset (line 297) | class DreamBoothDataset(Dataset): method __init__ (line 303) | def __init__( method __len__ (line 350) | def __len__(self): method __getitem__ (line 353) | def __getitem__(self, index): class PromptDataset (line 387) | class PromptDataset(Dataset): method __init__ (line 390) | def __init__(self, prompt, num_samples): method __len__ (line 394) | def __len__(self): method __getitem__ (line 397) | def __getitem__(self, index): function main (line 404) | def main(): FILE: examples/research_projects/dreambooth_inpaint/train_dreambooth_inpaint_lora.py function prepare_mask_and_masked_image (line 36) | def prepare_mask_and_masked_image(image, mask): function random_mask (line 54) | def random_mask(im_shape, ratio=1, mask_full_image=False): function parse_args (line 78) | def parse_args(): class DreamBoothDataset (line 296) | class DreamBoothDataset(Dataset): method __init__ (line 302) | def __init__( method __len__ (line 349) | def __len__(self): method __getitem__ (line 352) | def __getitem__(self, index): class PromptDataset (line 386) | class PromptDataset(Dataset): method __init__ (line 389) | def __init__(self, prompt, num_samples): method __len__ (line 393) | def __len__(self): method __getitem__ (line 396) | def __getitem__(self, index): function main (line 403) | def main(): FILE: examples/research_projects/flux_lora_quantization/compute_embeddings.py function generate_image_hash (line 33) | def generate_image_hash(image): function load_flux_dev_pipeline (line 37) | def load_flux_dev_pipeline(): function compute_embeddings (line 47) | def compute_embeddings(pipeline, prompts, max_sequence_length): function run (line 66) | def run(args): FILE: examples/research_projects/flux_lora_quantization/train_dreambooth_lora_flux_miniature.py function save_model_card (line 78) | def save_model_card( function parse_args (line 147) | def parse_args(input_args=None): class DreamBoothDataset (line 462) | class DreamBoothDataset(Dataset): method __init__ (line 463) | def __init__( method __len__ (line 498) | def __len__(self): method __getitem__ (line 501) | def __getitem__(self, index): method apply_image_transformations (line 512) | def apply_image_transformations(self, instance_images, size, center_cr... method convert_to_torch_tensor (line 544) | def convert_to_torch_tensor(self, embeddings: list): method map_image_hash_embedding (line 553) | def map_image_hash_embedding(self, data_df_path): method generate_image_hash (line 562) | def generate_image_hash(self, image): function collate_fn (line 566) | def collate_fn(examples): function main (line 587) | def main(args): FILE: examples/research_projects/gligen/dataset.py function recalculate_box_and_verify_if_valid (line 9) | def recalculate_box_and_verify_if_valid(x, y, w, h, image_size, original... class COCODataset (line 22) | class COCODataset(torch.utils.data.Dataset): method __init__ (line 23) | def __init__( method __getitem__ (line 49) | def __getitem__(self, index): method __len__ (line 109) | def __len__(self): FILE: examples/research_projects/gligen/train_gligen_text.py function log_validation (line 46) | def log_validation(vae, text_encoder, tokenizer, unet, noise_scheduler, ... function parse_args (line 98) | def parse_args(input_args=None): function main (line 282) | def main(args): FILE: examples/research_projects/instructpix2pix_lora/train_instruct_pix2pix_lora.py function save_model_card (line 78) | def save_model_card( function log_validation (line 120) | def log_validation( function parse_args (line 164) | def parse_args(): function convert_to_np (line 473) | def convert_to_np(image, resolution): function download_image (line 478) | def download_image(url): function main (line 485) | def main(): FILE: examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py function save_progress (line 59) | def save_progress(text_encoder, placeholder_token_id, accelerator, args,... function parse_args (line 66) | def parse_args(): class TextualInversionDataset (line 272) | class TextualInversionDataset(Dataset): method __init__ (line 273) | def __init__( method __len__ (line 312) | def __len__(self): method __getitem__ (line 315) | def __getitem__(self, i): function freeze_params (line 358) | def freeze_params(params): function main (line 363) | def main(): FILE: examples/research_projects/intel_opts/textual_inversion_dfq/text2images.py function parse_args (line 13) | def parse_args(): function image_grid (line 55) | def image_grid(imgs, rows, cols): function generate_images (line 68) | def generate_images( FILE: examples/research_projects/intel_opts/textual_inversion_dfq/textual_inversion.py function save_progress (line 49) | def save_progress(text_encoder, placeholder_token_id, accelerator, args,... function parse_args (line 56) | def parse_args(): class EMAModel (line 270) | class EMAModel: method __init__ (line 275) | def __init__(self, parameters: Iterable[torch.nn.Parameter], decay=0.9... method get_decay (line 282) | def get_decay(self, optimization_step): method step (line 290) | def step(self, parameters): method copy_to (line 305) | def copy_to(self, parameters: Iterable[torch.nn.Parameter]) -> None: method to (line 318) | def to(self, device=None, dtype=None) -> None: class TextualInversionDataset (line 330) | class TextualInversionDataset(Dataset): method __init__ (line 331) | def __init__( method __len__ (line 370) | def __len__(self): method __getitem__ (line 373) | def __getitem__(self, i): function freeze_params (line 416) | def freeze_params(params): function generate_images (line 421) | def generate_images(pipeline, prompt="", guidance_scale=7.5, num_inferen... function main (line 435) | def main(): FILE: examples/research_projects/ip_adapter/tutorial_train_faceid.py class MyDataset (line 23) | class MyDataset(torch.utils.data.Dataset): method __init__ (line 24) | def __init__( method __getitem__ (line 49) | def __getitem__(self, idx): method __len__ (line 89) | def __len__(self): function collate_fn (line 93) | def collate_fn(data): class IPAdapter (line 107) | class IPAdapter(torch.nn.Module): method __init__ (line 110) | def __init__(self, unet, image_proj_model, adapter_modules, ckpt_path=... method forward (line 119) | def forward(self, noisy_latents, timesteps, encoder_hidden_states, ima... method load_from_checkpoint (line 126) | def load_from_checkpoint(self, ckpt_path: str): function parse_args (line 148) | def parse_args(): function main (line 260) | def main(): FILE: examples/research_projects/ip_adapter/tutorial_train_ip-adapter.py class MyDataset (line 30) | class MyDataset(torch.utils.data.Dataset): method __init__ (line 31) | def __init__( method __getitem__ (line 55) | def __getitem__(self, idx): method __len__ (line 91) | def __len__(self): function collate_fn (line 95) | def collate_fn(data): class IPAdapter (line 109) | class IPAdapter(torch.nn.Module): method __init__ (line 112) | def __init__(self, unet, image_proj_model, adapter_modules, ckpt_path=... method forward (line 121) | def forward(self, noisy_latents, timesteps, encoder_hidden_states, ima... method load_from_checkpoint (line 128) | def load_from_checkpoint(self, ckpt_path: str): function parse_args (line 150) | def parse_args(): function main (line 262) | def main(): FILE: examples/research_projects/ip_adapter/tutorial_train_plus.py class MyDataset (line 30) | class MyDataset(torch.utils.data.Dataset): method __init__ (line 31) | def __init__( method __getitem__ (line 55) | def __getitem__(self, idx): method __len__ (line 91) | def __len__(self): function collate_fn (line 95) | def collate_fn(data): class IPAdapter (line 109) | class IPAdapter(torch.nn.Module): method __init__ (line 112) | def __init__(self, unet, image_proj_model, adapter_modules, ckpt_path=... method forward (line 121) | def forward(self, noisy_latents, timesteps, encoder_hidden_states, ima... method load_from_checkpoint (line 128) | def load_from_checkpoint(self, ckpt_path: str): function parse_args (line 160) | def parse_args(): function main (line 278) | def main(): FILE: examples/research_projects/ip_adapter/tutorial_train_sdxl.py class MyDataset (line 37) | class MyDataset(torch.utils.data.Dataset): method __init__ (line 38) | def __init__( method __getitem__ (line 73) | def __getitem__(self, idx): method __len__ (line 141) | def __len__(self): function collate_fn (line 145) | def collate_fn(data): class IPAdapter (line 167) | class IPAdapter(torch.nn.Module): method __init__ (line 170) | def __init__(self, unet, image_proj_model, adapter_modules, ckpt_path=... method forward (line 179) | def forward(self, noisy_latents, timesteps, encoder_hidden_states, une... method load_from_checkpoint (line 188) | def load_from_checkpoint(self, ckpt_path: str): function parse_args (line 210) | def parse_args(): function main (line 323) | def main(): FILE: examples/research_projects/lora/train_text_to_image_lora.py function save_model_card (line 57) | def save_model_card(repo_id: str, images=None, base_model=str, dataset_n... function parse_args (line 86) | def parse_args(): function main (line 394) | def main(): FILE: examples/research_projects/lpl/lpl_loss.py function normalize_tensor (line 9) | def normalize_tensor(in_feat, eps=1e-10): function cross_normalize (line 14) | def cross_normalize(input, target, eps=1e-10): function remove_outliers (line 19) | def remove_outliers(feat, down_f=1, opening=5, closing=3, m=100, quant=0... class LatentPerceptualLoss (line 43) | class LatentPerceptualLoss(nn.Module): method __init__ (line 44) | def __init__( method get_features (line 88) | def get_features(self, z, latent_embeds=None, disable_grads=False): method get_loss (line 140) | def get_loss(self, input, target, get_hist=False): method get_first_conv (line 192) | def get_first_conv(self, z): method get_first_block (line 196) | def get_first_block(self, z): method get_first_layer (line 203) | def get_first_layer(self, input, target, target_layer="conv"): FILE: examples/research_projects/lpl/train_sdxl_lpl.py function get_intermediate_features_hook (line 78) | def get_intermediate_features_hook(name: str): function clear_hook_features (line 92) | def clear_hook_features(): function normalize_features (line 98) | def normalize_features( function get_decoder_layer_names (line 115) | def get_decoder_layer_names(decoder: nn.Module) -> List[str]: function save_model_card (line 137) | def save_model_card( function import_model_class_from_model_name_or_path (line 182) | def import_model_class_from_model_name_or_path( function parse_args (line 202) | def parse_args(input_args=None): function encode_prompt (line 618) | def encode_prompt(batch, text_encoders, tokenizers, proportion_empty_pro... function compute_vae_encodings (line 660) | def compute_vae_encodings(batch, vae): function generate_timestep_weights (line 675) | def generate_timestep_weights(args, num_timesteps): function main (line 716) | def main(args): FILE: examples/research_projects/multi_subject_dreambooth/train_multi_subject_dreambooth.py function log_validation_images_to_tracker (line 54) | def log_validation_images_to_tracker( function generate_validation_images (line 76) | def generate_validation_images( function import_model_class_from_model_name_or_path (line 159) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function parse_args (line 179) | def parse_args(input_args=None): class DreamBoothDataset (line 545) | class DreamBoothDataset(Dataset): method __init__ (line 551) | def __init__( method __len__ (line 604) | def __len__(self): method __getitem__ (line 607) | def __getitem__(self, index): function collate_fn (line 639) | def collate_fn(num_instances, examples, with_prior_preservation=False): class PromptDataset (line 666) | class PromptDataset(Dataset): method __init__ (line 669) | def __init__(self, prompt, num_samples): method __len__ (line 673) | def __len__(self): method __getitem__ (line 676) | def __getitem__(self, index): function main (line 683) | def main(args): FILE: examples/research_projects/multi_subject_dreambooth_inpainting/train_multi_subject_dreambooth_inpainting.py function parse_args (line 43) | def parse_args(): function prepare_mask_and_masked_image (line 205) | def prepare_mask_and_masked_image(image, mask): class DreamBoothDataset (line 222) | class DreamBoothDataset(Dataset): method __init__ (line 223) | def __init__( method set_image (line 241) | def set_image(self, img, switch): method __len__ (line 252) | def __len__(self): method __getitem__ (line 255) | def __getitem__(self, index): function weighted_mask (line 289) | def weighted_mask(masks): function collate_fn (line 309) | def collate_fn(examples, tokenizer): function log_validation (line 335) | def log_validation(pipeline, text_encoder, unet, val_pairs, accelerator): function checkpoint (line 348) | def checkpoint(args, global_step, accelerator): function main (line 354) | def main(): FILE: examples/research_projects/multi_token_textual_inversion/multi_token_clip.py class MultiTokenCLIPTokenizer (line 33) | class MultiTokenCLIPTokenizer(CLIPTokenizer): method __init__ (line 34) | def __init__(self, *args, **kwargs): method try_adding_tokens (line 38) | def try_adding_tokens(self, placeholder_token, *args, **kwargs): method add_placeholder_tokens (line 46) | def add_placeholder_tokens(self, placeholder_token, *args, num_vec_per... method replace_placeholder_tokens_in_text (line 66) | def replace_placeholder_tokens_in_text(self, text, vector_shuffle=Fals... method __call__ (line 88) | def __call__(self, text, *args, vector_shuffle=False, prop_tokens_to_l... method encode (line 97) | def encode(self, text, *args, vector_shuffle=False, prop_tokens_to_loa... FILE: examples/research_projects/multi_token_textual_inversion/textual_inversion.py function add_tokens (line 83) | def add_tokens(tokenizer, text_encoder, placeholder_token, num_vec_per_t... function save_progress (line 101) | def save_progress(tokenizer, text_encoder, accelerator, save_path): function load_multitoken_tokenizer (line 111) | def load_multitoken_tokenizer(tokenizer, text_encoder, learned_embeds_di... function load_multitoken_tokenizer_from_automatic (line 123) | def load_multitoken_tokenizer_from_automatic(tokenizer, text_encoder, au... function get_mask (line 137) | def get_mask(tokenizer, accelerator): function parse_args (line 147) | def parse_args(): class TextualInversionDataset (line 457) | class TextualInversionDataset(Dataset): method __init__ (line 458) | def __init__( method __len__ (line 502) | def __len__(self): method __getitem__ (line 505) | def __getitem__(self, i): function main (line 550) | def main(): FILE: examples/research_projects/multi_token_textual_inversion/textual_inversion_flax.py function parse_args (line 64) | def parse_args(): class TextualInversionDataset (line 242) | class TextualInversionDataset(Dataset): method __init__ (line 243) | def __init__( method __len__ (line 282) | def __len__(self): method __getitem__ (line 285) | def __getitem__(self, i): function resize_token_embeddings (line 328) | def resize_token_embeddings(model, new_num_tokens, initializer_token_id,... function get_params_to_save (line 348) | def get_params_to_save(params): function main (line 352) | def main(): FILE: examples/research_projects/onnxruntime/text_to_image/train_text_to_image.py function log_validation (line 67) | def log_validation(vae, text_encoder, tokenizer, unet, args, accelerator... function parse_args (line 118) | def parse_args(): function main (line 413) | def main(): FILE: examples/research_projects/onnxruntime/textual_inversion/textual_inversion.py function save_model_card (line 88) | def save_model_card(repo_id: str, images=None, base_model=str, repo_fold... function log_validation (line 118) | def log_validation(text_encoder, tokenizer, unet, vae, args, accelerator... function save_progress (line 164) | def save_progress(text_encoder, placeholder_token_ids, accelerator, args... function parse_args (line 175) | def parse_args(): class TextualInversionDataset (line 479) | class TextualInversionDataset(Dataset): method __init__ (line 480) | def __init__( method __len__ (line 519) | def __len__(self): method __getitem__ (line 522) | def __getitem__(self, i): function main (line 565) | def main(): FILE: examples/research_projects/onnxruntime/unconditional_image_generation/train_unconditional.py function _extract_into_tensor (line 37) | def _extract_into_tensor(arr, timesteps, broadcast_shape): function parse_args (line 55) | def parse_args(): function main (line 279) | def main(args): FILE: examples/research_projects/pixart/controlnet_pixart_alpha.py class PixArtControlNetAdapterBlock (line 13) | class PixArtControlNetAdapterBlock(nn.Module): method __init__ (line 14) | def __init__( method train (line 62) | def train(self, mode: bool = True): method forward (line 70) | def forward( class PixArtControlNetAdapterModel (line 101) | class PixArtControlNetAdapterModel(ModelMixin, ConfigMixin): method __init__ (line 104) | def __init__(self, num_layers=13) -> None: method from_transformer (line 114) | def from_transformer(cls, transformer: PixArtTransformer2DModel): method train (line 125) | def train(self, mode: bool = True): class PixArtControlNetTransformerModel (line 130) | class PixArtControlNetTransformerModel(ModelMixin, ConfigMixin): method __init__ (line 131) | def __init__( method forward (line 153) | def forward( FILE: examples/research_projects/pixart/pipeline_pixart_alpha_controlnet.py function get_closest_hw (line 175) | def get_closest_hw(width, height, image_size): function retrieve_timesteps (line 189) | def retrieve_timesteps( class PixArtAlphaControlnetPipeline (line 248) | class PixArtAlphaControlnetPipeline(DiffusionPipeline): method __init__ (line 290) | def __init__( method encode_prompt (line 318) | def encode_prompt( method prepare_extra_step_kwargs (line 461) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 478) | def check_inputs( method check_image (line 550) | def check_image(self, image, prompt, prompt_embeds): method _text_preprocessing (line 588) | def _text_preprocessing(self, text, clean_caption=False): method _clean_caption (line 613) | def _clean_caption(self, caption): method prepare_image (line 727) | def prepare_image( method prepare_image_latents (line 757) | def prepare_image_latents(self, image, device, dtype): method prepare_latents (line 765) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method __call__ (line 789) | def __call__( FILE: examples/research_projects/pixart/train_pixart_controlnet_hf.py function log_validation (line 69) | def log_validation( function save_model_card (line 202) | def save_model_card(repo_id: str, image_logs=None, base_model=str, datas... function parse_args (line 245) | def parse_args(): function main (line 559) | def main(): FILE: examples/research_projects/promptdiffusion/convert_original_promptdiffusion_to_diffusers.py function shave_segments (line 72) | def shave_segments(path, n_shave_prefix_segments=1): function renew_resnet_paths (line 82) | def renew_resnet_paths(old_list, n_shave_prefix_segments=0): function renew_vae_resnet_paths (line 104) | def renew_vae_resnet_paths(old_list, n_shave_prefix_segments=0): function renew_attention_paths (line 120) | def renew_attention_paths(old_list, n_shave_prefix_segments=0): function renew_vae_attention_paths (line 141) | def renew_vae_attention_paths(old_list, n_shave_prefix_segments=0): function assign_to_checkpoint (line 171) | def assign_to_checkpoint( function conv_attn_to_linear (line 226) | def conv_attn_to_linear(checkpoint): function create_unet_diffusers_config (line 238) | def create_unet_diffusers_config(original_config, image_size: int, contr... function create_vae_diffusers_config (line 347) | def create_vae_diffusers_config(original_config, image_size: int): function create_diffusers_schedular (line 371) | def create_diffusers_schedular(original_config): function create_ldm_bert_config (line 381) | def create_ldm_bert_config(original_config): function convert_ldm_unet_checkpoint (line 391) | def convert_ldm_unet_checkpoint( function convert_ldm_vae_checkpoint (line 705) | def convert_ldm_vae_checkpoint(checkpoint, config): function convert_ldm_bert_checkpoint (line 812) | def convert_ldm_bert_checkpoint(checkpoint, config): function convert_ldm_clip_checkpoint (line 862) | def convert_ldm_clip_checkpoint(checkpoint, local_files_only=False, text... function convert_paint_by_example_checkpoint (line 926) | def convert_paint_by_example_checkpoint(checkpoint, local_files_only=Fal... function convert_open_clip_checkpoint (line 993) | def convert_open_clip_checkpoint( function stable_unclip_image_encoder (line 1075) | def stable_unclip_image_encoder(original_config, local_files_only=False): function stable_unclip_image_noising_components (line 1112) | def stable_unclip_image_noising_components( function convert_controlnet_checkpoint (line 1157) | def convert_controlnet_checkpoint( function convert_promptdiffusion_checkpoint (line 1207) | def convert_promptdiffusion_checkpoint( function download_from_original_stable_diffusion_ckpt (line 1258) | def download_from_original_stable_diffusion_ckpt( function download_controlnet_from_original_ckpt (line 1927) | def download_controlnet_from_original_ckpt( function download_promptdiffusion_from_original_ckpt (line 1980) | def download_promptdiffusion_from_original_ckpt( function parse_bool (line 2090) | def parse_bool(string): FILE: examples/research_projects/promptdiffusion/pipeline_prompt_diffusion.py function retrieve_timesteps (line 101) | def retrieve_timesteps( class PromptDiffusionPipeline (line 145) | class PromptDiffusionPipeline( method __init__ (line 191) | def __init__( method enable_vae_slicing (line 244) | def enable_vae_slicing(self): method disable_vae_slicing (line 252) | def disable_vae_slicing(self): method enable_vae_tiling (line 260) | def enable_vae_tiling(self): method disable_vae_tiling (line 275) | def disable_vae_tiling(self): method _encode_prompt (line 289) | def _encode_prompt( method encode_prompt (line 322) | def encode_prompt( method encode_image (line 504) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method run_safety_checker (line 529) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 544) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 556) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 573) | def check_inputs( method check_image (line 735) | def check_image(self, image, prompt, prompt_embeds): method prepare_image (line 773) | def prepare_image( method prepare_latents (line 804) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method enable_freeu (line 827) | def enable_freeu(self, s1: float, s2: float, b1: float, b2: float): method disable_freeu (line 850) | def disable_freeu(self): method get_guidance_scale_embedding (line 855) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 884) | def guidance_scale(self): method clip_skip (line 888) | def clip_skip(self): method do_classifier_free_guidance (line 895) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 899) | def cross_attention_kwargs(self): method num_timesteps (line 903) | def num_timesteps(self): method __call__ (line 908) | def __call__( FILE: examples/research_projects/promptdiffusion/promptdiffusioncontrolnet.py class PromptDiffusionControlNetModel (line 30) | class PromptDiffusionControlNetModel(ControlNetModel): method __init__ (line 102) | def __init__( method forward (line 182) | def forward( FILE: examples/research_projects/pytorch_xla/inference/flux/flux_inference.py function _main (line 21) | def _main(index, args, text_pipe, ckpt_id): FILE: examples/research_projects/pytorch_xla/training/text_to_image/train_text_to_image_xla.py function save_model_card (line 46) | def save_model_card( class TrainSD (line 114) | class TrainSD: method __init__ (line 115) | def __init__( method run_optimizer (line 139) | def run_optimizer(self): method start_training (line 142) | def start_training(self): method step_fn (line 181) | def step_fn( function parse_args (line 238) | def parse_args(): function setup_optimizer (line 425) | def setup_optimizer(unet, args): function load_dataset (line 437) | def load_dataset(args): function get_column_names (line 457) | def get_column_names(dataset, args): function main (line 480) | def main(args): FILE: examples/research_projects/rdm/pipeline_rdm.py class RDMPipeline (line 30) | class RDMPipeline(DiffusionPipeline, StableDiffusionMixin): method __init__ (line 54) | def __init__( method _encode_prompt (line 85) | def _encode_prompt(self, prompt): method _encode_image (line 108) | def _encode_image(self, retrieved_images, batch_size): method prepare_latents (line 125) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method retrieve_images (line 147) | def retrieve_images(self, retrieved_images, prompt_embeds, knn=10): method __call__ (line 155) | def __call__( FILE: examples/research_projects/rdm/retriever.py function normalize_images (line 17) | def normalize_images(images: List[Image.Image]): function preprocess_images (line 23) | def preprocess_images(images: List[np.array], feature_extractor: CLIPIma... class IndexConfig (line 40) | class IndexConfig(PretrainedConfig): method __init__ (line 41) | def __init__( class Index (line 64) | class Index: method __init__ (line 69) | def __init__(self, config: IndexConfig, dataset: Dataset): method set_index_name (line 77) | def set_index_name(self, index_name: str): method init_index (line 80) | def init_index(self): method build_index (line 95) | def build_index( method retrieve_imgs (line 113) | def retrieve_imgs(self, vec, k: int = 20): method retrieve_imgs_batch (line 117) | def retrieve_imgs_batch(self, vec, k: int = 20): method retrieve_indices (line 121) | def retrieve_indices(self, vec, k: int = 20): method retrieve_indices_batch (line 125) | def retrieve_indices_batch(self, vec, k: int = 20): class Retriever (line 130) | class Retriever: method __init__ (line 131) | def __init__( method from_pretrained (line 143) | def from_pretrained( method _build_index (line 156) | def _build_index( method save_pretrained (line 165) | def save_pretrained(self, save_directory): method init_retrieval (line 173) | def init_retrieval(self): method retrieve_imgs (line 177) | def retrieve_imgs(self, embeddings: np.ndarray, k: int): method retrieve_imgs_batch (line 180) | def retrieve_imgs_batch(self, embeddings: np.ndarray, k: int): method retrieve_indices (line 183) | def retrieve_indices(self, embeddings: np.ndarray, k: int): method retrieve_indices_batch (line 186) | def retrieve_indices_batch(self, embeddings: np.ndarray, k: int): method __call__ (line 189) | def __call__( function map_txt_to_clip_feature (line 197) | def map_txt_to_clip_feature(clip_model, tokenizer, prompt): function map_img_to_model_feature (line 219) | def map_img_to_model_feature(model, feature_extractor, imgs, device): function get_dataset_with_emb_from_model (line 231) | def get_dataset_with_emb_from_model(dataset, model, feature_extractor, i... function get_dataset_with_emb_from_clip_model (line 239) | def get_dataset_with_emb_from_clip_model( FILE: examples/research_projects/realfill/train_realfill.py function make_mask (line 51) | def make_mask(images, resolution, times=30): function save_model_card (line 68) | def save_model_card( function log_validation (line 105) | def log_validation( function parse_args (line 168) | def parse_args(input_args=None): class RealFillDataset (line 426) | class RealFillDataset(Dataset): method __init__ (line 433) | def __init__( method __len__ (line 462) | def __len__(self): method __getitem__ (line 465) | def __getitem__(self, index): function collate_fn (line 502) | def collate_fn(examples): function main (line 534) | def main(args): FILE: examples/research_projects/sana/train_sana_sprint_diffusers.py class SanaVanillaAttnProcessor (line 92) | class SanaVanillaAttnProcessor: method __init__ (line 97) | def __init__(self): method scaled_dot_product_attention (line 101) | def scaled_dot_product_attention( method __call__ (line 119) | def __call__( class Text2ImageDataset (line 175) | class Text2ImageDataset(Dataset): method __init__ (line 189) | def __init__(self, hf_dataset, resolution=1024): method __len__ (line 201) | def __len__(self): method __getitem__ (line 204) | def __getitem__(self, idx): function save_model_card (line 217) | def save_model_card( function log_validation (line 267) | def log_validation( function parse_args (line 312) | def parse_args(input_args=None): class ResidualBlock (line 697) | class ResidualBlock(nn.Module): method __init__ (line 698) | def __init__(self, fn: Callable): method forward (line 702) | def forward(self, x: torch.Tensor) -> torch.Tensor: class SpectralConv1d (line 706) | class SpectralConv1d(nn.Conv1d): method __init__ (line 707) | def __init__(self, *args, **kwargs): class BatchNormLocal (line 712) | class BatchNormLocal(nn.Module): method __init__ (line 713) | def __init__(self, num_features: int, affine: bool = True, virtual_bs:... method forward (line 723) | def forward(self, x: torch.Tensor) -> torch.Tensor: function make_block (line 741) | def make_block(channels: int, kernel_size: int) -> nn.Module: class DiscHead (line 756) | class DiscHead(nn.Module): method __init__ (line 757) | def __init__(self, channels: int, c_dim: int, cmap_dim: int = 64): method forward (line 773) | def forward(self, x: torch.Tensor, c: torch.Tensor) -> torch.Tensor: class SanaMSCMDiscriminator (line 784) | class SanaMSCMDiscriminator(nn.Module): method __init__ (line 785) | def __init__(self, pretrained_model, is_multiscale=False, head_block_i... method get_head_inputs (line 800) | def get_head_inputs(self): method forward (line 803) | def forward(self, hidden_states, timestep, encoder_hidden_states=None,... method model (line 839) | def model(self): method save_pretrained (line 842) | def save_pretrained(self, path): class DiscHeadModel (line 846) | class DiscHeadModel: method __init__ (line 847) | def __init__(self, disc): method state_dict (line 850) | def state_dict(self): method __getattr__ (line 853) | def __getattr__(self, name): class SanaTrigFlow (line 857) | class SanaTrigFlow(SanaTransformer2DModel): method __init__ (line 858) | def __init__(self, original_model, guidance=False): method forward (line 868) | def forward( function compute_density_for_timestep_sampling_scm (line 931) | def compute_density_for_timestep_sampling_scm(batch_size: int, logit_mea... function main (line 940) | def main(args): FILE: examples/research_projects/scheduled_huber_loss_training/dreambooth/train_dreambooth.py function save_model_card (line 72) | def save_model_card( function log_validation (line 116) | def log_validation( function import_model_class_from_model_name_or_path (line 208) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function parse_args (line 232) | def parse_args(input_args=None): class DreamBoothDataset (line 631) | class DreamBoothDataset(Dataset): method __init__ (line 637) | def __init__( method __len__ (line 689) | def __len__(self): method __getitem__ (line 692) | def __getitem__(self, index): function collate_fn (line 730) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 765) | class PromptDataset(Dataset): method __init__ (line 768) | def __init__(self, prompt, num_samples): method __len__ (line 772) | def __len__(self): method __getitem__ (line 775) | def __getitem__(self, index): function model_has_vae (line 782) | def model_has_vae(args): function tokenize_prompt (line 792) | def tokenize_prompt(tokenizer, prompt, tokenizer_max_length=None): function encode_prompt (line 809) | def encode_prompt(text_encoder, input_ids, attention_mask, text_encoder_... function conditional_loss (line 828) | def conditional_loss( function main (line 854) | def main(args): FILE: examples/research_projects/scheduled_huber_loss_training/dreambooth/train_dreambooth_lora.py function save_model_card (line 79) | def save_model_card( function log_validation (line 120) | def log_validation( function import_model_class_from_model_name_or_path (line 185) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function parse_args (line 209) | def parse_args(input_args=None): class DreamBoothDataset (line 571) | class DreamBoothDataset(Dataset): method __init__ (line 577) | def __init__( method __len__ (line 629) | def __len__(self): method __getitem__ (line 632) | def __getitem__(self, index): function collate_fn (line 670) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 703) | class PromptDataset(Dataset): method __init__ (line 706) | def __init__(self, prompt, num_samples): method __len__ (line 710) | def __len__(self): method __getitem__ (line 713) | def __getitem__(self, index): function tokenize_prompt (line 720) | def tokenize_prompt(tokenizer, prompt, tokenizer_max_length=None): function encode_prompt (line 737) | def encode_prompt(text_encoder, input_ids, attention_mask, text_encoder_... function conditional_loss (line 756) | def conditional_loss( function main (line 782) | def main(args): FILE: examples/research_projects/scheduled_huber_loss_training/dreambooth/train_dreambooth_lora_sdxl.py function determine_scheduler_type (line 88) | def determine_scheduler_type(pretrained_model_name_or_path, revision): function save_model_card (line 102) | def save_model_card( function log_validation (line 179) | def log_validation( function import_model_class_from_model_name_or_path (line 240) | def import_model_class_from_model_name_or_path( function parse_args (line 260) | def parse_args(input_args=None): class DreamBoothDataset (line 720) | class DreamBoothDataset(Dataset): method __init__ (line 726) | def __init__( method __len__ (line 865) | def __len__(self): method __getitem__ (line 868) | def __getitem__(self, index): function collate_fn (line 899) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 925) | class PromptDataset(Dataset): method __init__ (line 928) | def __init__(self, prompt, num_samples): method __len__ (line 932) | def __len__(self): method __getitem__ (line 935) | def __getitem__(self, index): function tokenize_prompt (line 942) | def tokenize_prompt(tokenizer, prompt): function encode_prompt (line 955) | def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list... function conditional_loss (line 983) | def conditional_loss( function main (line 1054) | def main(args): FILE: examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image.py function save_model_card (line 68) | def save_model_card( function log_validation (line 140) | def log_validation(vae, text_encoder, tokenizer, unet, args, accelerator... function parse_args (line 194) | def parse_args(): function conditional_loss (line 518) | def conditional_loss( function main (line 544) | def main(): FILE: examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_lora.py function save_model_card (line 60) | def save_model_card( function parse_args (line 101) | def parse_args(): function conditional_loss (line 414) | def conditional_loss( function main (line 440) | def main(): FILE: examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_lora_sdxl.py function save_model_card (line 72) | def save_model_card( function import_model_class_from_model_name_or_path (line 119) | def import_model_class_from_model_name_or_path( function parse_args (line 139) | def parse_args(input_args=None): function tokenize_prompt (line 475) | def tokenize_prompt(tokenizer, prompt): function encode_prompt (line 488) | def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list... function conditional_loss (line 516) | def conditional_loss( function main (line 536) | def main(args): FILE: examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_sdxl.py function save_model_card (line 67) | def save_model_card( function import_model_class_from_model_name_or_path (line 112) | def import_model_class_from_model_name_or_path( function parse_args (line 132) | def parse_args(input_args=None): function encode_prompt (line 507) | def encode_prompt(batch, text_encoders, tokenizers, proportion_empty_pro... function compute_vae_encodings (line 549) | def compute_vae_encodings(batch, vae): function generate_timestep_weights (line 561) | def generate_timestep_weights(args, num_timesteps): function conditional_loss (line 603) | def conditional_loss( function main (line 629) | def main(args): FILE: examples/research_projects/sd3_lora_colab/compute_embeddings.py function bytes_to_giga_bytes (line 34) | def bytes_to_giga_bytes(bytes): function generate_image_hash (line 38) | def generate_image_hash(image_path): function load_sd3_pipeline (line 44) | def load_sd3_pipeline(): function compute_embeddings (line 54) | def compute_embeddings(pipeline, prompt, max_sequence_length): function run (line 71) | def run(args): FILE: examples/research_projects/sd3_lora_colab/train_dreambooth_lora_sd3_miniature.py function save_model_card (line 78) | def save_model_card( function log_validation (line 143) | def log_validation( function parse_args (line 187) | def parse_args(input_args=None): class DreamBoothDataset (line 497) | class DreamBoothDataset(Dataset): method __init__ (line 503) | def __init__( method __len__ (line 537) | def __len__(self): method __getitem__ (line 540) | def __getitem__(self, index): method apply_image_transformations (line 550) | def apply_image_transformations(self, instance_images, size, center_cr... method convert_to_torch_tensor (line 582) | def convert_to_torch_tensor(self, embeddings: list): method map_image_hash_embedding (line 589) | def map_image_hash_embedding(self, data_df_path): method generate_image_hash (line 598) | def generate_image_hash(self, image_path): function collate_fn (line 604) | def collate_fn(examples): function main (line 622) | def main(args): FILE: examples/research_projects/sdxl_flax/sdxl_single.py function tokenize_prompt (line 44) | def tokenize_prompt(prompt, neg_prompt): function replicate_all (line 58) | def replicate_all(prompt_ids, neg_prompt_ids, seed): function generate (line 67) | def generate( FILE: examples/research_projects/sdxl_flax/sdxl_single_aot.py function tokenize_prompt (line 46) | def tokenize_prompt(prompt, neg_prompt): function replicate_all (line 60) | def replicate_all(prompt_ids, neg_prompt_ids, seed): function aot_compile (line 74) | def aot_compile( function generate (line 111) | def generate(prompt, negative_prompt, seed=default_seed, guidance_scale=... FILE: examples/research_projects/vae/vae_roundtrip.py function load_vae_model (line 40) | def load_vae_model( function pil_to_nhwc (line 76) | def pil_to_nhwc( function nhwc_to_pil (line 88) | def nhwc_to_pil( function concatenate_images (line 97) | def concatenate_images( function to_latent (line 120) | def to_latent( function from_latent (line 142) | def from_latent( function main_kwargs (line 154) | def main_kwargs( function parse_args (line 194) | def parse_args() -> argparse.Namespace: function main_cli (line 245) | def main_cli() -> None: FILE: examples/research_projects/wuerstchen/text_to_image/modeling_efficient_net_encoder.py class EfficientNetEncoder (line 8) | class EfficientNetEncoder(ModelMixin, ConfigMixin): method __init__ (line 10) | def __init__(self, c_latent=16, c_cond=1280, effnet="efficientnet_v2_s"): method forward (line 22) | def forward(self, x): FILE: examples/research_projects/wuerstchen/text_to_image/train_text_to_image_lora_prior.py function save_model_card (line 63) | def save_model_card( function log_validation (line 144) | def log_validation(text_encoder, tokenizer, prior, args, accelerator, we... function parse_args (line 196) | def parse_args(): function main (line 445) | def main(): FILE: examples/research_projects/wuerstchen/text_to_image/train_text_to_image_prior.py function save_model_card (line 64) | def save_model_card( function log_validation (line 141) | def log_validation(text_encoder, tokenizer, prior, args, accelerator, we... function parse_args (line 194) | def parse_args(): function main (line 443) | def main(): FILE: examples/server-async/Pipelines.py class TextToImageInput (line 15) | class TextToImageInput(BaseModel): class PresetModels (line 23) | class PresetModels: class TextToImagePipelineSD3 (line 34) | class TextToImagePipelineSD3: method __init__ (line 35) | def __init__(self, model_path: str | None = None): method start (line 40) | def start(self): class ModelPipelineInitializer (line 61) | class ModelPipelineInitializer: method __init__ (line 62) | def __init__(self, model: str = "", type_models: str = "t2im"): method initialize_pipeline (line 69) | def initialize_pipeline(self): FILE: examples/server-async/serverasync.py class ServerConfigModels (line 23) | class ServerConfigModels: function lifespan (line 38) | async def lifespan(app: FastAPI): class JSONBodyQueryAPI (line 112) | class JSONBodyQueryAPI(BaseModel): function count_requests_middleware (line 121) | async def count_requests_middleware(request: Request, call_next): function root (line 129) | async def root(): function api (line 134) | async def api(json: JSONBodyQueryAPI): function serve_image (line 196) | async def serve_image(filename: str): function get_status (line 205) | async def get_status(): FILE: examples/server-async/test.py function save_from_url (line 16) | def save_from_url(url: str) -> str: function main (line 31) | def main(): FILE: examples/server-async/utils/requestscopedpipeline.py class RequestScopedPipeline (line 16) | class RequestScopedPipeline: method __init__ (line 27) | def __init__( method _detect_kernel_pipeline (line 60) | def _detect_kernel_pipeline(self, pipeline) -> bool: method _make_local_scheduler (line 71) | def _make_local_scheduler(self, num_inference_steps: int, device: str ... method _autodetect_mutables (line 103) | def _autodetect_mutables(self, max_attrs: int = 40): method _is_readonly_property (line 153) | def _is_readonly_property(self, base_obj, attr_name: str) -> bool: method _clone_mutable_attrs (line 165) | def _clone_mutable_attrs(self, base, local): method _is_tokenizer_component (line 216) | def _is_tokenizer_component(self, component) -> bool: method _should_wrap_tokenizers (line 231) | def _should_wrap_tokenizers(self) -> bool: method generate (line 234) | def generate(self, *args, num_inference_steps: int = 50, device: str |... FILE: examples/server-async/utils/scheduler.py class BaseAsyncScheduler (line 8) | class BaseAsyncScheduler: method __init__ (line 9) | def __init__(self, scheduler: Any): method __getattr__ (line 12) | def __getattr__(self, name: str): method __setattr__ (line 17) | def __setattr__(self, name: str, value): method clone_for_request (line 26) | def clone_for_request(self, num_inference_steps: int, device: Union[st... method __repr__ (line 32) | def __repr__(self): method __str__ (line 35) | def __str__(self): function async_retrieve_timesteps (line 39) | def async_retrieve_timesteps( FILE: examples/server-async/utils/utils.py class Utils (line 13) | class Utils: method __init__ (line 14) | def __init__(self, host: str = "0.0.0.0", port: int = 8500): method save_image (line 24) | def save_image(self, image): FILE: examples/server-async/utils/wrappers.py class ThreadSafeTokenizerWrapper (line 1) | class ThreadSafeTokenizerWrapper: method __init__ (line 2) | def __init__(self, tokenizer, lock): method __getattr__ (line 16) | def __getattr__(self, name): method __call__ (line 29) | def __call__(self, *args, **kwargs): method __setattr__ (line 33) | def __setattr__(self, name, value): method __dir__ (line 39) | def __dir__(self): class ThreadSafeVAEWrapper (line 43) | class ThreadSafeVAEWrapper: method __init__ (line 44) | def __init__(self, vae, lock): method __getattr__ (line 48) | def __getattr__(self, name): method __setattr__ (line 59) | def __setattr__(self, name, value): class ThreadSafeImageProcessorWrapper (line 66) | class ThreadSafeImageProcessorWrapper: method __init__ (line 67) | def __init__(self, proc, lock): method __getattr__ (line 71) | def __getattr__(self, name): method __setattr__ (line 82) | def __setattr__(self, name, value): FILE: examples/server/server.py class TextToImageInput (line 22) | class TextToImageInput(BaseModel): class HttpClient (line 29) | class HttpClient: method start (line 32) | def start(self): method stop (line 35) | async def stop(self): method __call__ (line 39) | def __call__(self) -> aiohttp.ClientSession: class TextToImagePipeline (line 44) | class TextToImagePipeline: method start (line 48) | def start(self): function startup (line 89) | def startup(): function save_image (line 94) | def save_image(image): function base (line 106) | async def base(): function generate_image (line 111) | async def generate_image(image_input: TextToImageInput): FILE: examples/t2i_adapter/test_t2i_adapter.py class T2IAdapter (line 33) | class T2IAdapter(ExamplesTestsAccelerate): method test_t2i_adapter_sdxl (line 34) | def test_t2i_adapter_sdxl(self): FILE: examples/t2i_adapter/train_t2i_adapter_sdxl.py function image_grid (line 69) | def image_grid(imgs, rows, cols): function log_validation (line 80) | def log_validation(vae, unet, adapter, args, accelerator, weight_dtype, ... function import_model_class_from_model_name_or_path (line 178) | def import_model_class_from_model_name_or_path( function save_model_card (line 198) | def save_model_card(repo_id: str, image_logs: dict = None, base_model: s... function parse_args (line 240) | def parse_args(input_args=None): function get_train_dataset (line 622) | def get_train_dataset(args, accelerator): function encode_prompt (line 687) | def encode_prompt(prompt_batch, text_encoders, tokenizers, proportion_em... function prepare_train_dataset (line 727) | def prepare_train_dataset(dataset, accelerator): function collate_fn (line 763) | def collate_fn(examples): function main (line 783) | def main(args): FILE: examples/test_examples_utils.py class SubprocessCallException (line 27) | class SubprocessCallException(Exception): function run_command (line 31) | def run_command(command: List[str], return_stdout=False): class ExamplesTestsAccelerate (line 48) | class ExamplesTestsAccelerate(unittest.TestCase): method setUpClass (line 50) | def setUpClass(cls): method tearDownClass (line 59) | def tearDownClass(cls): FILE: examples/text_to_image/test_text_to_image.py class TextToImage (line 37) | class TextToImage(ExamplesTestsAccelerate): method test_text_to_image (line 38) | def test_text_to_image(self): method test_text_to_image_checkpointing (line 62) | def test_text_to_image_checkpointing(self): method test_text_to_image_checkpointing_use_ema (line 144) | def test_text_to_image_checkpointing_use_ema(self): method test_text_to_image_checkpointing_checkpoints_total_limit (line 228) | def test_text_to_image_checkpointing_checkpoints_total_limit(self): method test_text_to_image_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 267) | def test_text_to_image_checkpointing_checkpoints_total_limit_removes_m... class TextToImageSDXL (line 342) | class TextToImageSDXL(ExamplesTestsAccelerate): method test_text_to_image_sdxl (line 343) | def test_text_to_image_sdxl(self): FILE: examples/text_to_image/test_text_to_image_lora.py class TextToImageLoRA (line 38) | class TextToImageLoRA(ExamplesTestsAccelerate): method test_text_to_image_lora_sdxl_checkpointing_checkpoints_total_limit (line 39) | def test_text_to_image_lora_sdxl_checkpointing_checkpoints_total_limit... method test_text_to_image_lora_checkpointing_checkpoints_total_limit (line 76) | def test_text_to_image_lora_checkpointing_checkpoints_total_limit(self): method test_text_to_image_lora_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 119) | def test_text_to_image_lora_checkpointing_checkpoints_total_limit_remo... class TextToImageLoRASDXL (line 202) | class TextToImageLoRASDXL(ExamplesTestsAccelerate): method test_text_to_image_lora_sdxl (line 203) | def test_text_to_image_lora_sdxl(self): method test_text_to_image_lora_sdxl_with_text_encoder (line 229) | def test_text_to_image_lora_sdxl_with_text_encoder(self): method test_text_to_image_lora_sdxl_text_encoder_checkpointing_checkpoints_total_limit (line 264) | def test_text_to_image_lora_sdxl_text_encoder_checkpointing_checkpoint... FILE: examples/text_to_image/train_text_to_image.py function save_model_card (line 69) | def save_model_card( function log_validation (line 141) | def log_validation(vae, text_encoder, tokenizer, unet, args, accelerator... function parse_args (line 200) | def parse_args(): function main (line 528) | def main(): FILE: examples/text_to_image/train_text_to_image_flax.py function parse_args (line 57) | def parse_args(): function get_params_to_save (line 257) | def get_params_to_save(params): function main (line 261) | def main(): FILE: examples/text_to_image/train_text_to_image_lora.py function save_model_card (line 69) | def save_model_card( function log_validation (line 110) | def log_validation( function parse_args (line 152) | def parse_args(): function main (line 453) | def main(): FILE: examples/text_to_image/train_text_to_image_lora_sdxl.py function save_model_card (line 78) | def save_model_card( function log_validation (line 125) | def log_validation( function import_model_class_from_model_name_or_path (line 166) | def import_model_class_from_model_name_or_path( function parse_args (line 186) | def parse_args(input_args=None): function tokenize_prompt (line 514) | def tokenize_prompt(tokenizer, prompt): function encode_prompt (line 527) | def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list... function main (line 554) | def main(args): FILE: examples/text_to_image/train_text_to_image_sdxl.py function save_model_card (line 71) | def save_model_card( function import_model_class_from_model_name_or_path (line 116) | def import_model_class_from_model_name_or_path( function parse_args (line 136) | def parse_args(input_args=None): function encode_prompt (line 502) | def encode_prompt(batch, text_encoders, tokenizers, proportion_empty_pro... function compute_vae_encodings (line 544) | def compute_vae_encodings(batch, vae): function generate_timestep_weights (line 559) | def generate_timestep_weights(args, num_timesteps): function main (line 600) | def main(args): FILE: examples/textual_inversion/test_textual_inversion.py class TextualInversion (line 33) | class TextualInversion(ExamplesTestsAccelerate): method test_textual_inversion (line 34) | def test_textual_inversion(self): method test_textual_inversion_checkpointing (line 60) | def test_textual_inversion_checkpointing(self): method test_textual_inversion_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 92) | def test_textual_inversion_checkpointing_checkpoints_total_limit_remov... FILE: examples/textual_inversion/test_textual_inversion_sdxl.py class TextualInversionSdxl (line 33) | class TextualInversionSdxl(ExamplesTestsAccelerate): method test_textual_inversion_sdxl (line 34) | def test_textual_inversion_sdxl(self): method test_textual_inversion_sdxl_checkpointing (line 60) | def test_textual_inversion_sdxl_checkpointing(self): method test_textual_inversion_sdxl_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 92) | def test_textual_inversion_sdxl_checkpointing_checkpoints_total_limit_... FILE: examples/textual_inversion/textual_inversion.py function save_model_card (line 90) | def save_model_card(repo_id: str, images: list = None, base_model: str =... function log_validation (line 123) | def log_validation(text_encoder, tokenizer, unet, vae, args, accelerator... function save_progress (line 175) | def save_progress(text_encoder, placeholder_token_ids, accelerator, args... function parse_args (line 190) | def parse_args(): class TextualInversionDataset (line 507) | class TextualInversionDataset(Dataset): method __init__ (line 508) | def __init__( method __len__ (line 547) | def __len__(self): method __getitem__ (line 550) | def __getitem__(self, i): function main (line 593) | def main(): FILE: examples/textual_inversion/textual_inversion_flax.py function parse_args (line 64) | def parse_args(): class TextualInversionDataset (line 255) | class TextualInversionDataset(Dataset): method __init__ (line 256) | def __init__( method __len__ (line 295) | def __len__(self): method __getitem__ (line 298) | def __getitem__(self, i): function resize_token_embeddings (line 341) | def resize_token_embeddings(model, new_num_tokens, initializer_token_id,... function get_params_to_save (line 361) | def get_params_to_save(params): function main (line 365) | def main(): FILE: examples/textual_inversion/textual_inversion_sdxl.py function save_model_card (line 85) | def save_model_card(repo_id: str, images=None, base_model=str, repo_fold... function log_validation (line 119) | def log_validation( function save_progress (line 179) | def save_progress(text_encoder, placeholder_token_ids, accelerator, args... function parse_args (line 194) | def parse_args(): class TextualInversionDataset (line 493) | class TextualInversionDataset(Dataset): method __init__ (line 494) | def __init__( method __len__ (line 536) | def __len__(self): method __getitem__ (line 539) | def __getitem__(self, i): function main (line 592) | def main(): FILE: examples/unconditional_image_generation/test_unconditional.py class Unconditional (line 33) | class Unconditional(ExamplesTestsAccelerate): method test_train_unconditional (line 34) | def test_train_unconditional(self): method test_unconditional_checkpointing_checkpoints_total_limit (line 55) | def test_unconditional_checkpointing_checkpoints_total_limit(self): method test_unconditional_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 82) | def test_unconditional_checkpointing_checkpoints_total_limit_removes_m... FILE: examples/unconditional_image_generation/train_unconditional.py function _extract_into_tensor (line 37) | def _extract_into_tensor(arr, timesteps, broadcast_shape): function _ensure_three_channels (line 55) | def _ensure_three_channels(tensor: torch.Tensor) -> torch.Tensor: function parse_args (line 73) | def parse_args(): function main (line 298) | def main(args): FILE: examples/vqgan/discriminator.py class Discriminator (line 13) | class Discriminator(ModelMixin, ConfigMixin): method __init__ (line 15) | def __init__(self, in_channels=3, cond_channels=0, hidden_channels=512... method forward (line 36) | def forward(self, x, cond=None): FILE: examples/vqgan/test_vqgan.py class TextToImage (line 48) | class TextToImage(ExamplesTestsAccelerate): method test_vqmodel_config (line 50) | def test_vqmodel_config(self): method test_discriminator_config (line 77) | def test_discriminator_config(self): method get_vq_and_discriminator_configs (line 87) | def get_vq_and_discriminator_configs(self, tmpdir): method test_vqmodel (line 96) | def test_vqmodel(self): method test_vqmodel_checkpointing (line 123) | def test_vqmodel_checkpointing(self): method test_vqmodel_checkpointing_use_ema (line 207) | def test_vqmodel_checkpointing_use_ema(self): method test_vqmodel_checkpointing_checkpoints_total_limit (line 291) | def test_vqmodel_checkpointing_checkpoints_total_limit(self): method test_vqmodel_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 329) | def test_vqmodel_checkpointing_checkpoints_total_limit_removes_multipl... FILE: examples/vqgan/train_vqgan.py class AverageMeter (line 58) | class AverageMeter(object): method __init__ (line 61) | def __init__(self): method reset (line 64) | def reset(self): method update (line 70) | def update(self, val, n=1): function _map_layer_to_idx (line 77) | def _map_layer_to_idx(backbone, layers, offset=0): function get_perceptual_loss (line 100) | def get_perceptual_loss(pixel_values, fmap, timm_model, timm_model_resol... function grad_layer_wrt_loss (line 119) | def grad_layer_wrt_loss(loss, layer): function gradient_penalty (line 128) | def gradient_penalty(images, output, weight=10): function log_validation (line 143) | def log_validation(model, args, validation_transform, accelerator, globa... function log_grad_norm (line 195) | def log_grad_norm(model, accelerator, global_step): function parse_args (line 203) | def parse_args(): function main (line 548) | def main(): FILE: scripts/conversion_ldm_uncond.py function convert_ldm_original (line 9) | def convert_ldm_original(checkpoint_path, config_path, output_path): FILE: scripts/convert_amused.py function main (line 34) | def main(): function make_transformer (line 118) | def make_transformer(old_transformer, model_256): function make_vqvae (line 346) | def make_vqvae(old_vae): function convert_vae_block_state_dict (line 476) | def convert_vae_block_state_dict(old_state_dict, prefix_from, new_state_... FILE: scripts/convert_animatediff_motion_lora_to_diffusers.py function convert_motion_module (line 9) | def convert_motion_module(original_state_dict): function get_args (line 28) | def get_args(): FILE: scripts/convert_animatediff_motion_module_to_diffusers.py function convert_motion_module (line 9) | def convert_motion_module(original_state_dict): function get_args (line 28) | def get_args(): FILE: scripts/convert_animatediff_sparsectrl_to_diffusers.py function convert (line 21) | def convert(original_state_dict: Dict[str, nn.Module]) -> dict[str, nn.M... function get_args (line 33) | def get_args(): FILE: scripts/convert_asymmetric_vqgan_to_diffusers.py function convert_asymmetric_autoencoder_kl_state_dict (line 64) | def convert_asymmetric_autoencoder_kl_state_dict(original_state_dict: Di... function get_asymmetric_autoencoder_kl_from_original_checkpoint (line 123) | def get_asymmetric_autoencoder_kl_from_original_checkpoint( FILE: scripts/convert_aura_flow_to_diffusers.py function load_original_state_dict (line 9) | def load_original_state_dict(args): function calculate_layers (line 15) | def calculate_layers(state_dict_keys, key_prefix): function swap_scale_shift (line 25) | def swap_scale_shift(weight, dim): function convert_transformer (line 31) | def convert_transformer(state_dict): function populate_state_dict (line 106) | def populate_state_dict(args): FILE: scripts/convert_blipdiffusion_to_diffusers.py function qformer_model_from_original_config (line 45) | def qformer_model_from_original_config(): function embeddings_from_original_checkpoint (line 50) | def embeddings_from_original_checkpoint(model, diffuser_embeddings_prefi... function proj_layer_from_original_checkpoint (line 75) | def proj_layer_from_original_checkpoint(model, diffuser_proj_prefix, ori... function attention_from_original_checkpoint (line 86) | def attention_from_original_checkpoint(model, diffuser_attention_prefix,... function output_layers_from_original_checkpoint (line 137) | def output_layers_from_original_checkpoint(model, diffuser_output_prefix... function encoder_from_original_checkpoint (line 150) | def encoder_from_original_checkpoint(model, diffuser_encoder_prefix, ori... function visual_encoder_layer_from_original_checkpoint (line 206) | def visual_encoder_layer_from_original_checkpoint(model, diffuser_prefix... function visual_encoder_from_original_checkpoint (line 233) | def visual_encoder_from_original_checkpoint(model, diffuser_prefix, orig... function qformer_original_checkpoint_to_diffusers_checkpoint (line 269) | def qformer_original_checkpoint_to_diffusers_checkpoint(model): function get_qformer (line 281) | def get_qformer(model): function load_checkpoint_to_model (line 293) | def load_checkpoint_to_model(checkpoint, model): function save_blip_diffusion_model (line 302) | def save_blip_diffusion_model(model, args): function main (line 334) | def main(args): FILE: scripts/convert_cogvideox_to_diffusers.py function reassign_query_key_value_inplace (line 16) | def reassign_query_key_value_inplace(key: str, state_dict: Dict[str, Any]): function reassign_query_key_layernorm_inplace (line 27) | def reassign_query_key_layernorm_inplace(key: str, state_dict: Dict[str,... function reassign_adaln_norm_inplace (line 38) | def reassign_adaln_norm_inplace(key: str, state_dict: Dict[str, Any]): function remove_keys_inplace (line 54) | def remove_keys_inplace(key: str, state_dict: Dict[str, Any]): function replace_up_keys_inplace (line 58) | def replace_up_keys_inplace(key: str, state_dict: Dict[str, Any]): function get_state_dict (line 123) | def get_state_dict(saved_dict: Dict[str, Any]) -> dict[str, Any]: function update_state_dict_inplace (line 134) | def update_state_dict_inplace(state_dict: Dict[str, Any], old_key: str, ... function convert_transformer (line 138) | def convert_transformer( function convert_vae (line 176) | def convert_vae(ckpt_path: str, scaling_factor: float, version: str, dty... function get_transformer_init_kwargs (line 200) | def get_transformer_init_kwargs(version: str): function get_args (line 228) | def get_args(): FILE: scripts/convert_cogview4_to_diffusers_megatron.py function swap_scale_shift (line 131) | def swap_scale_shift(weight, dim): function convert_megatron_transformer_checkpoint_to_diffusers (line 147) | def convert_megatron_transformer_checkpoint_to_diffusers( function convert_cogview4_vae_checkpoint_to_diffusers (line 252) | def convert_cogview4_vae_checkpoint_to_diffusers(ckpt_path, vae_config): function main (line 267) | def main(args): FILE: scripts/convert_dance_diffusion_to_diffusers.py function alpha_sigma_to_t (line 51) | def alpha_sigma_to_t(alpha, sigma): function get_crash_schedule (line 57) | def get_crash_schedule(t): class Object (line 63) | class Object(object): class DiffusionUncond (line 67) | class DiffusionUncond(nn.Module): method __init__ (line 68) | def __init__(self, global_args): function download (line 76) | def download(model_name): function convert_resconv_naming (line 142) | def convert_resconv_naming(name): function convert_attn_naming (line 153) | def convert_attn_naming(name): function rename (line 162) | def rename(input_string, max_depth=13): function rename_orig_weights (line 221) | def rename_orig_weights(state_dict): function transform_conv_attns (line 239) | def transform_conv_attns(new_state_dict, new_k, v): function main (line 259) | def main(args): FILE: scripts/convert_diffusers_to_original_stable_diffusion.py function convert_unet_state_dict (line 92) | def convert_unet_state_dict(unet_state_dict): function reshape_weight_for_sd (line 171) | def reshape_weight_for_sd(w): function convert_vae_state_dict (line 179) | def convert_vae_state_dict(vae_state_dict): function convert_text_enc_state_dict_v20 (line 233) | def convert_text_enc_state_dict_v20(text_enc_dict): function convert_text_enc_state_dict (line 280) | def convert_text_enc_state_dict(text_enc_dict):