SYMBOL INDEX (2669 symbols across 182 files) FILE: evaluation/evaluate.py function mask_decode (line 9) | def mask_decode(encoded_mask,image_shape=[512,512]): function calculate_metric (line 29) | def calculate_metric(metrics_calculator,metric, src_image, tgt_image, sr... FILE: evaluation/matrics_calculator.py class VitExtractor (line 12) | class VitExtractor: method __init__ (line 19) | def __init__(self, model_name, device): method _init_hooks_data (line 32) | def _init_hooks_data(self): method _register_hooks (line 41) | def _register_hooks(self, **kwargs): method _clear_hooks (line 52) | def _clear_hooks(self): method _get_block_hook (line 57) | def _get_block_hook(self): method _get_attn_hook (line 63) | def _get_attn_hook(self): method _get_qkv_hook (line 69) | def _get_qkv_hook(self): method _get_patch_imd_hook (line 76) | def _get_patch_imd_hook(self): method get_feature_from_input (line 82) | def get_feature_from_input(self, input_img): # List([B, N, D]) method get_qkv_feature_from_input (line 90) | def get_qkv_feature_from_input(self, input_img): method get_attn_feature_from_input (line 98) | def get_attn_feature_from_input(self, input_img): method get_patch_size (line 106) | def get_patch_size(self): method get_width_patch_num (line 109) | def get_width_patch_num(self, input_img_shape): method get_height_patch_num (line 114) | def get_height_patch_num(self, input_img_shape): method get_patch_num (line 119) | def get_patch_num(self, input_img_shape): method get_head_num (line 123) | def get_head_num(self): method get_embedding_dim (line 128) | def get_embedding_dim(self): method get_queries_from_qkv (line 133) | def get_queries_from_qkv(self, qkv, input_img_shape): method get_keys_from_qkv (line 140) | def get_keys_from_qkv(self, qkv, input_img_shape): method get_values_from_qkv (line 147) | def get_values_from_qkv(self, qkv, input_img_shape): method get_keys_from_input (line 154) | def get_keys_from_input(self, input_img, layer_num): method get_keys_self_sim_from_input (line 159) | def get_keys_self_sim_from_input(self, input_img, layer_num): method attn_cosine_sim (line 166) | def attn_cosine_sim(self,x, eps=1e-08): class LossG (line 174) | class LossG(torch.nn.Module): method __init__ (line 175) | def __init__(self, cfg,device): method update_lambda_config (line 197) | def update_lambda_config(self, step): method forward (line 209) | def forward(self, outputs, inputs): method calculate_global_ssim_loss (line 237) | def calculate_global_ssim_loss(self, outputs, inputs): method calculate_crop_cls_loss (line 248) | def calculate_crop_cls_loss(self, outputs, inputs): method calculate_global_id_loss (line 259) | def calculate_global_id_loss(self, outputs, inputs): class MetricsCalculator (line 271) | class MetricsCalculator: method __init__ (line 272) | def __init__(self, device) -> None: method calculate_clip_similarity (line 290) | def calculate_clip_similarity(self, img, txt, mask=None): method calculate_psnr (line 304) | def calculate_psnr(self, img_pred, img_gt, mask_pred=None, mask_gt=None): method calculate_lpips (line 324) | def calculate_lpips(self, img_pred, img_gt, mask_pred=None, mask_gt=No... method calculate_mse (line 344) | def calculate_mse(self, img_pred, img_gt, mask_pred=None, mask_gt=None): method calculate_ssim (line 364) | def calculate_ssim(self, img_pred, img_gt, mask_pred=None, mask_gt=None): method calculate_structure_distance (line 385) | def calculate_structure_distance(self, img_pred, img_gt, mask_pred=Non... FILE: models/InstructDiffusion/dataset/editing/edit_zip_dataset.py class FilteredIP2PDataset (line 35) | class FilteredIP2PDataset(Dataset): method __init__ (line 36) | def __init__( method __len__ (line 115) | def __len__(self) -> int: method __getitem__ (line 118) | def __getitem__(self, i: int) -> dict[str, Any]: class GIERDataset (line 169) | class GIERDataset(Dataset): method __init__ (line 170) | def __init__( method __len__ (line 260) | def __len__(self) -> int: method __getitem__ (line 263) | def __getitem__(self, i: int) -> dict[str, Any]: class GQAInpaintDataset (line 296) | class GQAInpaintDataset(Dataset): method __init__ (line 317) | def __init__(self, **kwargs): method __len__ (line 330) | def __len__(self): method __getitem__ (line 333) | def __getitem__(self, i): class MagicBrushDataset (line 359) | class MagicBrushDataset(Dataset): method __init__ (line 360) | def __init__( method __len__ (line 389) | def __len__(self) -> int: method __getitem__ (line 392) | def __getitem__(self, i: int) -> dict[str, Any]: class IEIWDataset (line 426) | class IEIWDataset(Dataset): method __init__ (line 427) | def __init__( method __len__ (line 456) | def __len__(self) -> int: method __getitem__ (line 459) | def __getitem__(self, i: int) -> dict[str, Any]: FILE: models/InstructDiffusion/dataset/low_level/lowlevel_clwd.py function is_image_file (line 20) | def is_image_file(filename): class CLWD (line 24) | class CLWD(Dataset): method __init__ (line 25) | def __init__(self, path, split="train", size=256, interpolation="pil_l... method __len__ (line 66) | def __len__(self): method __getitem__ (line 69) | def __getitem__(self, index): FILE: models/InstructDiffusion/dataset/low_level/lowlevel_gopro.py function is_image_file (line 20) | def is_image_file(filename): class GoPro (line 24) | class GoPro(Dataset): method __init__ (line 25) | def __init__(self, path, split="train", size=256, interpolation="pil_l... method __len__ (line 66) | def __len__(self): method __getitem__ (line 69) | def __getitem__(self, index): FILE: models/InstructDiffusion/dataset/low_level/lowlevel_reds.py function is_image_file (line 20) | def is_image_file(filename): class REDS (line 24) | class REDS(Dataset): method __init__ (line 25) | def __init__(self, path, split="train", size=256, interpolation="pil_l... method __len__ (line 71) | def __len__(self): method __getitem__ (line 74) | def __getitem__(self, index): FILE: models/InstructDiffusion/dataset/low_level/lowlevel_sidd.py function is_image_file (line 20) | def is_image_file(filename): class SIDD (line 24) | class SIDD(Dataset): method __init__ (line 25) | def __init__(self, path, split="train", size=256, interpolation="pil_l... method __len__ (line 65) | def __len__(self): method __getitem__ (line 68) | def __getitem__(self, index): FILE: models/InstructDiffusion/dataset/pose/pose.py function readTXT (line 45) | def readTXT(txt_path): class PoseDataset (line 52) | class PoseDataset(Dataset): method __init__ (line 53) | def __init__(self, root, image_set, is_train, max_prompt_num=5, min_pr... method _get_db (line 93) | def _get_db(self): method evaluate (line 96) | def evaluate(self, preds, output_dir, *args, **kwargs): method half_body_transform (line 99) | def half_body_transform(self, joints, joints_vis): method __len__ (line 144) | def __len__(self,): method __getitem__ (line 147) | def __getitem__(self, idx): method generate_target (line 221) | def generate_target(self, input, joints, joints_vis): class COCODataset (line 281) | class COCODataset(PoseDataset): method __init__ (line 282) | def __init__(self, root, image_set, is_train, max_prompt_num=5, min_pr... method _get_ann_file_keypoint (line 347) | def _get_ann_file_keypoint(self): method _load_image_set_index (line 374) | def _load_image_set_index(self): method _get_db (line 379) | def _get_db(self): method _load_coco_keypoint_annotations (line 383) | def _load_coco_keypoint_annotations(self): method _load_coco_keypoint_annotation_kernal (line 390) | def _load_coco_keypoint_annotation_kernal(self, index): method _box2cs (line 459) | def _box2cs(self, box): method _xywh2cs (line 463) | def _xywh2cs(self, x, y, w, h): method image_path_from_index (line 480) | def image_path_from_index(self, index, im_ann): function flip_back (line 511) | def flip_back(output_flipped, matched_parts): function fliplr_joints (line 528) | def fliplr_joints(joints, joints_vis, width, matched_parts): function get_affine_transform (line 545) | def get_affine_transform( function affine_transform (line 580) | def affine_transform(pt, t): function get_3rd_point (line 586) | def get_3rd_point(a, b): function get_dir (line 591) | def get_dir(src_point, rot_rad): class CrowdPoseDataset (line 601) | class CrowdPoseDataset(COCODataset): method __init__ (line 602) | def __init__(self, root, image_set, is_train, max_prompt_num=5, min_pr... class AICDataset (line 637) | class AICDataset(COCODataset): method __init__ (line 638) | def __init__(self, root, image_set, is_train, max_prompt_num=5, min_pr... class MPIIDataset (line 672) | class MPIIDataset(PoseDataset): method __init__ (line 673) | def __init__(self, root, image_set, is_train, max_prompt_num=5, min_pr... method _get_db (line 709) | def _get_db(self): FILE: models/InstructDiffusion/dataset/seg/coco_stuff.py class COCOStuffDataset (line 27) | class COCOStuffDataset(Dataset): method __init__ (line 28) | def __init__( method __len__ (line 92) | def __len__(self) -> int: method _augmentation_new (line 96) | def _augmentation_new(self, image, label): method __getitem__ (line 118) | def __getitem__(self, i): FILE: models/InstructDiffusion/dataset/seg/grefcoco.py class G_REFER (line 34) | class G_REFER: method __init__ (line 36) | def __init__(self, data_root, dataset='grefcoco', splitBy='unc'): method _toList (line 74) | def _toList(x): method match_any (line 78) | def match_any(a, b): method createIndex (line 83) | def createIndex(self): method getRefIds (line 163) | def getRefIds(self, image_ids=[], cat_ids=[], split=[]): method getAnnIds (line 185) | def getAnnIds(self, image_ids=[], ref_ids=[]): method getImgIds (line 205) | def getImgIds(self, ref_ids=[]): method getCatIds (line 214) | def getCatIds(self): method loadRefs (line 217) | def loadRefs(self, ref_ids=[]): method loadAnns (line 220) | def loadAnns(self, ann_ids=[]): method loadImgs (line 225) | def loadImgs(self, image_ids=[]): method loadCats (line 228) | def loadCats(self, cat_ids=[]): method getRefBox (line 231) | def getRefBox(self, ref_id): method showRef (line 235) | def showRef(self, ref, seg_box='seg'): method getMask (line 278) | def getMask(self, ann): method getMaskByRef (line 296) | def getMaskByRef(self, ref=None, ref_id=None, merge=False): method showMask (line 325) | def showMask(self, ref): FILE: models/InstructDiffusion/dataset/seg/grefcoco_segmentation.py class GrefCOCODataset (line 27) | class GrefCOCODataset(Dataset): method __init__ (line 28) | def __init__( method __len__ (line 73) | def __len__(self) -> int: method _augmentation_new (line 76) | def _augmentation_new(self, image, label): method __getitem__ (line 98) | def __getitem__(self, i: int) -> dict[str, Any]: FILE: models/InstructDiffusion/dataset/seg/refcoco.py class REFER (line 44) | class REFER: method __init__ (line 46) | def __init__(self, data_root, dataset='refcoco', splitBy='unc'): method createIndex (line 79) | def createIndex(self): method getRefIds (line 142) | def getRefIds(self, image_ids=[], cat_ids=[], ref_ids=[], split=''): method getAnnIds (line 173) | def getAnnIds(self, image_ids=[], cat_ids=[], ref_ids=[]): method getImgIds (line 193) | def getImgIds(self, ref_ids=[]): method getCatIds (line 202) | def getCatIds(self): method loadRefs (line 205) | def loadRefs(self, ref_ids=[]): method loadAnns (line 211) | def loadAnns(self, ann_ids=[]): method loadImgs (line 217) | def loadImgs(self, image_ids=[]): method loadCats (line 223) | def loadCats(self, cat_ids=[]): method getRefBox (line 229) | def getRefBox(self, ref_id): method showRef (line 234) | def showRef(self, ref, seg_box='seg'): method getMask (line 277) | def getMask(self, ref): method showMask (line 327) | def showMask(self, ref): FILE: models/InstructDiffusion/dataset/seg/refcoco_segmentation.py class RefCOCODataset (line 27) | class RefCOCODataset(Dataset): method __init__ (line 28) | def __init__( method __len__ (line 73) | def __len__(self) -> int: method _augmentation_new (line 76) | def _augmentation_new(self, image, label): method __getitem__ (line 98) | def __getitem__(self, i: int) -> dict[str, Any]: FILE: models/InstructDiffusion/dataset/utils/zip_manager.py function norm (line 21) | def norm(path): function in_blob (line 25) | def in_blob(file): function map_name (line 31) | def map_name(file): function preload (line 39) | def preload(db,sync=False): function get_keys_from_lmdb (line 46) | def get_keys_from_lmdb(db): function decode_img (line 50) | def decode_img(byteflow): function decode_text (line 59) | def decode_text(byteflow): class ZipManager (line 68) | class ZipManager: method __init__ (line 69) | def __init__(self, zip_path,data_type,prefix=None) -> None: method deinitialze (line 75) | def deinitialze(self): method initialize (line 80) | def initialize(self,close=True): method keys (line 89) | def keys(self): method get (line 94) | def get(self, name): class MultipleZipManager (line 101) | class MultipleZipManager: method __init__ (line 102) | def __init__(self, files: list, data_type, sync=True): method initialize (line 115) | def initialize(self): method keys (line 136) | def keys(self): method get (line 141) | def get(self, name): FILE: models/InstructDiffusion/edit_app.py function load_model_from_config (line 36) | def load_model_from_config(config, ckpt, vae_ckpt=None, verbose=False): function read_content (line 49) | def read_content(file_path: str) -> str: function get_header (line 58) | def get_header(): class CFGDenoiser (line 85) | class CFGDenoiser(nn.Module): method __init__ (line 86) | def __init__(self, model): method forward (line 90) | def forward(self, z, sigma, cond, uncond, text_cfg_scale, image_cfg_sc... function predict (line 101) | def predict( function main (line 219) | def main(ckpt="checkpoints/v1-5-pruned-emaonly-adaption-task-humanalign.... FILE: models/InstructDiffusion/edit_cli.py class CFGDenoiser (line 31) | class CFGDenoiser(nn.Module): method __init__ (line 32) | def __init__(self, model): method forward (line 36) | def forward(self, z, sigma, cond, uncond, text_cfg_scale, image_cfg_sc... function load_model_from_config (line 50) | def load_model_from_config(config, ckpt, vae_ckpt=None, verbose=False): function main (line 63) | def main(): FILE: models/InstructDiffusion/main.py function wandb_log (line 38) | def wandb_log(*args, **kwargs): function get_parser (line 43) | def get_parser(**parser_kwargs): class WrappedDataset (line 156) | class WrappedDataset(Dataset): method __init__ (line 159) | def __init__(self, dataset): method __len__ (line 162) | def __len__(self): method __getitem__ (line 165) | def __getitem__(self, idx): class DataModuleFromConfig (line 169) | class DataModuleFromConfig(): method __init__ (line 170) | def __init__(self, batch_size, train=None, validation=None, test=None,... method prepare_data (line 199) | def prepare_data(self): method setup (line 203) | def setup(self, stage=None): method _train_concat_dataloader (line 211) | def _train_concat_dataloader(self): method _train_dataloader (line 230) | def _train_dataloader(self): method _val_dataloader (line 243) | def _val_dataloader(self, shuffle=False): method _test_dataloader (line 254) | def _test_dataloader(self, shuffle=False): method _predict_dataloader (line 267) | def _predict_dataloader(self, shuffle=False): function train_one_epoch (line 276) | def train_one_epoch(config, model, model_ema, data_loader, val_data_load... FILE: models/InstructDiffusion/stable_diffusion/ldm/lr_scheduler.py class LambdaWarmUpCosineScheduler (line 4) | class LambdaWarmUpCosineScheduler: method __init__ (line 8) | def __init__(self, warm_up_steps, lr_min, lr_max, lr_start, max_decay_... method schedule (line 17) | def schedule(self, n, **kwargs): method __call__ (line 32) | def __call__(self, n, **kwargs): class LambdaWarmUpCosineScheduler2 (line 36) | class LambdaWarmUpCosineScheduler2: method __init__ (line 41) | def __init__(self, warm_up_steps, f_min, f_max, f_start, cycle_lengths... method find_in_interval (line 52) | def find_in_interval(self, n): method schedule (line 59) | def schedule(self, n, **kwargs): method __call__ (line 77) | def __call__(self, n, **kwargs): class LambdaLinearScheduler (line 81) | class LambdaLinearScheduler(LambdaWarmUpCosineScheduler2): method schedule (line 83) | def schedule(self, n, **kwargs): FILE: models/InstructDiffusion/stable_diffusion/ldm/models/autoencoder.py class VQModel (line 20) | class VQModel(nn.Module): method __init__ (line 21) | def __init__(self, method ema_scope (line 70) | def ema_scope(self, context=None): method init_from_ckpt (line 84) | def init_from_ckpt(self, path, ignore_keys=list()): method on_train_batch_end (line 98) | def on_train_batch_end(self, *args, **kwargs): method encode (line 102) | def encode(self, x): method encode_to_prequant (line 108) | def encode_to_prequant(self, x): method decode (line 113) | def decode(self, quant): method decode_code (line 118) | def decode_code(self, code_b): method forward (line 123) | def forward(self, input, return_pred_indices=False): method get_input (line 130) | def get_input(self, batch, k): method training_step (line 148) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 170) | def validation_step(self, batch, batch_idx): method _validation_step (line 176) | def _validation_step(self, batch, batch_idx, suffix=""): method configure_optimizers (line 203) | def configure_optimizers(self): method get_last_layer (line 236) | def get_last_layer(self): method log_images (line 239) | def log_images(self, batch, only_inputs=False, plot_ema=False, **kwargs): method to_rgb (line 261) | def to_rgb(self, x): class VQModelInterface (line 270) | class VQModelInterface(VQModel): method __init__ (line 271) | def __init__(self, embed_dim, *args, **kwargs): method encode (line 275) | def encode(self, x): method decode (line 280) | def decode(self, h, force_not_quantize=False): class AutoencoderKL (line 291) | class AutoencoderKL(nn.Module): method __init__ (line 292) | def __init__(self, method init_from_ckpt (line 319) | def init_from_ckpt(self, path, ignore_keys=list()): method encode (line 330) | def encode(self, x): method decode (line 336) | def decode(self, z): method forward (line 341) | def forward(self, input, sample_posterior=True): method get_input (line 350) | def get_input(self, batch, k): method training_step (line 357) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 378) | def validation_step(self, batch, batch_idx): method configure_optimizers (line 392) | def configure_optimizers(self): method get_last_layer (line 403) | def get_last_layer(self): method log_images (line 407) | def log_images(self, batch, only_inputs=False, **kwargs): method to_rgb (line 423) | def to_rgb(self, x): class IdentityFirstStage (line 432) | class IdentityFirstStage(torch.nn.Module): method __init__ (line 433) | def __init__(self, *args, vq_interface=False, **kwargs): method encode (line 437) | def encode(self, x, *args, **kwargs): method decode (line 440) | def decode(self, x, *args, **kwargs): method quantize (line 443) | def quantize(self, x, *args, **kwargs): method forward (line 448) | def forward(self, x, *args, **kwargs): FILE: models/InstructDiffusion/stable_diffusion/ldm/models/diffusion/classifier.py function disabled_train (line 22) | def disabled_train(self, mode=True): class NoisyLatentImageClassifier (line 28) | class NoisyLatentImageClassifier(pl.LightningModule): method __init__ (line 30) | def __init__(self, method init_from_ckpt (line 70) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method load_diffusion (line 88) | def load_diffusion(self): method load_classifier (line 95) | def load_classifier(self, ckpt_path, pool): method get_x_noisy (line 110) | def get_x_noisy(self, x, t, noise=None): method forward (line 120) | def forward(self, x_noisy, t, *args, **kwargs): method get_input (line 124) | def get_input(self, batch, k): method get_conditioning (line 133) | def get_conditioning(self, batch, k=None): method compute_top_k (line 150) | def compute_top_k(self, logits, labels, k, reduction="mean"): method on_train_epoch_start (line 157) | def on_train_epoch_start(self): method write_logs (line 162) | def write_logs(self, loss, logits, targets): method shared_step (line 179) | def shared_step(self, batch, t=None): method training_step (line 198) | def training_step(self, batch, batch_idx): method reset_noise_accs (line 202) | def reset_noise_accs(self): method on_validation_start (line 206) | def on_validation_start(self): method validation_step (line 210) | def validation_step(self, batch, batch_idx): method configure_optimizers (line 220) | def configure_optimizers(self): method log_images (line 238) | def log_images(self, batch, N=8, *args, **kwargs): FILE: models/InstructDiffusion/stable_diffusion/ldm/models/diffusion/ddim.py class DDIMSampler (line 12) | class DDIMSampler(object): method __init__ (line 13) | def __init__(self, model, schedule="linear", **kwargs): method register_buffer (line 19) | def register_buffer(self, name, attr): method make_schedule (line 25) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 57) | def sample(self, method ddim_sampling (line 114) | def ddim_sampling(self, cond, shape, method p_sample_ddim (line 166) | def p_sample_ddim(self, x, c, t, index, repeat_noise=False, use_origin... method stochastic_encode (line 207) | def stochastic_encode(self, x0, t, use_original_steps=False, noise=None): method decode (line 223) | def decode(self, x_latent, cond, t_start, unconditional_guidance_scale... FILE: models/InstructDiffusion/stable_diffusion/ldm/models/diffusion/ddpm.py function disabled_train (line 34) | def disabled_train(self, mode=True): function uniform_on_device (line 40) | def uniform_on_device(r1, r2, shape, device): class DDPM (line 44) | class DDPM(pl.LightningModule): method __init__ (line 46) | def __init__(self, method register_schedule (line 117) | def register_schedule(self, given_betas=None, beta_schedule="linear", ... method ema_scope (line 172) | def ema_scope(self, context=None): method init_from_ckpt (line 186) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method q_mean_variance (line 204) | def q_mean_variance(self, x_start, t): method predict_start_from_noise (line 216) | def predict_start_from_noise(self, x_t, t, noise): method q_posterior (line 222) | def q_posterior(self, x_start, x_t, t): method p_mean_variance (line 231) | def p_mean_variance(self, x, t, clip_denoised: bool): method p_sample (line 244) | def p_sample(self, x, t, clip_denoised=True, repeat_noise=False): method p_sample_loop (line 253) | def p_sample_loop(self, shape, return_intermediates=False): method sample (line 268) | def sample(self, batch_size=16, return_intermediates=False): method q_sample (line 274) | def q_sample(self, x_start, t, noise=None): method get_loss (line 279) | def get_loss(self, pred, target, mean=True): method p_losses (line 294) | def p_losses(self, x_start, t, noise=None): method forward (line 323) | def forward(self, x, *args, **kwargs): method get_input (line 329) | def get_input(self, batch, k): method shared_step (line 337) | def shared_step(self, batch): method training_step (line 342) | def training_step(self, batch, batch_idx): method validation_step (line 358) | def validation_step(self, batch, batch_idx): method on_train_batch_end (line 366) | def on_train_batch_end(self, *args, **kwargs): method _get_rows_from_list (line 370) | def _get_rows_from_list(self, samples): method log_images (line 378) | def log_images(self, batch, N=8, n_row=2, sample=True, return_keys=Non... method configure_optimizers (line 415) | def configure_optimizers(self): class LatentDiffusion (line 424) | class LatentDiffusion(DDPM): method __init__ (line 426) | def __init__(self, method make_cond_schedule (line 471) | def make_cond_schedule(self, ): method on_train_batch_start (line 478) | def on_train_batch_start(self, batch, batch_idx, dataloader_idx): method register_schedule (line 493) | def register_schedule(self, method instantiate_first_stage (line 502) | def instantiate_first_stage(self, config): method instantiate_cond_stage (line 509) | def instantiate_cond_stage(self, config): method _get_denoise_row_from_list (line 530) | def _get_denoise_row_from_list(self, samples, desc='', force_no_decode... method get_first_stage_encoding (line 542) | def get_first_stage_encoding(self, encoder_posterior): method get_learned_conditioning (line 551) | def get_learned_conditioning(self, c): method meshgrid (line 564) | def meshgrid(self, h, w): method delta_border (line 571) | def delta_border(self, h, w): method get_weighting (line 585) | def get_weighting(self, h, w, Ly, Lx, device): method get_fold_unfold (line 601) | def get_fold_unfold(self, x, kernel_size, stride, uf=1, df=1): # todo... method get_input (line 654) | def get_input(self, batch, k, return_first_stage_outputs=False, force_... method decode_first_stage (line 706) | def decode_first_stage(self, z, predict_cids=False, force_not_quantize... method differentiable_decode_first_stage (line 766) | def differentiable_decode_first_stage(self, z, predict_cids=False, for... method encode_first_stage (line 826) | def encode_first_stage(self, x): method shared_step (line 865) | def shared_step(self, batch, **kwargs): method forward (line 870) | def forward(self, x, c, *args, **kwargs): method _rescale_annotations (line 881) | def _rescale_annotations(self, bboxes, crop_coordinates): # TODO: mov... method apply_model (line 891) | def apply_model(self, x_noisy, t, cond, return_ids=False): method _predict_eps_from_xstart (line 994) | def _predict_eps_from_xstart(self, x_t, t, pred_xstart): method _prior_bpd (line 998) | def _prior_bpd(self, x_start): method p_losses (line 1012) | def p_losses(self, x_start, cond, t, noise=None): method p_mean_variance (line 1047) | def p_mean_variance(self, x, c, t, clip_denoised: bool, return_codeboo... method p_sample (line 1079) | def p_sample(self, x, c, t, clip_denoised=False, repeat_noise=False, method progressive_denoising (line 1110) | def progressive_denoising(self, cond, shape, verbose=True, callback=No... method p_sample_loop (line 1166) | def p_sample_loop(self, cond, shape, return_intermediates=False, method sample (line 1217) | def sample(self, cond, batch_size=16, return_intermediates=False, x_T=... method sample_log (line 1235) | def sample_log(self,cond,batch_size,ddim, ddim_steps,**kwargs): method log_images (line 1251) | def log_images(self, batch, N=8, n_row=4, sample=True, ddim_steps=200,... method configure_optimizers (line 1361) | def configure_optimizers(self): method to_rgb (line 1386) | def to_rgb(self, x): class DiffusionWrapper (line 1395) | class DiffusionWrapper(pl.LightningModule): method __init__ (line 1396) | def __init__(self, diff_model_config, conditioning_key): method forward (line 1402) | def forward(self, x, t, c_concat: list = None, c_crossattn: list = None): class Layout2ImgDiffusion (line 1424) | class Layout2ImgDiffusion(LatentDiffusion): method __init__ (line 1426) | def __init__(self, cond_stage_key, *args, **kwargs): method log_images (line 1430) | def log_images(self, batch, N=8, *args, **kwargs): FILE: models/InstructDiffusion/stable_diffusion/ldm/models/diffusion/ddpm_edit.py function disabled_train (line 37) | def disabled_train(self, mode=True): function uniform_on_device (line 43) | def uniform_on_device(r1, r2, shape, device): class DDPM (line 47) | class DDPM(nn.Module): method __init__ (line 49) | def __init__(self, method register_schedule (line 117) | def register_schedule(self, given_betas=None, beta_schedule="linear", ... method init_from_ckpt (line 171) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method q_mean_variance (line 214) | def q_mean_variance(self, x_start, t): method predict_start_from_noise (line 226) | def predict_start_from_noise(self, x_t, t, noise): method q_posterior (line 232) | def q_posterior(self, x_start, x_t, t): method p_mean_variance (line 241) | def p_mean_variance(self, x, t, clip_denoised: bool): method p_sample (line 254) | def p_sample(self, x, t, clip_denoised=True, repeat_noise=False): method p_sample_loop (line 263) | def p_sample_loop(self, shape, return_intermediates=False): method sample (line 278) | def sample(self, batch_size=16, return_intermediates=False): method q_sample (line 284) | def q_sample(self, x_start, t, noise=None): method get_loss (line 289) | def get_loss(self, pred, target, mean=True): method p_losses (line 305) | def p_losses(self, x_start, t, noise=None): method forward (line 334) | def forward(self, x, *args, **kwargs): method get_input (line 340) | def get_input(self, batch, k): class NNParams (line 344) | class NNParams(nn.Module): method __init__ (line 345) | def __init__(self, dim): method forward (line 350) | def forward(self): class LatentDiffusion (line 354) | class LatentDiffusion(DDPM): method __init__ (line 356) | def __init__(self, method make_cond_schedule (line 405) | def make_cond_schedule(self, ): method on_train_batch_start (line 412) | def on_train_batch_start(self, batch, batch_idx, dataloader_idx): method register_schedule (line 426) | def register_schedule(self, method instantiate_first_stage (line 435) | def instantiate_first_stage(self, config): method instantiate_cond_stage (line 442) | def instantiate_cond_stage(self, config): method _get_denoise_row_from_list (line 463) | def _get_denoise_row_from_list(self, samples, desc='', force_no_decode... method get_first_stage_encoding (line 475) | def get_first_stage_encoding(self, encoder_posterior): method get_learned_conditioning (line 484) | def get_learned_conditioning(self, c): method meshgrid (line 497) | def meshgrid(self, h, w): method delta_border (line 504) | def delta_border(self, h, w): method get_weighting (line 518) | def get_weighting(self, h, w, Ly, Lx, device): method get_fold_unfold (line 534) | def get_fold_unfold(self, x, kernel_size, stride, uf=1, df=1): # todo... method get_input (line 587) | def get_input(self, batch, k, return_first_stage_outputs=False, force_... method decode_first_stage (line 618) | def decode_first_stage(self, z, predict_cids=False, force_not_quantize... method differentiable_decode_first_stage (line 678) | def differentiable_decode_first_stage(self, z, predict_cids=False, for... method encode_first_stage (line 738) | def encode_first_stage(self, x): method forward (line 777) | def forward(self, batch, batch_idx, num_steps, *args, **kwargs): method _rescale_annotations (line 791) | def _rescale_annotations(self, bboxes, crop_coordinates): # TODO: mov... method apply_model (line 801) | def apply_model(self, x_noisy, t, cond, return_ids=False): method _predict_eps_from_xstart (line 904) | def _predict_eps_from_xstart(self, x_t, t, pred_xstart): method _prior_bpd (line 908) | def _prior_bpd(self, x_start): method p_losses (line 922) | def p_losses(self, x_start, cond, t, noise=None): method p_mean_variance (line 974) | def p_mean_variance(self, x, c, t, clip_denoised: bool, return_codeboo... method p_sample (line 1006) | def p_sample(self, x, c, t, clip_denoised=False, repeat_noise=False, method progressive_denoising (line 1037) | def progressive_denoising(self, cond, shape, verbose=True, callback=No... method p_sample_loop (line 1093) | def p_sample_loop(self, cond, shape, return_intermediates=False, method sample (line 1144) | def sample(self, cond, batch_size=16, return_intermediates=False, x_T=... method sample_log (line 1162) | def sample_log(self,cond,batch_size,ddim, ddim_steps,**kwargs): class DiffusionWrapper (line 1177) | class DiffusionWrapper(nn.Module): method __init__ (line 1178) | def __init__(self, diff_model_config, conditioning_key): method forward (line 1184) | def forward(self, x, t, c_concat: list = None, c_crossattn: list = None): class Layout2ImgDiffusion (line 1206) | class Layout2ImgDiffusion(LatentDiffusion): method __init__ (line 1208) | def __init__(self, cond_stage_key, *args, **kwargs): method log_images (line 1212) | def log_images(self, batch, N=8, *args, **kwargs): FILE: models/InstructDiffusion/stable_diffusion/ldm/models/diffusion/dpm_solver/dpm_solver.py class NoiseScheduleVP (line 6) | class NoiseScheduleVP: method __init__ (line 7) | def __init__( method marginal_log_mean_coeff (line 125) | def marginal_log_mean_coeff(self, t): method marginal_alpha (line 138) | def marginal_alpha(self, t): method marginal_std (line 144) | def marginal_std(self, t): method marginal_lambda (line 150) | def marginal_lambda(self, t): method inverse_lambda (line 158) | def inverse_lambda(self, lamb): function model_wrapper (line 177) | def model_wrapper( class DPM_Solver (line 351) | class DPM_Solver: method __init__ (line 352) | def __init__(self, model_fn, noise_schedule, predict_x0=False, thresho... method noise_prediction_fn (line 380) | def noise_prediction_fn(self, x, t): method data_prediction_fn (line 386) | def data_prediction_fn(self, x, t): method model_fn (line 401) | def model_fn(self, x, t): method get_time_steps (line 410) | def get_time_steps(self, skip_type, t_T, t_0, N, device): method get_orders_and_timesteps_for_singlestep_solver (line 439) | def get_orders_and_timesteps_for_singlestep_solver(self, steps, order,... method denoise_to_zero_fn (line 498) | def denoise_to_zero_fn(self, x, s): method dpm_solver_first_update (line 504) | def dpm_solver_first_update(self, x, s, t, model_s=None, return_interm... method singlestep_dpm_solver_second_update (line 551) | def singlestep_dpm_solver_second_update(self, x, s, t, r1=0.5, model_s... method singlestep_dpm_solver_third_update (line 633) | def singlestep_dpm_solver_third_update(self, x, s, t, r1=1./3., r2=2./... method multistep_dpm_solver_second_update (line 755) | def multistep_dpm_solver_second_update(self, x, model_prev_list, t_pre... method multistep_dpm_solver_third_update (line 812) | def multistep_dpm_solver_third_update(self, x, model_prev_list, t_prev... method singlestep_dpm_solver_update (line 859) | def singlestep_dpm_solver_update(self, x, s, t, order, return_intermed... method multistep_dpm_solver_update (line 885) | def multistep_dpm_solver_update(self, x, model_prev_list, t_prev_list,... method dpm_solver_adaptive (line 909) | def dpm_solver_adaptive(self, x, order, t_T, t_0, h_init=0.05, atol=0.... method sample (line 965) | def sample(self, x, steps=20, t_start=None, t_end=None, order=3, skip_... function interpolate_fn (line 1132) | def interpolate_fn(x, xp, yp): function expand_dims (line 1174) | def expand_dims(v, dims): FILE: models/InstructDiffusion/stable_diffusion/ldm/models/diffusion/dpm_solver/sampler.py class DPMSolverSampler (line 8) | class DPMSolverSampler(object): method __init__ (line 9) | def __init__(self, model, **kwargs): method register_buffer (line 15) | def register_buffer(self, name, attr): method sample (line 22) | def sample(self, FILE: models/InstructDiffusion/stable_diffusion/ldm/models/diffusion/plms.py class PLMSSampler (line 11) | class PLMSSampler(object): method __init__ (line 12) | def __init__(self, model, schedule="linear", **kwargs): method register_buffer (line 18) | def register_buffer(self, name, attr): method make_schedule (line 24) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 58) | def sample(self, method plms_sampling (line 115) | def plms_sampling(self, cond, shape, method p_sample_plms (line 173) | def p_sample_plms(self, x, c, t, index, repeat_noise=False, use_origin... FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/attention.py function exists (line 14) | def exists(val): function uniq (line 18) | def uniq(arr): function default (line 22) | def default(val, d): function max_neg_value (line 28) | def max_neg_value(t): function init_ (line 32) | def init_(tensor): class GEGLU (line 40) | class GEGLU(nn.Module): method __init__ (line 41) | def __init__(self, dim_in, dim_out): method forward (line 45) | def forward(self, x): class FeedForward (line 50) | class FeedForward(nn.Module): method __init__ (line 51) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.): method forward (line 66) | def forward(self, x): function zero_module (line 70) | def zero_module(module): function Normalize (line 79) | def Normalize(in_channels, default_eps): class LinearAttention (line 86) | class LinearAttention(nn.Module): method __init__ (line 87) | def __init__(self, dim, heads=4, dim_head=32): method forward (line 94) | def forward(self, x): class SpatialSelfAttention (line 106) | class SpatialSelfAttention(nn.Module): method __init__ (line 107) | def __init__(self, in_channels): method forward (line 133) | def forward(self, x): class CrossAttention (line 160) | class CrossAttention(nn.Module): method __init__ (line 161) | def __init__(self, query_dim, context_dim=None, heads=8, dim_head=64, ... method forward (line 180) | def forward(self, x, context=None, mask=None): class BasicTransformerBlock (line 242) | class BasicTransformerBlock(nn.Module): method __init__ (line 246) | def __init__(self, dim, n_heads, d_head, dropout=0., context_dim=None,... method forward (line 263) | def forward(self, x, context=None): method _forward (line 266) | def _forward(self, x, context=None): class SpatialTransformer (line 330) | class SpatialTransformer(nn.Module): method __init__ (line 339) | def __init__(self, in_channels, n_heads, d_head, default_eps, force_ty... method forward (line 374) | def forward(self, x, context=None): FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/diffusionmodules/model.py function get_timestep_embedding (line 14) | def get_timestep_embedding(timesteps, embedding_dim): function nonlinearity (line 35) | def nonlinearity(x): function Normalize (line 40) | def Normalize(in_channels, default_eps, num_groups=32): class Upsample (line 47) | class Upsample(nn.Module): method __init__ (line 48) | def __init__(self, in_channels, with_conv): method forward (line 58) | def forward(self, x): class Downsample (line 65) | class Downsample(nn.Module): method __init__ (line 66) | def __init__(self, in_channels, with_conv): method forward (line 77) | def forward(self, x): class ResnetBlock (line 87) | class ResnetBlock(nn.Module): method __init__ (line 88) | def __init__(self, *, in_channels, default_eps, force_type_convert, ou... method forward (line 127) | def forward(self, x, temb): class LinAttnBlock (line 158) | class LinAttnBlock(LinearAttention): method __init__ (line 160) | def __init__(self, in_channels): class AttnBlock (line 164) | class AttnBlock(nn.Module): method __init__ (line 165) | def __init__(self, in_channels, default_eps, force_type_convert): method forward (line 192) | def forward(self, x): function make_attn (line 223) | def make_attn(in_channels, default_eps, force_type_convert, attn_type="v... class Model (line 234) | class Model(nn.Module): method __init__ (line 235) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 334) | def forward(self, x, t=None, context=None): method get_last_layer (line 382) | def get_last_layer(self): class Encoder (line 386) | class Encoder(nn.Module): method __init__ (line 387) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 459) | def forward(self, x): class Decoder (line 491) | class Decoder(nn.Module): method __init__ (line 492) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 571) | def forward(self, z): class SimpleDecoder (line 611) | class SimpleDecoder(nn.Module): method __init__ (line 612) | def __init__(self, in_channels, out_channels, *args, **kwargs): method forward (line 634) | def forward(self, x): class UpsampleDecoder (line 647) | class UpsampleDecoder(nn.Module): method __init__ (line 648) | def __init__(self, in_channels, out_channels, ch, num_res_blocks, reso... method forward (line 681) | def forward(self, x): class LatentRescaler (line 695) | class LatentRescaler(nn.Module): method __init__ (line 696) | def __init__(self, factor, in_channels, mid_channels, out_channels, de... method forward (line 720) | def forward(self, x): class MergedRescaleEncoder (line 732) | class MergedRescaleEncoder(nn.Module): method __init__ (line 733) | def __init__(self, in_channels, ch, resolution, out_ch, num_res_blocks, method forward (line 745) | def forward(self, x): class MergedRescaleDecoder (line 751) | class MergedRescaleDecoder(nn.Module): method __init__ (line 752) | def __init__(self, z_channels, out_ch, resolution, num_res_blocks, att... method forward (line 762) | def forward(self, x): class Upsampler (line 768) | class Upsampler(nn.Module): method __init__ (line 769) | def __init__(self, in_size, out_size, in_channels, out_channels, ch_mu... method forward (line 781) | def forward(self, x): class Resize (line 787) | class Resize(nn.Module): method __init__ (line 788) | def __init__(self, in_channels=None, learned=False, mode="bilinear"): method forward (line 803) | def forward(self, x, scale_factor=1.0): class FirstStagePostProcessor (line 810) | class FirstStagePostProcessor(nn.Module): method __init__ (line 812) | def __init__(self, ch_mult:list, in_channels, method instantiate_pretrained (line 847) | def instantiate_pretrained(self, config): method encode_with_pretrained (line 856) | def encode_with_pretrained(self,x): method forward (line 862) | def forward(self,x): FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/diffusionmodules/openaimodel.py function convert_module_to_f16 (line 30) | def convert_module_to_f16(l): function convert_module_to_f32 (line 40) | def convert_module_to_f32(l): function convert_some_linear_to_f16 (line 50) | def convert_some_linear_to_f16(l): function convert_some_linear_to_f32 (line 60) | def convert_some_linear_to_f32(l): class PositionEmbedding (line 70) | class PositionEmbedding(nn.Module): method __init__ (line 71) | def __init__(self, embed_dim, spacial_dim): method forward (line 74) | def forward(self): class AttentionPool2d (line 79) | class AttentionPool2d(nn.Module): method __init__ (line 84) | def __init__( method forward (line 98) | def forward(self, x): class TimestepBlock (line 109) | class TimestepBlock(nn.Module): method forward (line 115) | def forward(self, x, emb): class TimestepEmbedSequential (line 121) | class TimestepEmbedSequential(nn.Sequential, TimestepBlock): method forward (line 127) | def forward(self, x, emb, context=None): class Upsample (line 144) | class Upsample(nn.Module): method __init__ (line 153) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 162) | def forward(self, x): class TransposedUpsample (line 174) | class TransposedUpsample(nn.Module): method __init__ (line 176) | def __init__(self, channels, out_channels=None, ks=5): method forward (line 183) | def forward(self,x): class Downsample (line 187) | class Downsample(nn.Module): method __init__ (line 196) | def __init__(self, channels, use_conv, dims=2, out_channels=None,paddi... method forward (line 211) | def forward(self, x): class ResBlock (line 216) | class ResBlock(TimestepBlock): method __init__ (line 232) | def __init__( method forward (line 296) | def forward(self, x, emb): method _forward (line 311) | def _forward(self, x, emb): class AttentionBlock (line 335) | class AttentionBlock(nn.Module): method __init__ (line 342) | def __init__( method forward (line 371) | def forward(self, x): method _forward (line 375) | def _forward(self, x): function count_flops_attn (line 384) | def count_flops_attn(model, _x, y): class QKVAttentionLegacy (line 404) | class QKVAttentionLegacy(nn.Module): method __init__ (line 409) | def __init__(self, n_heads): method forward (line 413) | def forward(self, qkv): method count_flops (line 432) | def count_flops(model, _x, y): class QKVAttention (line 436) | class QKVAttention(nn.Module): method __init__ (line 441) | def __init__(self, n_heads): method forward (line 445) | def forward(self, qkv): method count_flops (line 466) | def count_flops(model, _x, y): class UNetModel (line 470) | class UNetModel(nn.Module): method __init__ (line 500) | def __init__( method convert_to_fp16 (line 761) | def convert_to_fp16(self): method convert_to_fp32 (line 773) | def convert_to_fp32(self): method forward (line 785) | def forward(self, x, timesteps=None, context=None, y=None,**kwargs): class EncoderUNetModel (line 820) | class EncoderUNetModel(nn.Module): method __init__ (line 826) | def __init__( method convert_to_fp16 (line 1002) | def convert_to_fp16(self): method convert_to_fp32 (line 1013) | def convert_to_fp32(self): method forward (line 1024) | def forward(self, x, timesteps): FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/diffusionmodules/util.py function make_beta_schedule (line 22) | def make_beta_schedule(schedule, n_timestep, linear_start=1e-4, linear_e... function make_ddim_timesteps (line 47) | def make_ddim_timesteps(ddim_discr_method, num_ddim_timesteps, num_ddpm_... function make_ddim_sampling_parameters (line 64) | def make_ddim_sampling_parameters(alphacums, ddim_timesteps, eta, verbos... function betas_for_alpha_bar (line 78) | def betas_for_alpha_bar(num_diffusion_timesteps, alpha_bar, max_beta=0.9... function extract_into_tensor (line 97) | def extract_into_tensor(a, t, x_shape): function checkpoint (line 103) | def checkpoint(func, inputs, params, flag): class CheckpointFunction (line 136) | class CheckpointFunction(torch.autograd.Function): method forward (line 139) | def forward(ctx, run_function, length, *args): method backward (line 150) | def backward(ctx, *output_grads): function timestep_embedding (line 170) | def timestep_embedding(timesteps, dim, max_period=10000, repeat_only=Fal... function zero_module (line 193) | def zero_module(module): function scale_module (line 202) | def scale_module(module, scale): function mean_flat (line 211) | def mean_flat(tensor): function normalization (line 218) | def normalization(channels): class SiLU (line 228) | class SiLU(nn.Module): method forward (line 229) | def forward(self, x): class GroupNorm32 (line 233) | class GroupNorm32(nn.GroupNorm): method forward (line 234) | def forward(self, x): function conv_nd (line 237) | def conv_nd(dims, *args, **kwargs): function linear (line 250) | def linear(*args, **kwargs): function avg_pool_nd (line 257) | def avg_pool_nd(dims, *args, **kwargs): class HybridConditioner (line 270) | class HybridConditioner(nn.Module): method __init__ (line 272) | def __init__(self, c_concat_config, c_crossattn_config): method forward (line 277) | def forward(self, c_concat, c_crossattn): function noise_like (line 283) | def noise_like(shape, device, repeat=False): FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/distributions/distributions.py class AbstractDistribution (line 5) | class AbstractDistribution: method sample (line 6) | def sample(self): method mode (line 9) | def mode(self): class DiracDistribution (line 13) | class DiracDistribution(AbstractDistribution): method __init__ (line 14) | def __init__(self, value): method sample (line 17) | def sample(self): method mode (line 20) | def mode(self): class DiagonalGaussianDistribution (line 24) | class DiagonalGaussianDistribution(object): method __init__ (line 25) | def __init__(self, parameters, deterministic=False): method sample (line 35) | def sample(self): method kl (line 39) | def kl(self, other=None): method nll (line 53) | def nll(self, sample, dims=[1,2,3]): method mode (line 61) | def mode(self): function normal_kl (line 65) | def normal_kl(mean1, logvar1, mean2, logvar2): FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/ema.py class LitEma (line 11) | class LitEma(nn.Module): method __init__ (line 12) | def __init__(self, model, decay=0.9999, decay_resume=0.9999, use_num_u... method forward (line 32) | def forward(self, model): method copy_to (line 55) | def copy_to(self, model, test=False): method store (line 67) | def store(self, parameters): method restore (line 77) | def restore(self, parameters): FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/encoders/modules.py class AbstractEncoder (line 12) | class AbstractEncoder(nn.Module): method __init__ (line 13) | def __init__(self): method encode (line 16) | def encode(self, *args, **kwargs): class ClassEmbedder (line 21) | class ClassEmbedder(nn.Module): method __init__ (line 22) | def __init__(self, embed_dim, n_classes=1000, key='class'): method forward (line 27) | def forward(self, batch, key=None): class TransformerEmbedder (line 36) | class TransformerEmbedder(AbstractEncoder): method __init__ (line 38) | def __init__(self, n_embed, n_layer, vocab_size, max_seq_len=77, devic... method forward (line 44) | def forward(self, tokens): method encode (line 49) | def encode(self, x): class BERTTokenizer (line 53) | class BERTTokenizer(AbstractEncoder): method __init__ (line 55) | def __init__(self, device="cuda", vq_interface=True, max_length=77): method forward (line 63) | def forward(self, text): method encode (line 70) | def encode(self, text): method decode (line 76) | def decode(self, text): class BERTEmbedder (line 80) | class BERTEmbedder(AbstractEncoder): method __init__ (line 82) | def __init__(self, n_embed, n_layer, vocab_size=30522, max_seq_len=77, method forward (line 93) | def forward(self, text): method encode (line 101) | def encode(self, text): class SpatialRescaler (line 106) | class SpatialRescaler(nn.Module): method __init__ (line 107) | def __init__(self, method forward (line 125) | def forward(self,x): method encode (line 134) | def encode(self, x): class FrozenCLIPEmbedder (line 137) | class FrozenCLIPEmbedder(AbstractEncoder): method __init__ (line 139) | def __init__(self, version="openai/clip-vit-large-patch14", device="cu... method freeze (line 147) | def freeze(self): method forward (line 152) | def forward(self, text): method encode (line 161) | def encode(self, text): class FrozenCLIPTextEmbedder (line 165) | class FrozenCLIPTextEmbedder(nn.Module): method __init__ (line 169) | def __init__(self, version='ViT-L/14', device="cuda", max_length=77, n... method freeze (line 177) | def freeze(self): method forward (line 182) | def forward(self, text): method encode (line 189) | def encode(self, text): class FrozenClipImageEmbedder (line 197) | class FrozenClipImageEmbedder(nn.Module): method __init__ (line 201) | def __init__( method preprocess (line 216) | def preprocess(self, x): method forward (line 226) | def forward(self, x): FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/image_degradation/bsrgan.py function modcrop_np (line 29) | def modcrop_np(img, sf): function analytic_kernel (line 49) | def analytic_kernel(k): function anisotropic_Gaussian (line 65) | def anisotropic_Gaussian(ksize=15, theta=np.pi, l1=6, l2=6): function gm_blur_kernel (line 86) | def gm_blur_kernel(mean, cov, size=15): function shift_pixel (line 99) | def shift_pixel(x, sf, upper_left=True): function blur (line 128) | def blur(x, k): function gen_kernel (line 145) | def gen_kernel(k_size=np.array([15, 15]), scale_factor=np.array([4, 4]),... function fspecial_gaussian (line 187) | def fspecial_gaussian(hsize, sigma): function fspecial_laplacian (line 201) | def fspecial_laplacian(alpha): function fspecial (line 210) | def fspecial(filter_type, *args, **kwargs): function bicubic_degradation (line 228) | def bicubic_degradation(x, sf=3): function srmd_degradation (line 240) | def srmd_degradation(x, k, sf=3): function dpsr_degradation (line 262) | def dpsr_degradation(x, k, sf=3): function classical_degradation (line 284) | def classical_degradation(x, k, sf=3): function add_sharpening (line 299) | def add_sharpening(img, weight=0.5, radius=50, threshold=10): function add_blur (line 325) | def add_blur(img, sf=4): function add_resize (line 339) | def add_resize(img, sf=4): function add_Gaussian_noise (line 369) | def add_Gaussian_noise(img, noise_level1=2, noise_level2=25): function add_speckle_noise (line 386) | def add_speckle_noise(img, noise_level1=2, noise_level2=25): function add_Poisson_noise (line 404) | def add_Poisson_noise(img): function add_JPEG_noise (line 418) | def add_JPEG_noise(img): function random_crop (line 427) | def random_crop(lq, hq, sf=4, lq_patchsize=64): function degradation_bsrgan (line 438) | def degradation_bsrgan(img, sf=4, lq_patchsize=72, isp_model=None): function degradation_bsrgan_variant (line 530) | def degradation_bsrgan_variant(image, sf=4, isp_model=None): function degradation_bsrgan_plus (line 617) | def degradation_bsrgan_plus(img, sf=4, shuffle_prob=0.5, use_sharp=True,... FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/image_degradation/bsrgan_light.py function modcrop_np (line 29) | def modcrop_np(img, sf): function analytic_kernel (line 49) | def analytic_kernel(k): function anisotropic_Gaussian (line 65) | def anisotropic_Gaussian(ksize=15, theta=np.pi, l1=6, l2=6): function gm_blur_kernel (line 86) | def gm_blur_kernel(mean, cov, size=15): function shift_pixel (line 99) | def shift_pixel(x, sf, upper_left=True): function blur (line 128) | def blur(x, k): function gen_kernel (line 145) | def gen_kernel(k_size=np.array([15, 15]), scale_factor=np.array([4, 4]),... function fspecial_gaussian (line 187) | def fspecial_gaussian(hsize, sigma): function fspecial_laplacian (line 201) | def fspecial_laplacian(alpha): function fspecial (line 210) | def fspecial(filter_type, *args, **kwargs): function bicubic_degradation (line 228) | def bicubic_degradation(x, sf=3): function srmd_degradation (line 240) | def srmd_degradation(x, k, sf=3): function dpsr_degradation (line 262) | def dpsr_degradation(x, k, sf=3): function classical_degradation (line 284) | def classical_degradation(x, k, sf=3): function add_sharpening (line 299) | def add_sharpening(img, weight=0.5, radius=50, threshold=10): function add_blur (line 325) | def add_blur(img, sf=4): function add_resize (line 343) | def add_resize(img, sf=4): function add_Gaussian_noise (line 373) | def add_Gaussian_noise(img, noise_level1=2, noise_level2=25): function add_speckle_noise (line 390) | def add_speckle_noise(img, noise_level1=2, noise_level2=25): function add_Poisson_noise (line 408) | def add_Poisson_noise(img): function add_JPEG_noise (line 422) | def add_JPEG_noise(img): function random_crop (line 431) | def random_crop(lq, hq, sf=4, lq_patchsize=64): function degradation_bsrgan (line 442) | def degradation_bsrgan(img, sf=4, lq_patchsize=72, isp_model=None): function degradation_bsrgan_variant (line 534) | def degradation_bsrgan_variant(image, sf=4, isp_model=None): FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/image_degradation/utils_image.py function is_image_file (line 29) | def is_image_file(filename): function get_timestamp (line 33) | def get_timestamp(): function imshow (line 37) | def imshow(x, title=None, cbar=False, figsize=None): function surf (line 47) | def surf(Z, cmap='rainbow', figsize=None): function get_image_paths (line 67) | def get_image_paths(dataroot): function _get_paths_from_images (line 74) | def _get_paths_from_images(path): function patches_from_image (line 93) | def patches_from_image(img, p_size=512, p_overlap=64, p_max=800): function imssave (line 112) | def imssave(imgs, img_path): function split_imageset (line 125) | def split_imageset(original_dataroot, taget_dataroot, n_channels=3, p_si... function mkdir (line 153) | def mkdir(path): function mkdirs (line 158) | def mkdirs(paths): function mkdir_and_rename (line 166) | def mkdir_and_rename(path): function imread_uint (line 185) | def imread_uint(path, n_channels=3): function imsave (line 203) | def imsave(img, img_path): function imwrite (line 209) | def imwrite(img, img_path): function read_img (line 220) | def read_img(path): function uint2single (line 249) | def uint2single(img): function single2uint (line 254) | def single2uint(img): function uint162single (line 259) | def uint162single(img): function single2uint16 (line 264) | def single2uint16(img): function uint2tensor4 (line 275) | def uint2tensor4(img): function uint2tensor3 (line 282) | def uint2tensor3(img): function tensor2uint (line 289) | def tensor2uint(img): function single2tensor3 (line 302) | def single2tensor3(img): function single2tensor4 (line 307) | def single2tensor4(img): function tensor2single (line 312) | def tensor2single(img): function tensor2single3 (line 320) | def tensor2single3(img): function single2tensor5 (line 329) | def single2tensor5(img): function single32tensor5 (line 333) | def single32tensor5(img): function single42tensor4 (line 337) | def single42tensor4(img): function tensor2img (line 342) | def tensor2img(tensor, out_type=np.uint8, min_max=(0, 1)): function augment_img (line 380) | def augment_img(img, mode=0): function augment_img_tensor4 (line 401) | def augment_img_tensor4(img, mode=0): function augment_img_tensor (line 422) | def augment_img_tensor(img, mode=0): function augment_img_np3 (line 441) | def augment_img_np3(img, mode=0): function augment_imgs (line 469) | def augment_imgs(img_list, hflip=True, rot=True): function modcrop (line 494) | def modcrop(img_in, scale): function shave (line 510) | def shave(img_in, border=0): function rgb2ycbcr (line 529) | def rgb2ycbcr(img, only_y=True): function ycbcr2rgb (line 553) | def ycbcr2rgb(img): function bgr2ycbcr (line 573) | def bgr2ycbcr(img, only_y=True): function channel_convert (line 597) | def channel_convert(in_c, tar_type, img_list): function calculate_psnr (line 621) | def calculate_psnr(img1, img2, border=0): function calculate_ssim (line 642) | def calculate_ssim(img1, img2, border=0): function ssim (line 669) | def ssim(img1, img2): function cubic (line 700) | def cubic(x): function calculate_weights_indices (line 708) | def calculate_weights_indices(in_length, out_length, scale, kernel, kern... function imresize (line 766) | def imresize(img, scale, antialiasing=True): function imresize_np (line 839) | def imresize_np(img, scale, antialiasing=True): FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/losses/contperceptual.py class LPIPSWithDiscriminator (line 7) | class LPIPSWithDiscriminator(nn.Module): method __init__ (line 8) | def __init__(self, disc_start, logvar_init=0.0, kl_weight=1.0, pixello... method calculate_adaptive_weight (line 32) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method forward (line 45) | def forward(self, inputs, reconstructions, posteriors, optimizer_idx, FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/losses/vqperceptual.py function hinge_d_loss_with_exemplar_weights (line 11) | def hinge_d_loss_with_exemplar_weights(logits_real, logits_fake, weights): function adopt_weight (line 20) | def adopt_weight(weight, global_step, threshold=0, value=0.): function measure_perplexity (line 26) | def measure_perplexity(predicted_indices, n_embed): function l1 (line 35) | def l1(x, y): function l2 (line 39) | def l2(x, y): class VQLPIPSWithDiscriminator (line 43) | class VQLPIPSWithDiscriminator(nn.Module): method __init__ (line 44) | def __init__(self, disc_start, codebook_weight=1.0, pixelloss_weight=1.0, method calculate_adaptive_weight (line 85) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method forward (line 98) | def forward(self, codebook_loss, inputs, reconstructions, optimizer_idx, FILE: models/InstructDiffusion/stable_diffusion/ldm/modules/x_transformer.py class AbsolutePositionalEmbedding (line 25) | class AbsolutePositionalEmbedding(nn.Module): method __init__ (line 26) | def __init__(self, dim, max_seq_len): method init_ (line 31) | def init_(self): method forward (line 34) | def forward(self, x): class FixedPositionalEmbedding (line 39) | class FixedPositionalEmbedding(nn.Module): method __init__ (line 40) | def __init__(self, dim): method forward (line 45) | def forward(self, x, seq_dim=1, offset=0): function exists (line 54) | def exists(val): function default (line 58) | def default(val, d): function always (line 64) | def always(val): function not_equals (line 70) | def not_equals(val): function equals (line 76) | def equals(val): function max_neg_value (line 82) | def max_neg_value(tensor): function pick_and_pop (line 88) | def pick_and_pop(keys, d): function group_dict_by_key (line 93) | def group_dict_by_key(cond, d): function string_begins_with (line 102) | def string_begins_with(prefix, str): function group_by_key_prefix (line 106) | def group_by_key_prefix(prefix, d): function groupby_prefix_and_trim (line 110) | def groupby_prefix_and_trim(prefix, d): class Scale (line 117) | class Scale(nn.Module): method __init__ (line 118) | def __init__(self, value, fn): method forward (line 123) | def forward(self, x, **kwargs): class Rezero (line 128) | class Rezero(nn.Module): method __init__ (line 129) | def __init__(self, fn): method forward (line 134) | def forward(self, x, **kwargs): class ScaleNorm (line 139) | class ScaleNorm(nn.Module): method __init__ (line 140) | def __init__(self, dim, eps=1e-5): method forward (line 146) | def forward(self, x): class RMSNorm (line 151) | class RMSNorm(nn.Module): method __init__ (line 152) | def __init__(self, dim, eps=1e-8): method forward (line 158) | def forward(self, x): class Residual (line 163) | class Residual(nn.Module): method forward (line 164) | def forward(self, x, residual): class GRUGating (line 168) | class GRUGating(nn.Module): method __init__ (line 169) | def __init__(self, dim): method forward (line 173) | def forward(self, x, residual): class GEGLU (line 184) | class GEGLU(nn.Module): method __init__ (line 185) | def __init__(self, dim_in, dim_out): method forward (line 189) | def forward(self, x): class FeedForward (line 194) | class FeedForward(nn.Module): method __init__ (line 195) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.): method forward (line 210) | def forward(self, x): class Attention (line 215) | class Attention(nn.Module): method __init__ (line 216) | def __init__( method forward (line 268) | def forward( class AttentionLayers (line 370) | class AttentionLayers(nn.Module): method __init__ (line 371) | def __init__( method forward (line 481) | def forward( class Encoder (line 541) | class Encoder(AttentionLayers): method __init__ (line 542) | def __init__(self, **kwargs): class TransformerWrapper (line 548) | class TransformerWrapper(nn.Module): method __init__ (line 549) | def __init__( method init_ (line 595) | def init_(self): method forward (line 598) | def forward( FILE: models/InstructDiffusion/stable_diffusion/ldm/util.py function log_txt_as_img (line 17) | def log_txt_as_img(wh, xc, size=10): function ismap (line 41) | def ismap(x): function isimage (line 47) | def isimage(x): function exists (line 53) | def exists(x): function default (line 57) | def default(val, d): function mean_flat (line 63) | def mean_flat(tensor): function count_params (line 71) | def count_params(model, verbose=False): function instantiate_from_config (line 78) | def instantiate_from_config(config): function get_obj_from_str (line 88) | def get_obj_from_str(string, reload=False): function _do_parallel_data_prefetch (line 96) | def _do_parallel_data_prefetch(func, Q, data, idx, idx_to_fn=False): function parallel_data_prefetch (line 108) | def parallel_data_prefetch( FILE: models/InstructDiffusion/stable_diffusion/main.py function get_parser (line 24) | def get_parser(**parser_kwargs): function nondefault_trainer_args (line 126) | def nondefault_trainer_args(opt): class WrappedDataset (line 133) | class WrappedDataset(Dataset): method __init__ (line 136) | def __init__(self, dataset): method __len__ (line 139) | def __len__(self): method __getitem__ (line 142) | def __getitem__(self, idx): function worker_init_fn (line 146) | def worker_init_fn(_): class DataModuleFromConfig (line 162) | class DataModuleFromConfig(pl.LightningDataModule): method __init__ (line 163) | def __init__(self, batch_size, train=None, validation=None, test=None,... method prepare_data (line 185) | def prepare_data(self): method setup (line 189) | def setup(self, stage=None): method _train_dataloader (line 197) | def _train_dataloader(self): method _val_dataloader (line 207) | def _val_dataloader(self, shuffle=False): method _test_dataloader (line 218) | def _test_dataloader(self, shuffle=False): method _predict_dataloader (line 231) | def _predict_dataloader(self, shuffle=False): class SetupCallback (line 240) | class SetupCallback(Callback): method __init__ (line 241) | def __init__(self, resume, now, logdir, ckptdir, cfgdir, config, light... method on_keyboard_interrupt (line 251) | def on_keyboard_interrupt(self, trainer, pl_module): method on_pretrain_routine_start (line 257) | def on_pretrain_routine_start(self, trainer, pl_module): class ImageLogger (line 289) | class ImageLogger(Callback): method __init__ (line 290) | def __init__(self, batch_frequency, max_images, clamp=True, increase_l... method _testtube (line 310) | def _testtube(self, pl_module, images, batch_idx, split): method log_local (line 321) | def log_local(self, save_dir, split, images, method log_img (line 340) | def log_img(self, pl_module, batch, batch_idx, split="train"): method check_frequency (line 372) | def check_frequency(self, check_idx): method on_train_batch_end (line 383) | def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch... method on_validation_batch_end (line 387) | def on_validation_batch_end(self, trainer, pl_module, outputs, batch, ... class CUDACallback (line 395) | class CUDACallback(Callback): method on_train_epoch_start (line 397) | def on_train_epoch_start(self, trainer, pl_module): method on_train_epoch_end (line 403) | def on_train_epoch_end(self, trainer, pl_module, outputs): function melk (line 697) | def melk(*args, **kwargs): function divein (line 705) | def divein(*args, **kwargs): FILE: models/InstructDiffusion/stable_diffusion/notebook_helpers.py function download_models (line 19) | def download_models(mode): function load_model_from_config (line 40) | def load_model_from_config(config, ckpt): function get_model (line 52) | def get_model(mode): function get_custom_cond (line 59) | def get_custom_cond(mode): function get_cond_options (line 85) | def get_cond_options(mode): function select_cond_path (line 92) | def select_cond_path(mode): function get_cond (line 107) | def get_cond(mode, selected_path): function visualize_cond_img (line 127) | def visualize_cond_img(path): function run (line 131) | def run(model, selected_path, task, custom_steps, resize_enabled=False, ... function convsample_ddim (line 188) | def convsample_ddim(model, cond, steps, shape, eta=1.0, callback=None, n... function make_convolutional_sample (line 208) | def make_convolutional_sample(batch, model, mode="vanilla", custom_steps... FILE: models/InstructDiffusion/stable_diffusion/scripts/img2img.py function chunk (line 23) | def chunk(it, size): function load_model_from_config (line 28) | def load_model_from_config(config, ckpt, verbose=False): function load_img (line 48) | def load_img(path): function main (line 60) | def main(): FILE: models/InstructDiffusion/stable_diffusion/scripts/inpaint.py function make_batch (line 11) | def make_batch(image, mask, device): FILE: models/InstructDiffusion/stable_diffusion/scripts/knn2img.py function chunk (line 36) | def chunk(it, size): function load_model_from_config (line 41) | def load_model_from_config(config, ckpt, verbose=False): class Searcher (line 61) | class Searcher(object): method __init__ (line 62) | def __init__(self, database, retriever_version='ViT-L/14'): method train_searcher (line 75) | def train_searcher(self, k, method load_single_file (line 91) | def load_single_file(self, saved_embeddings): method load_multi_files (line 96) | def load_multi_files(self, data_archive): method load_database (line 104) | def load_database(self): method load_retriever (line 123) | def load_retriever(self, version='ViT-L/14', ): method load_searcher (line 130) | def load_searcher(self): method search (line 135) | def search(self, x, k): method __call__ (line 163) | def __call__(self, x, n): FILE: models/InstructDiffusion/stable_diffusion/scripts/sample_diffusion.py function custom_to_pil (line 15) | def custom_to_pil(x): function custom_to_np (line 27) | def custom_to_np(x): function logs2pil (line 36) | def logs2pil(logs, keys=["sample"]): function convsample (line 54) | def convsample(model, shape, return_intermediates=True, function convsample_ddim (line 69) | def convsample_ddim(model, steps, shape, eta=1.0 function make_convolutional_sample (line 79) | def make_convolutional_sample(model, batch_size, vanilla=False, custom_s... function run (line 108) | def run(model, logdir, batch_size=50, vanilla=False, custom_steps=None, ... function save_logs (line 143) | def save_logs(logs, path, n_saved=0, key="sample", np_path=None): function get_parser (line 162) | def get_parser(): function load_model_from_config (line 220) | def load_model_from_config(config, sd): function load_model (line 228) | def load_model(config, ckpt, gpu, eval_mode): FILE: models/InstructDiffusion/stable_diffusion/scripts/tests/test_watermark.py function testit (line 6) | def testit(img_path): FILE: models/InstructDiffusion/stable_diffusion/scripts/train_searcher.py function search_bruteforce (line 12) | def search_bruteforce(searcher): function search_partioned_ah (line 16) | def search_partioned_ah(searcher, dims_per_block, aiq_threshold, reorder_k, function search_ah (line 24) | def search_ah(searcher, dims_per_block, aiq_threshold, reorder_k): function load_datapool (line 28) | def load_datapool(dpath): function train_searcher (line 62) | def train_searcher(opt, FILE: models/InstructDiffusion/stable_diffusion/scripts/txt2img.py function chunk (line 32) | def chunk(it, size): function numpy_to_pil (line 37) | def numpy_to_pil(images): function load_model_from_config (line 49) | def load_model_from_config(config, ckpt, verbose=False): function put_watermark (line 69) | def put_watermark(img, wm_encoder=None): function load_replacement (line 77) | def load_replacement(x): function check_safety (line 88) | def check_safety(x_image): function main (line 98) | def main(): FILE: models/InstructDiffusion/utils/deepspeed.py function create_ds_config (line 7) | def create_ds_config(args, config, cfgdir): FILE: models/InstructDiffusion/utils/logger.py function create_logger (line 16) | def create_logger(output_dir, dist_rank=0, name=''): FILE: models/InstructDiffusion/utils/utils.py function load_checkpoint (line 14) | def load_checkpoint(file_name, config, model, model_ema, optimizer, lr_s... function save_checkpoint (line 55) | def save_checkpoint(ckptdir, config, epoch, model, model_ema, max_accura... function get_grad_norm (line 90) | def get_grad_norm(parameters, norm_type=2): function auto_resume_helper (line 103) | def auto_resume_helper(config, output_dir): function reduce_tensor (line 128) | def reduce_tensor(tensor): function ampscaler_get_grad_norm (line 135) | def ampscaler_get_grad_norm(parameters, norm_type: float = 2.0) -> torch... class NativeScalerWithGradNormCount (line 151) | class NativeScalerWithGradNormCount: method __init__ (line 154) | def __init__(self): method __call__ (line 157) | def __call__(self, loss, optimizer, clip_grad=None, parameters=None, c... method state_dict (line 173) | def state_dict(self): method load_state_dict (line 176) | def load_state_dict(self, state_dict): FILE: models/edict/edict_functions.py function EDICT_editing (line 56) | def EDICT_editing(im_path, function recon_test (line 118) | def recon_test(im, steps=50, strength=1.0, function im_to_np (line 170) | def im_to_np(im): function img2img_editing (line 173) | def img2img_editing(im_path, function center_crop (line 190) | def center_crop(im): function load_im_into_format_from_path (line 203) | def load_im_into_format_from_path(im_path): function init_attention_weights (line 208) | def init_attention_weights(weight_tuples): function init_attention_edit (line 225) | def init_attention_edit(tokens, tokens_edit): function init_attention_func (line 250) | def init_attention_func(): function use_last_tokens_attention (line 299) | def use_last_tokens_attention(use=True): function use_last_tokens_attention_weights (line 305) | def use_last_tokens_attention_weights(use=True): function use_last_self_attention (line 311) | def use_last_self_attention(use=True): function save_last_tokens_attention (line 317) | def save_last_tokens_attention(save=True): function save_last_self_attention (line 323) | def save_last_self_attention(save=True): function baseline_stablediffusion (line 334) | def baseline_stablediffusion(prompt="", function get_alpha_and_beta (line 599) | def get_alpha_and_beta(t, scheduler): function forward_step (line 621) | def forward_step( function reverse_step (line 653) | def reverse_step( function latent_to_image (line 690) | def latent_to_image(latent): function prep_image_for_return (line 695) | def prep_image_for_return(image): function coupled_stablediffusion (line 708) | def coupled_stablediffusion(prompt="", FILE: models/edict/my_diffusers/commands/__init__.py class BaseDiffusersCLICommand (line 19) | class BaseDiffusersCLICommand(ABC): method register_subcommand (line 22) | def register_subcommand(parser: ArgumentParser): method run (line 26) | def run(self): FILE: models/edict/my_diffusers/commands/diffusers_cli.py function main (line 21) | def main(): FILE: models/edict/my_diffusers/commands/env.py function info_command_factory (line 25) | def info_command_factory(_): class EnvironmentCommand (line 29) | class EnvironmentCommand(BaseDiffusersCLICommand): method register_subcommand (line 31) | def register_subcommand(parser: ArgumentParser): method run (line 35) | def run(self): method format_dict (line 69) | def format_dict(d): FILE: models/edict/my_diffusers/configuration_utils.py class ConfigMixin (line 38) | class ConfigMixin: method register_to_config (line 54) | def register_to_config(self, **kwargs): method save_config (line 76) | def save_config(self, save_directory: Union[str, os.PathLike], push_to... method from_config (line 97) | def from_config(cls, pretrained_model_name_or_path: Union[str, os.Path... method get_config_dict (line 168) | def get_config_dict( method extract_init_dict (line 268) | def extract_init_dict(cls, config_dict, **kwargs): method _dict_from_json_file (line 297) | def _dict_from_json_file(cls, json_file: Union[str, os.PathLike]): method __repr__ (line 302) | def __repr__(self): method config (line 306) | def config(self) -> Dict[str, Any]: method to_json_string (line 309) | def to_json_string(self) -> str: method to_json_file (line 319) | def to_json_file(self, json_file_path: Union[str, os.PathLike]): class FrozenDict (line 331) | class FrozenDict(OrderedDict): method __init__ (line 332) | def __init__(self, *args, **kwargs): method __delitem__ (line 340) | def __delitem__(self, *args, **kwargs): method setdefault (line 343) | def setdefault(self, *args, **kwargs): method pop (line 346) | def pop(self, *args, **kwargs): method update (line 349) | def update(self, *args, **kwargs): method __setattr__ (line 352) | def __setattr__(self, name, value): method __setitem__ (line 357) | def __setitem__(self, name, value): function register_to_config (line 363) | def register_to_config(init): FILE: models/edict/my_diffusers/dependency_versions_check.py function dep_version_check (line 46) | def dep_version_check(pkg, hint=None): FILE: models/edict/my_diffusers/dynamic_modules_utils.py function init_hf_modules (line 33) | def init_hf_modules(): function create_dynamic_module (line 48) | def create_dynamic_module(name: Union[str, os.PathLike]): function get_relative_imports (line 63) | def get_relative_imports(module_file): function get_relative_import_files (line 81) | def get_relative_import_files(module_file): function check_imports (line 110) | def check_imports(filename): function get_class_in_module (line 142) | def get_class_in_module(class_name, module_path): function get_cached_module_file (line 151) | def get_cached_module_file( function get_class_from_dynamic_module (line 249) | def get_class_from_dynamic_module( FILE: models/edict/my_diffusers/hub_utils.py function get_full_repo_name (line 38) | def get_full_repo_name(model_id: str, organization: Optional[str] = None... function init_git_repo (line 48) | def init_git_repo(args, at_init: bool = False): function push_to_hub (line 96) | def push_to_hub( function create_model_card (line 152) | def create_model_card(args, model_name): FILE: models/edict/my_diffusers/modeling_utils.py function get_parameter_device (line 36) | def get_parameter_device(parameter: torch.nn.Module): function get_parameter_dtype (line 51) | def get_parameter_dtype(parameter: torch.nn.Module): function load_state_dict (line 66) | def load_state_dict(checkpoint_file: Union[str, os.PathLike]): function _load_state_dict_into_model (line 94) | def _load_state_dict_into_model(model_to_load, state_dict): class ModelMixin (line 115) | class ModelMixin(torch.nn.Module): method __init__ (line 128) | def __init__(self): method save_pretrained (line 131) | def save_pretrained( method from_pretrained (line 182) | def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union... method _load_pretrained_model (line 384) | def _load_pretrained_model( method device (line 488) | def device(self) -> device: method dtype (line 496) | def dtype(self) -> torch.dtype: method num_parameters (line 502) | def num_parameters(self, only_trainable: bool = False, exclude_embeddi... function unwrap_model (line 531) | def unwrap_model(model: torch.nn.Module) -> torch.nn.Module: FILE: models/edict/my_diffusers/models/attention.py class AttentionBlock (line 9) | class AttentionBlock(nn.Module): method __init__ (line 25) | def __init__( method transpose_for_scores (line 48) | def transpose_for_scores(self, projection: torch.Tensor) -> torch.Tensor: method forward (line 54) | def forward(self, hidden_states): class SpatialTransformer (line 95) | class SpatialTransformer(nn.Module): method __init__ (line 109) | def __init__( method _set_attention_slice (line 136) | def _set_attention_slice(self, slice_size): method forward (line 140) | def forward(self, x, context=None): class BasicTransformerBlock (line 154) | class BasicTransformerBlock(nn.Module): method __init__ (line 168) | def __init__( method _set_attention_slice (line 191) | def _set_attention_slice(self, slice_size): method forward (line 195) | def forward(self, x, context=None): class CrossAttention (line 203) | class CrossAttention(nn.Module): method __init__ (line 216) | def __init__( method reshape_heads_to_batch_dim (line 236) | def reshape_heads_to_batch_dim(self, tensor): method reshape_batch_dim_to_heads (line 243) | def reshape_batch_dim_to_heads(self, tensor): method forward (line 250) | def forward(self, x, context=None, mask=None): method _attention (line 269) | def _attention(self, query, key, value, sequence_length, dim): class FeedForward (line 291) | class FeedForward(nn.Module): method __init__ (line 303) | def __init__( method forward (line 313) | def forward(self, x): class GEGLU (line 318) | class GEGLU(nn.Module): method __init__ (line 327) | def __init__(self, dim_in: int, dim_out: int): method forward (line 331) | def forward(self, x): FILE: models/edict/my_diffusers/models/embeddings.py function get_timestep_embedding (line 21) | def get_timestep_embedding( class TimestepEmbedding (line 63) | class TimestepEmbedding(nn.Module): method __init__ (line 64) | def __init__(self, channel: int, time_embed_dim: int, act_fn: str = "s... method forward (line 73) | def forward(self, sample): class Timesteps (line 83) | class Timesteps(nn.Module): method __init__ (line 84) | def __init__(self, num_channels: int, flip_sin_to_cos: bool, downscale... method forward (line 90) | def forward(self, timesteps): class GaussianFourierProjection (line 100) | class GaussianFourierProjection(nn.Module): method __init__ (line 103) | def __init__(self, embedding_size: int = 256, scale: float = 1.0): method forward (line 112) | def forward(self, x): FILE: models/edict/my_diffusers/models/resnet.py class Upsample2D (line 9) | class Upsample2D(nn.Module): method __init__ (line 18) | def __init__(self, channels, use_conv=False, use_conv_transpose=False,... method forward (line 38) | def forward(self, x): class Downsample2D (line 55) | class Downsample2D(nn.Module): method __init__ (line 64) | def __init__(self, channels, use_conv=False, out_channels=None, paddin... method forward (line 88) | def forward(self, x): class FirUpsample2D (line 100) | class FirUpsample2D(nn.Module): method __init__ (line 101) | def __init__(self, channels=None, out_channels=None, use_conv=False, f... method _upsample_2d (line 110) | def _upsample_2d(self, x, weight=None, kernel=None, factor=2, gain=1): method forward (line 179) | def forward(self, x): class FirDownsample2D (line 189) | class FirDownsample2D(nn.Module): method __init__ (line 190) | def __init__(self, channels=None, out_channels=None, use_conv=False, f... method _downsample_2d (line 199) | def _downsample_2d(self, x, weight=None, kernel=None, factor=2, gain=1): method forward (line 241) | def forward(self, x): class ResnetBlock2D (line 251) | class ResnetBlock2D(nn.Module): method __init__ (line 252) | def __init__( method forward (line 331) | def forward(self, x, temb): class Mish (line 368) | class Mish(torch.nn.Module): method forward (line 369) | def forward(self, x): function upsample_2d (line 373) | def upsample_2d(x, kernel=None, factor=2, gain=1): function downsample_2d (line 406) | def downsample_2d(x, kernel=None, factor=2, gain=1): function upfirdn2d_native (line 438) | def upfirdn2d_native(input, kernel, up=1, down=1, pad=(0, 0)): FILE: models/edict/my_diffusers/models/unet_2d.py class UNet2DOutput (line 15) | class UNet2DOutput(BaseOutput): class UNet2DModel (line 25) | class UNet2DModel(ModelMixin, ConfigMixin): method __init__ (line 59) | def __init__( method forward (line 165) | def forward( FILE: models/edict/my_diffusers/models/unet_2d_condition.py class UNet2DConditionOutput (line 15) | class UNet2DConditionOutput(BaseOutput): class UNet2DConditionModel (line 25) | class UNet2DConditionModel(ModelMixin, ConfigMixin): method __init__ (line 58) | def __init__( method set_attention_slice (line 167) | def set_attention_slice(self, slice_size): method forward (line 189) | def forward( FILE: models/edict/my_diffusers/models/unet_blocks.py function get_down_block (line 24) | def get_down_block( function get_up_block (line 111) | def get_up_block( class UNetMidBlock2D (line 198) | class UNetMidBlock2D(nn.Module): method __init__ (line 199) | def __init__( method forward (line 265) | def forward(self, hidden_states, temb=None, encoder_states=None): class UNetMidBlock2DCrossAttn (line 277) | class UNetMidBlock2DCrossAttn(nn.Module): method __init__ (line 278) | def __init__( method set_attention_slice (line 346) | def set_attention_slice(self, slice_size): method forward (line 361) | def forward(self, hidden_states, temb=None, encoder_hidden_states=None): class AttnDownBlock2D (line 370) | class AttnDownBlock2D(nn.Module): method __init__ (line 371) | def __init__( method forward (line 434) | def forward(self, hidden_states, temb=None): class CrossAttnDownBlock2D (line 451) | class CrossAttnDownBlock2D(nn.Module): method __init__ (line 452) | def __init__( method set_attention_slice (line 517) | def set_attention_slice(self, slice_size): method forward (line 532) | def forward(self, hidden_states, temb=None, encoder_hidden_states=None): class DownBlock2D (line 549) | class DownBlock2D(nn.Module): method __init__ (line 550) | def __init__( method forward (line 599) | def forward(self, hidden_states, temb=None): class DownEncoderBlock2D (line 615) | class DownEncoderBlock2D(nn.Module): method __init__ (line 616) | def __init__( method forward (line 664) | def forward(self, hidden_states): class AttnDownEncoderBlock2D (line 675) | class AttnDownEncoderBlock2D(nn.Module): method __init__ (line 676) | def __init__( method forward (line 736) | def forward(self, hidden_states): class AttnSkipDownBlock2D (line 748) | class AttnSkipDownBlock2D(nn.Module): method __init__ (line 749) | def __init__( method forward (line 821) | def forward(self, hidden_states, temb=None, skip_sample=None): class SkipDownBlock2D (line 841) | class SkipDownBlock2D(nn.Module): method __init__ (line 842) | def __init__( method forward (line 901) | def forward(self, hidden_states, temb=None, skip_sample=None): class AttnUpBlock2D (line 920) | class AttnUpBlock2D(nn.Module): method __init__ (line 921) | def __init__( method forward (line 980) | def forward(self, hidden_states, res_hidden_states_tuple, temb=None): class CrossAttnUpBlock2D (line 998) | class CrossAttnUpBlock2D(nn.Module): method __init__ (line 999) | def __init__( method set_attention_slice (line 1061) | def set_attention_slice(self, slice_size): method forward (line 1076) | def forward(self, hidden_states, res_hidden_states_tuple, temb=None, e... class UpBlock2D (line 1094) | class UpBlock2D(nn.Module): method __init__ (line 1095) | def __init__( method forward (line 1140) | def forward(self, hidden_states, res_hidden_states_tuple, temb=None): class UpDecoderBlock2D (line 1157) | class UpDecoderBlock2D(nn.Module): method __init__ (line 1158) | def __init__( method forward (line 1200) | def forward(self, hidden_states): class AttnUpDecoderBlock2D (line 1211) | class AttnUpDecoderBlock2D(nn.Module): method __init__ (line 1212) | def __init__( method forward (line 1266) | def forward(self, hidden_states): class AttnSkipUpBlock2D (line 1278) | class AttnSkipUpBlock2D(nn.Module): method __init__ (line 1279) | def __init__( method forward (line 1361) | def forward(self, hidden_states, res_hidden_states_tuple, temb=None, s... class SkipUpBlock2D (line 1389) | class SkipUpBlock2D(nn.Module): method __init__ (line 1390) | def __init__( method forward (line 1458) | def forward(self, hidden_states, res_hidden_states_tuple, temb=None, s... FILE: models/edict/my_diffusers/models/vae.py class DecoderOutput (line 15) | class DecoderOutput(BaseOutput): class VQEncoderOutput (line 28) | class VQEncoderOutput(BaseOutput): class AutoencoderKLOutput (line 41) | class AutoencoderKLOutput(BaseOutput): class Encoder (line 54) | class Encoder(nn.Module): method __init__ (line 55) | def __init__( method forward (line 114) | def forward(self, x): class Decoder (line 133) | class Decoder(nn.Module): method __init__ (line 134) | def __init__( method forward (line 193) | def forward(self, z): class VectorQuantizer (line 212) | class VectorQuantizer(nn.Module): method __init__ (line 221) | def __init__(self, n_e, e_dim, beta, remap=None, unknown_index="random... method remap_to_used (line 248) | def remap_to_used(self, inds): method unmap_to_all (line 262) | def unmap_to_all(self, inds): method forward (line 272) | def forward(self, z): method get_codebook_entry (line 311) | def get_codebook_entry(self, indices, shape): class DiagonalGaussianDistribution (line 329) | class DiagonalGaussianDistribution(object): method __init__ (line 330) | def __init__(self, parameters, deterministic=False): method sample (line 340) | def sample(self, generator: Optional[torch.Generator] = None) -> torch... method kl (line 347) | def kl(self, other=None): method nll (line 363) | def nll(self, sample, dims=[1, 2, 3]): method mode (line 369) | def mode(self): class VQModel (line 373) | class VQModel(ModelMixin, ConfigMixin): method __init__ (line 396) | def __init__( method encode (line 438) | def encode(self, x: torch.FloatTensor, return_dict: bool = True) -> VQ... method decode (line 447) | def decode( method forward (line 463) | def forward(self, sample: torch.FloatTensor, return_dict: bool = True)... class AutoencoderKL (line 480) | class AutoencoderKL(ModelMixin, ConfigMixin): method __init__ (line 502) | def __init__( method encode (line 540) | def encode(self, x: torch.FloatTensor, return_dict: bool = True) -> Au... method decode (line 550) | def decode(self, z: torch.FloatTensor, return_dict: bool = True) -> Un... method forward (line 559) | def forward( FILE: models/edict/my_diffusers/onnx_utils.py class OnnxRuntimeModel (line 40) | class OnnxRuntimeModel: method __init__ (line 43) | def __init__(self, model=None, **kwargs): method __call__ (line 49) | def __call__(self, **kwargs): method load_model (line 54) | def load_model(path: Union[str, Path], provider=None): method _save_pretrained (line 70) | def _save_pretrained(self, save_directory: Union[str, Path], file_name... method save_pretrained (line 90) | def save_pretrained( method _from_pretrained (line 113) | def _from_pretrained( method from_pretrained (line 170) | def from_pretrained( FILE: models/edict/my_diffusers/optimization.py class SchedulerType (line 30) | class SchedulerType(Enum): function get_constant_schedule (line 39) | def get_constant_schedule(optimizer: Optimizer, last_epoch: int = -1): function get_constant_schedule_with_warmup (line 55) | def get_constant_schedule_with_warmup(optimizer: Optimizer, num_warmup_s... function get_linear_schedule_with_warmup (line 80) | def get_linear_schedule_with_warmup(optimizer, num_warmup_steps, num_tra... function get_cosine_schedule_with_warmup (line 109) | def get_cosine_schedule_with_warmup( function get_cosine_with_hard_restarts_schedule_with_warmup (line 143) | def get_cosine_with_hard_restarts_schedule_with_warmup( function get_polynomial_decay_schedule_with_warmup (line 178) | def get_polynomial_decay_schedule_with_warmup( function get_scheduler (line 238) | def get_scheduler( FILE: models/edict/my_diffusers/pipeline_utils.py class ImagePipelineOutput (line 63) | class ImagePipelineOutput(BaseOutput): class DiffusionPipeline (line 76) | class DiffusionPipeline(ConfigMixin): method register_modules (line 93) | def register_modules(self, **kwargs): method save_pretrained (line 123) | def save_pretrained(self, save_directory: Union[str, os.PathLike]): method to (line 160) | def to(self, torch_device: Optional[Union[str, torch.device]] = None): method device (line 172) | def device(self) -> torch.device: method from_pretrained (line 185) | def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union... method numpy_to_pil (line 395) | def numpy_to_pil(images): method progress_bar (line 406) | def progress_bar(self, iterable): method set_progress_bar_config (line 416) | def set_progress_bar_config(self, **kwargs): FILE: models/edict/my_diffusers/pipelines/ddim/pipeline_ddim.py class DDIMPipeline (line 25) | class DDIMPipeline(DiffusionPipeline): method __init__ (line 37) | def __init__(self, unet, scheduler): method __call__ (line 43) | def __call__( FILE: models/edict/my_diffusers/pipelines/ddpm/pipeline_ddpm.py class DDPMPipeline (line 25) | class DDPMPipeline(DiffusionPipeline): method __init__ (line 37) | def __init__(self, unet, scheduler): method __call__ (line 43) | def __call__( FILE: models/edict/my_diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py class LDMTextToImagePipeline (line 21) | class LDMTextToImagePipeline(DiffusionPipeline): method __init__ (line 40) | def __init__( method __call__ (line 53) | def __call__( class LDMBertConfig (line 202) | class LDMBertConfig(PretrainedConfig): method __init__ (line 207) | def __init__( function _expand_mask (line 249) | def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Option... class LDMBertAttention (line 264) | class LDMBertAttention(nn.Module): method __init__ (line 267) | def __init__( method _shape (line 291) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 294) | def forward( class LDMBertEncoderLayer (line 408) | class LDMBertEncoderLayer(nn.Module): method __init__ (line 409) | def __init__(self, config: LDMBertConfig): method forward (line 426) | def forward( class LDMBertPreTrainedModel (line 478) | class LDMBertPreTrainedModel(PreTrainedModel): method _init_weights (line 484) | def _init_weights(self, module): method _set_gradient_checkpointing (line 495) | def _set_gradient_checkpointing(self, module, value=False): method dummy_inputs (line 500) | def dummy_inputs(self): class LDMBertEncoder (line 510) | class LDMBertEncoder(LDMBertPreTrainedModel): method __init__ (line 520) | def __init__(self, config: LDMBertConfig): method get_input_embeddings (line 538) | def get_input_embeddings(self): method set_input_embeddings (line 541) | def set_input_embeddings(self, value): method forward (line 544) | def forward( class LDMBertModel (line 677) | class LDMBertModel(LDMBertPreTrainedModel): method __init__ (line 678) | def __init__(self, config: LDMBertConfig): method forward (line 683) | def forward( FILE: models/edict/my_diffusers/pipelines/latent_diffusion_uncond/pipeline_latent_diffusion_uncond.py class LDMPipeline (line 12) | class LDMPipeline(DiffusionPipeline): method __init__ (line 25) | def __init__(self, vqvae: VQModel, unet: UNet2DModel, scheduler: DDIMS... method __call__ (line 31) | def __call__( FILE: models/edict/my_diffusers/pipelines/pndm/pipeline_pndm.py class PNDMPipeline (line 27) | class PNDMPipeline(DiffusionPipeline): method __init__ (line 41) | def __init__(self, unet: UNet2DModel, scheduler: PNDMScheduler): method __call__ (line 47) | def __call__( FILE: models/edict/my_diffusers/pipelines/score_sde_ve/pipeline_score_sde_ve.py class ScoreSdeVePipeline (line 12) | class ScoreSdeVePipeline(DiffusionPipeline): method __init__ (line 23) | def __init__(self, unet: UNet2DModel, scheduler: DiffusionPipeline): method __call__ (line 28) | def __call__( FILE: models/edict/my_diffusers/pipelines/stable_diffusion/__init__.py class StableDiffusionPipelineOutput (line 13) | class StableDiffusionPipelineOutput(BaseOutput): FILE: models/edict/my_diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py class StableDiffusionPipeline (line 16) | class StableDiffusionPipeline(DiffusionPipeline): method __init__ (line 44) | def __init__( method enable_attention_slicing (line 66) | def enable_attention_slicing(self, slice_size: Optional[Union[str, int... method disable_attention_slicing (line 85) | def disable_attention_slicing(self): method __call__ (line 94) | def __call__( FILE: models/edict/my_diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py function preprocess (line 17) | def preprocess(image): class StableDiffusionImg2ImgPipeline (line 27) | class StableDiffusionImg2ImgPipeline(DiffusionPipeline): method __init__ (line 55) | def __init__( method enable_attention_slicing (line 77) | def enable_attention_slicing(self, slice_size: Optional[Union[str, int... method disable_attention_slicing (line 96) | def disable_attention_slicing(self): method __call__ (line 105) | def __call__( FILE: models/edict/my_diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py function preprocess_image (line 22) | def preprocess_image(image): function preprocess_mask (line 32) | def preprocess_mask(mask): class StableDiffusionInpaintPipeline (line 45) | class StableDiffusionInpaintPipeline(DiffusionPipeline): method __init__ (line 73) | def __init__( method enable_attention_slicing (line 96) | def enable_attention_slicing(self, slice_size: Optional[Union[str, int... method disable_attention_slicing (line 115) | def disable_attention_slicing(self): method __call__ (line 124) | def __call__( FILE: models/edict/my_diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_onnx.py class StableDiffusionOnnxPipeline (line 14) | class StableDiffusionOnnxPipeline(DiffusionPipeline): method __init__ (line 23) | def __init__( method __call__ (line 45) | def __call__( FILE: models/edict/my_diffusers/pipelines/stable_diffusion/safety_checker.py function cosine_distance (line 13) | def cosine_distance(image_embeds, text_embeds): class StableDiffusionSafetyChecker (line 19) | class StableDiffusionSafetyChecker(PreTrainedModel): method __init__ (line 22) | def __init__(self, config: CLIPConfig): method forward (line 35) | def forward(self, clip_input, images): method forward_onnx (line 83) | def forward_onnx(self, clip_input: torch.FloatTensor, images: torch.Fl... FILE: models/edict/my_diffusers/pipelines/stochastic_karras_ve/pipeline_stochastic_karras_ve.py class KarrasVePipeline (line 12) | class KarrasVePipeline(DiffusionPipeline): method __init__ (line 31) | def __init__(self, unet: UNet2DModel, scheduler: KarrasVeScheduler): method __call__ (line 37) | def __call__( FILE: models/edict/my_diffusers/schedulers/scheduling_ddim.py function betas_for_alpha_bar (line 28) | def betas_for_alpha_bar(num_diffusion_timesteps, max_beta=0.999): class DDIMScheduler (line 57) | class DDIMScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 87) | def __init__( method _get_variance (line 131) | def _get_variance(self, timestep, prev_timestep): method set_timesteps (line 141) | def set_timesteps(self, num_inference_steps: int, offset: int = 0): method step (line 163) | def step( method add_noise (line 255) | def add_noise( method __len__ (line 269) | def __len__(self): FILE: models/edict/my_diffusers/schedulers/scheduling_ddpm.py function betas_for_alpha_bar (line 27) | def betas_for_alpha_bar(num_diffusion_timesteps, max_beta=0.999): class DDPMScheduler (line 56) | class DDPMScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 86) | def __init__( method set_timesteps (line 124) | def set_timesteps(self, num_inference_steps: int): method _get_variance (line 139) | def _get_variance(self, t, predicted_variance=None, variance_type=None): method step (line 172) | def step( method add_noise (line 248) | def add_noise( method __len__ (line 263) | def __len__(self): FILE: models/edict/my_diffusers/schedulers/scheduling_karras_ve.py class KarrasVeOutput (line 28) | class KarrasVeOutput(BaseOutput): class KarrasVeScheduler (line 44) | class KarrasVeScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 78) | def __init__( method set_timesteps (line 96) | def set_timesteps(self, num_inference_steps: int): method add_noise_to_input (line 115) | def add_noise_to_input( method step (line 136) | def step( method step_correct (line 172) | def step_correct( method add_noise (line 207) | def add_noise(self, original_samples, noise, timesteps): FILE: models/edict/my_diffusers/schedulers/scheduling_lms_discrete.py class LMSDiscreteScheduler (line 26) | class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 53) | def __init__( method get_lms_coefficient (line 86) | def get_lms_coefficient(self, order, t, current_order): method set_timesteps (line 108) | def set_timesteps(self, num_inference_steps: int): method step (line 130) | def step( method add_noise (line 181) | def add_noise( method __len__ (line 192) | def __len__(self): FILE: models/edict/my_diffusers/schedulers/scheduling_pndm.py function betas_for_alpha_bar (line 27) | def betas_for_alpha_bar(num_diffusion_timesteps, max_beta=0.999): class PNDMScheduler (line 56) | class PNDMScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 84) | def __init__( method set_timesteps (line 134) | def set_timesteps(self, num_inference_steps: int, offset: int = 0) -> ... method step (line 173) | def step( method step_prk (line 204) | def step_prk( method step_plms (line 259) | def step_plms( method _get_prev_sample (line 325) | def _get_prev_sample(self, sample, timestep, timestep_prev, model_outp... method add_noise (line 361) | def add_noise( method __len__ (line 377) | def __len__(self): FILE: models/edict/my_diffusers/schedulers/scheduling_sde_ve.py class SdeVeOutput (line 30) | class SdeVeOutput(BaseOutput): class ScoreSdeVeScheduler (line 46) | class ScoreSdeVeScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 71) | def __init__( method set_timesteps (line 89) | def set_timesteps(self, num_inference_steps: int, sampling_eps: float ... method set_sigmas (line 108) | def set_sigmas( method get_adjacent_sigma (line 141) | def get_adjacent_sigma(self, timesteps, t): method set_seed (line 154) | def set_seed(self, seed): method step_pred (line 168) | def step_pred( method step_correct (line 230) | def step_correct( method __len__ (line 282) | def __len__(self): FILE: models/edict/my_diffusers/schedulers/scheduling_sde_vp.py class ScoreSdeVpScheduler (line 26) | class ScoreSdeVpScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 42) | def __init__(self, num_train_timesteps=2000, beta_min=0.1, beta_max=20... method set_timesteps (line 48) | def set_timesteps(self, num_inference_steps): method step_pred (line 51) | def step_pred(self, score, x, t): method __len__ (line 80) | def __len__(self): FILE: models/edict/my_diffusers/schedulers/scheduling_utils.py class SchedulerOutput (line 27) | class SchedulerOutput(BaseOutput): class SchedulerMixin (line 40) | class SchedulerMixin: method set_format (line 48) | def set_format(self, tensor_format="pt"): method clip (line 57) | def clip(self, tensor, min_value=None, max_value=None): method log (line 67) | def log(self, tensor): method match_shape (line 77) | def match_shape(self, values: Union[np.ndarray, torch.Tensor], broadca... method norm (line 99) | def norm(self, tensor): method randn_like (line 108) | def randn_like(self, tensor, generator=None): method zeros_like (line 118) | def zeros_like(self, tensor): FILE: models/edict/my_diffusers/testing_utils.py function parse_flag_from_env (line 19) | def parse_flag_from_env(key, default=False): function floats_tensor (line 38) | def floats_tensor(shape, scale=1.0, rng=None, name=None): function slow (line 54) | def slow(test_case): FILE: models/edict/my_diffusers/training_utils.py function enable_full_determinism (line 9) | def enable_full_determinism(seed: int): function set_seed (line 29) | def set_seed(seed: int): class EMAModel (line 42) | class EMAModel: method __init__ (line 47) | def __init__( method get_decay (line 84) | def get_decay(self, optimization_step): method step (line 97) | def step(self, new_model): FILE: models/edict/my_diffusers/utils/dummy_scipy_objects.py class LMSDiscreteScheduler (line 7) | class LMSDiscreteScheduler(metaclass=DummyObject): method __init__ (line 10) | def __init__(self, *args, **kwargs): FILE: models/edict/my_diffusers/utils/dummy_transformers_and_inflect_and_unidecode_objects.py class GradTTSPipeline (line 6) | class GradTTSPipeline(metaclass=DummyObject): method __init__ (line 9) | def __init__(self, *args, **kwargs): FILE: models/edict/my_diffusers/utils/dummy_transformers_and_onnx_objects.py class StableDiffusionOnnxPipeline (line 7) | class StableDiffusionOnnxPipeline(metaclass=DummyObject): method __init__ (line 10) | def __init__(self, *args, **kwargs): FILE: models/edict/my_diffusers/utils/dummy_transformers_objects.py class LDMTextToImagePipeline (line 7) | class LDMTextToImagePipeline(metaclass=DummyObject): method __init__ (line 10) | def __init__(self, *args, **kwargs): class StableDiffusionImg2ImgPipeline (line 14) | class StableDiffusionImg2ImgPipeline(metaclass=DummyObject): method __init__ (line 17) | def __init__(self, *args, **kwargs): class StableDiffusionInpaintPipeline (line 21) | class StableDiffusionInpaintPipeline(metaclass=DummyObject): method __init__ (line 24) | def __init__(self, *args, **kwargs): class StableDiffusionPipeline (line 28) | class StableDiffusionPipeline(metaclass=DummyObject): method __init__ (line 31) | def __init__(self, *args, **kwargs): FILE: models/edict/my_diffusers/utils/import_utils.py function is_torch_available (line 155) | def is_torch_available(): function is_tf_available (line 159) | def is_tf_available(): function is_flax_available (line 163) | def is_flax_available(): function is_transformers_available (line 167) | def is_transformers_available(): function is_inflect_available (line 171) | def is_inflect_available(): function is_unidecode_available (line 175) | def is_unidecode_available(): function is_modelcards_available (line 179) | def is_modelcards_available(): function is_onnx_available (line 183) | def is_onnx_available(): function is_scipy_available (line 187) | def is_scipy_available(): function requires_backends (line 254) | def requires_backends(obj, backends): class DummyObject (line 265) | class DummyObject(type): method __getattr__ (line 271) | def __getattr__(cls, key): FILE: models/edict/my_diffusers/utils/logging.py function _get_default_logging_level (line 50) | def _get_default_logging_level(): function _get_library_name (line 67) | def _get_library_name() -> str: function _get_library_root_logger (line 72) | def _get_library_root_logger() -> logging.Logger: function _configure_library_root_logger (line 77) | def _configure_library_root_logger() -> None: function _reset_library_root_logger (line 95) | def _reset_library_root_logger() -> None: function get_log_levels_dict (line 109) | def get_log_levels_dict(): function get_logger (line 113) | def get_logger(name: Optional[str] = None) -> logging.Logger: function get_verbosity (line 127) | def get_verbosity() -> int: function set_verbosity (line 150) | def set_verbosity(verbosity: int) -> None: function set_verbosity_info (line 169) | def set_verbosity_info(): function set_verbosity_warning (line 174) | def set_verbosity_warning(): function set_verbosity_debug (line 179) | def set_verbosity_debug(): function set_verbosity_error (line 184) | def set_verbosity_error(): function disable_default_handler (line 189) | def disable_default_handler() -> None: function enable_default_handler (line 198) | def enable_default_handler() -> None: function add_handler (line 207) | def add_handler(handler: logging.Handler) -> None: function remove_handler (line 216) | def remove_handler(handler: logging.Handler) -> None: function disable_propagation (line 225) | def disable_propagation() -> None: function enable_propagation (line 234) | def enable_propagation() -> None: function enable_explicit_format (line 244) | def enable_explicit_format() -> None: function reset_format (line 259) | def reset_format() -> None: function warning_advice (line 271) | def warning_advice(self, *args, **kwargs): class EmptyTqdm (line 285) | class EmptyTqdm: method __init__ (line 288) | def __init__(self, *args, **kwargs): # pylint: disable=unused-argument method __iter__ (line 291) | def __iter__(self): method __getattr__ (line 294) | def __getattr__(self, _): method __enter__ (line 302) | def __enter__(self): method __exit__ (line 305) | def __exit__(self, type_, value, traceback): class _tqdm_cls (line 309) | class _tqdm_cls: method __call__ (line 310) | def __call__(self, *args, **kwargs): method set_lock (line 316) | def set_lock(self, *args, **kwargs): method get_lock (line 321) | def get_lock(self): function is_progress_bar_enabled (line 329) | def is_progress_bar_enabled() -> bool: function enable_progress_bar (line 335) | def enable_progress_bar(): function disable_progress_bar (line 341) | def disable_progress_bar(): FILE: models/edict/my_diffusers/utils/outputs.py function is_tensor (line 28) | def is_tensor(x): class BaseOutput (line 41) | class BaseOutput(OrderedDict): method __post_init__ (line 55) | def __post_init__(self): method __delitem__ (line 67) | def __delitem__(self, *args, **kwargs): method setdefault (line 70) | def setdefault(self, *args, **kwargs): method pop (line 73) | def pop(self, *args, **kwargs): method update (line 76) | def update(self, *args, **kwargs): method __getitem__ (line 79) | def __getitem__(self, k): method __setattr__ (line 93) | def __setattr__(self, name, value): method __setitem__ (line 99) | def __setitem__(self, key, value): method to_tuple (line 105) | def to_tuple(self) -> Tuple[Any]: FILE: models/edit_friendly_ddm/inversion_utils.py function load_real_image (line 4) | def load_real_image(folder = "data/", img_name = None, idx = 0, img_size... function mu_tilde (line 22) | def mu_tilde(model, xt,x0, timestep): function sample_xts_from_x0 (line 31) | def sample_xts_from_x0(model, x0, num_inference_steps=50): function encode_text (line 58) | def encode_text(model, prompts): function forward_step (line 70) | def forward_step(model, model_output, timestep, sample): function get_variance (line 91) | def get_variance(model, timestep): #, prev_timestep): function inversion_forward_process (line 100) | def inversion_forward_process(model, x0, function reverse_step (line 179) | def reverse_step(model, model_output, timestep, sample, eta = 0, varianc... function inversion_reverse_process (line 210) | def inversion_reverse_process(model, FILE: models/edit_friendly_ddm/ptp_classes.py class LocalBlend (line 20) | class LocalBlend: method __call__ (line 22) | def __call__(self, x_t, attention_store): method __init__ (line 36) | def __init__(self, prompts: List[str], words: [List[List[str]]], thres... class AttentionControl (line 48) | class AttentionControl(abc.ABC): method step_callback (line 50) | def step_callback(self, x_t): method between_steps (line 53) | def between_steps(self): method num_uncond_att_layers (line 57) | def num_uncond_att_layers(self): method forward (line 61) | def forward (self, attn, is_cross: bool, place_in_unet: str): method __call__ (line 64) | def __call__(self, attn, is_cross: bool, place_in_unet: str): method reset (line 78) | def reset(self): method __init__ (line 82) | def __init__(self): class EmptyControl (line 87) | class EmptyControl(AttentionControl): method forward (line 89) | def forward (self, attn, is_cross: bool, place_in_unet: str): class AttentionStore (line 93) | class AttentionStore(AttentionControl): method get_empty_store (line 96) | def get_empty_store(): method forward (line 100) | def forward(self, attn, is_cross: bool, place_in_unet: str): method between_steps (line 106) | def between_steps(self): method get_average_attention (line 115) | def get_average_attention(self): method reset (line 120) | def reset(self): method __init__ (line 125) | def __init__(self): class AttentionControlEdit (line 131) | class AttentionControlEdit(AttentionStore, abc.ABC): method step_callback (line 133) | def step_callback(self, x_t): method replace_self_attention (line 138) | def replace_self_attention(self, attn_base, att_replace): method replace_cross_attention (line 145) | def replace_cross_attention(self, attn_base, att_replace): method forward (line 148) | def forward(self, attn, is_cross: bool, place_in_unet: str): method __init__ (line 163) | def __init__(self, prompts, num_steps: int, class AttentionReplace (line 177) | class AttentionReplace(AttentionControlEdit): method replace_cross_attention (line 179) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 182) | def __init__(self, prompts, num_steps: int, cross_replace_steps: float... class AttentionRefine (line 188) | class AttentionRefine(AttentionControlEdit): method replace_cross_attention (line 190) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 195) | def __init__(self, prompts, num_steps: int, cross_replace_steps: float... class AttentionReweight (line 203) | class AttentionReweight(AttentionControlEdit): method replace_cross_attention (line 205) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 211) | def __init__(self, prompts, num_steps: int, cross_replace_steps: float... function get_equalizer (line 218) | def get_equalizer(text: str, word_select: Union[int, Tuple[int, ...]], v... function aggregate_attention (line 231) | def aggregate_attention(attention_store: AttentionStore, res: int, from_... function show_cross_attention (line 245) | def show_cross_attention(attention_store: AttentionStore, res: int, from... function show_self_attention_comp (line 261) | def show_self_attention_comp(attention_store: AttentionStore, res: int, ... function run_and_display (line 276) | def run_and_display(model, prompts, controller, latent=None, run_baselin... function load_512 (line 284) | def load_512(image_path, left=0, right=0, top=0, bottom=0, device=None): FILE: models/edit_friendly_ddm/ptp_utils.py function text_under_image (line 30) | def text_under_image(image: np.ndarray, text: str, text_color: Tuple[int... function view_images (line 43) | def view_images(images, num_rows=1, offset_ratio=0.02): function diffusion_step (line 72) | def diffusion_step(model, controller, latents, context, t, guidance_scal... function latent2image (line 87) | def latent2image(vae, latents): function init_latent (line 96) | def init_latent(latent, model, height, width, generator, batch_size): function text2image_ldm (line 107) | def text2image_ldm( function text2image_ldm_stable (line 138) | def text2image_ldm_stable( function register_attention_control (line 184) | def register_attention_control(model, controller): function get_word_inds (line 254) | def get_word_inds(text: str, word_place: int, tokenizer): function update_alpha_time_word (line 275) | def update_alpha_time_word(alpha, bounds: Union[float, Tuple[float, floa... function get_time_words_attention_alpha (line 288) | def get_time_words_attention_alpha(prompts, num_steps, FILE: models/edit_friendly_ddm/seq_aligner.py class ScoreParams (line 23) | class ScoreParams: method __init__ (line 25) | def __init__(self, gap, match, mismatch): method mis_match_char (line 30) | def mis_match_char(self, x, y): function get_matrix (line 37) | def get_matrix(size_x, size_y, gap): function get_matrix (line 51) | def get_matrix(size_x, size_y, gap): function get_traceback_matrix (line 58) | def get_traceback_matrix(size_x, size_y): function global_align (line 66) | def global_align(x, y, score): function get_aligned_sequences (line 84) | def get_aligned_sequences(x, y, trace_back): function get_mapper (line 112) | def get_mapper(x: str, y: str, tokenizer, max_len=77): function get_refinement_mapper (line 126) | def get_refinement_mapper(prompts, tokenizer, max_len=77): function get_word_inds (line 136) | def get_word_inds(text: str, word_place: int, tokenizer): function get_replacement_mapper_ (line 157) | def get_replacement_mapper_(x: str, y: str, tokenizer, max_len=77): function get_replacement_mapper (line 194) | def get_replacement_mapper(prompts, tokenizer, max_len=77): FILE: models/instructpix2pix/dataset_creation/generate_img_dataset.py function append_dims (line 29) | def append_dims(x, target_dims): function to_d (line 37) | def to_d(x, sigma, denoised): function get_ancestral_step (line 42) | def get_ancestral_step(sigma_from, sigma_to): function sample_euler_ancestral (line 50) | def sample_euler_ancestral(model, x, sigmas, prompt2prompt_threshold=0.0... function load_model_from_config (line 73) | def load_model_from_config(config, ckpt, vae_ckpt=None, verbose=False): class CFGDenoiser (line 97) | class CFGDenoiser(nn.Module): method __init__ (line 98) | def __init__(self, model): method forward (line 102) | def forward(self, x, sigma, uncond, cond, cfg_scale): function to_pil (line 110) | def to_pil(image: torch.Tensor) -> Image.Image: function main (line 116) | def main(): FILE: models/instructpix2pix/dataset_creation/generate_txt_dataset.py function generate (line 20) | def generate( function main (line 57) | def main(openai_model: str, num_samples: int, num_partitions: int, parti... FILE: models/instructpix2pix/dataset_creation/prepare_dataset.py function main (line 8) | def main(): FILE: models/instructpix2pix/dataset_creation/prepare_for_gpt.py function main (line 7) | def main(input_path: str, output_path: str): FILE: models/instructpix2pix/edit_app.py class CFGDenoiser (line 60) | class CFGDenoiser(nn.Module): method __init__ (line 61) | def __init__(self, model): method forward (line 65) | def forward(self, z, sigma, cond, uncond, text_cfg_scale, image_cfg_sc... function load_model_from_config (line 76) | def load_model_from_config(config, ckpt, vae_ckpt=None, verbose=False): function main (line 100) | def main(): FILE: models/instructpix2pix/edit_cli.py class CFGDenoiser (line 23) | class CFGDenoiser(nn.Module): method __init__ (line 24) | def __init__(self, model): method forward (line 28) | def forward(self, z, sigma, cond, uncond, text_cfg_scale, image_cfg_sc... function load_model_from_config (line 39) | def load_model_from_config(config, ckpt, vae_ckpt=None, verbose=False): function main (line 63) | def main(): FILE: models/instructpix2pix/edit_dataset.py class EditDataset (line 16) | class EditDataset(Dataset): method __init__ (line 17) | def __init__( method __len__ (line 48) | def __len__(self) -> int: method __getitem__ (line 51) | def __getitem__(self, i: int) -> dict[str, Any]: class EditDatasetEval (line 75) | class EditDatasetEval(Dataset): method __init__ (line 76) | def __init__( method __len__ (line 101) | def __len__(self) -> int: method __getitem__ (line 104) | def __getitem__(self, i: int) -> dict[str, Any]: FILE: models/instructpix2pix/main.py function get_parser (line 30) | def get_parser(**parser_kwargs): function nondefault_trainer_args (line 130) | def nondefault_trainer_args(opt): class WrappedDataset (line 137) | class WrappedDataset(Dataset): method __init__ (line 140) | def __init__(self, dataset): method __len__ (line 143) | def __len__(self): method __getitem__ (line 146) | def __getitem__(self, idx): function worker_init_fn (line 150) | def worker_init_fn(_): class DataModuleFromConfig (line 166) | class DataModuleFromConfig(pl.LightningDataModule): method __init__ (line 167) | def __init__(self, batch_size, train=None, validation=None, test=None,... method prepare_data (line 189) | def prepare_data(self): method setup (line 193) | def setup(self, stage=None): method _train_dataloader (line 201) | def _train_dataloader(self): method _val_dataloader (line 211) | def _val_dataloader(self, shuffle=False): method _test_dataloader (line 222) | def _test_dataloader(self, shuffle=False): method _predict_dataloader (line 235) | def _predict_dataloader(self, shuffle=False): class SetupCallback (line 244) | class SetupCallback(Callback): method __init__ (line 245) | def __init__(self, resume, now, logdir, ckptdir, cfgdir, config, light... method on_keyboard_interrupt (line 255) | def on_keyboard_interrupt(self, trainer, pl_module): method on_pretrain_routine_start (line 261) | def on_pretrain_routine_start(self, trainer, pl_module): function get_world_size (line 281) | def get_world_size(): function all_gather (line 288) | def all_gather(data): class ImageLogger (line 351) | class ImageLogger(Callback): method __init__ (line 352) | def __init__(self, batch_frequency, max_images, clamp=True, increase_l... method _testtube (line 372) | def _testtube(self, pl_module, images, batch_idx, split): method log_local (line 383) | def log_local(self, save_dir, split, images, prompts, method log_img (line 414) | def log_img(self, pl_module, batch, batch_idx, split="train"): method check_frequency (line 450) | def check_frequency(self, check_idx): method on_train_batch_end (line 458) | def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch... method on_validation_batch_end (line 462) | def on_validation_batch_end(self, trainer, pl_module, outputs, batch, ... class CUDACallback (line 470) | class CUDACallback(Callback): method on_train_epoch_start (line 472) | def on_train_epoch_start(self, trainer, pl_module): method on_train_epoch_end (line 478) | def on_train_epoch_end(self, trainer, pl_module, outputs): function melk (line 755) | def melk(*args, **kwargs): function divein (line 763) | def divein(*args, **kwargs): FILE: models/instructpix2pix/metrics/clip_similarity.py class ClipSimilarity (line 10) | class ClipSimilarity(nn.Module): method __init__ (line 11) | def __init__(self, name: str = "ViT-L/14"): method encode_text (line 22) | def encode_text(self, text: list[str]) -> torch.Tensor: method encode_image (line 28) | def encode_image(self, image: torch.Tensor) -> torch.Tensor: # Input ... method forward (line 36) | def forward( FILE: models/instructpix2pix/metrics/compute_metrics.py class CFGDenoiser (line 34) | class CFGDenoiser(nn.Module): method __init__ (line 35) | def __init__(self, model): method forward (line 39) | def forward(self, z, sigma, cond, uncond, text_cfg_scale, image_cfg_sc... function load_model_from_config (line 50) | def load_model_from_config(config, ckpt, vae_ckpt=None, verbose=False): class ImageEditor (line 73) | class ImageEditor(nn.Module): method __init__ (line 74) | def __init__(self, config, ckpt, vae_ckpt=None): method forward (line 84) | def forward( function compute_metrics (line 117) | def compute_metrics(config, function plot_metrics (line 186) | def plot_metrics(metrics_file, output_path): function main (line 205) | def main(): FILE: models/instructpix2pix/prompt_app.py function main (line 13) | def main(openai_model: str): FILE: models/instructpix2pix/stable_diffusion/ldm/lr_scheduler.py class LambdaWarmUpCosineScheduler (line 4) | class LambdaWarmUpCosineScheduler: method __init__ (line 8) | def __init__(self, warm_up_steps, lr_min, lr_max, lr_start, max_decay_... method schedule (line 17) | def schedule(self, n, **kwargs): method __call__ (line 32) | def __call__(self, n, **kwargs): class LambdaWarmUpCosineScheduler2 (line 36) | class LambdaWarmUpCosineScheduler2: method __init__ (line 41) | def __init__(self, warm_up_steps, f_min, f_max, f_start, cycle_lengths... method find_in_interval (line 52) | def find_in_interval(self, n): method schedule (line 59) | def schedule(self, n, **kwargs): method __call__ (line 77) | def __call__(self, n, **kwargs): class LambdaLinearScheduler (line 81) | class LambdaLinearScheduler(LambdaWarmUpCosineScheduler2): method schedule (line 83) | def schedule(self, n, **kwargs): FILE: models/instructpix2pix/stable_diffusion/ldm/models/autoencoder.py class VQModel (line 14) | class VQModel(pl.LightningModule): method __init__ (line 15) | def __init__(self, method ema_scope (line 64) | def ema_scope(self, context=None): method init_from_ckpt (line 78) | def init_from_ckpt(self, path, ignore_keys=list()): method on_train_batch_end (line 92) | def on_train_batch_end(self, *args, **kwargs): method encode (line 96) | def encode(self, x): method encode_to_prequant (line 102) | def encode_to_prequant(self, x): method decode (line 107) | def decode(self, quant): method decode_code (line 112) | def decode_code(self, code_b): method forward (line 117) | def forward(self, input, return_pred_indices=False): method get_input (line 124) | def get_input(self, batch, k): method training_step (line 142) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 164) | def validation_step(self, batch, batch_idx): method _validation_step (line 170) | def _validation_step(self, batch, batch_idx, suffix=""): method configure_optimizers (line 197) | def configure_optimizers(self): method get_last_layer (line 230) | def get_last_layer(self): method log_images (line 233) | def log_images(self, batch, only_inputs=False, plot_ema=False, **kwargs): method to_rgb (line 255) | def to_rgb(self, x): class VQModelInterface (line 264) | class VQModelInterface(VQModel): method __init__ (line 265) | def __init__(self, embed_dim, *args, **kwargs): method encode (line 269) | def encode(self, x): method decode (line 274) | def decode(self, h, force_not_quantize=False): class AutoencoderKL (line 285) | class AutoencoderKL(pl.LightningModule): method __init__ (line 286) | def __init__(self, method init_from_ckpt (line 313) | def init_from_ckpt(self, path, ignore_keys=list()): method encode (line 324) | def encode(self, x): method decode (line 330) | def decode(self, z): method forward (line 335) | def forward(self, input, sample_posterior=True): method get_input (line 344) | def get_input(self, batch, k): method training_step (line 351) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 372) | def validation_step(self, batch, batch_idx): method configure_optimizers (line 386) | def configure_optimizers(self): method get_last_layer (line 397) | def get_last_layer(self): method log_images (line 401) | def log_images(self, batch, only_inputs=False, **kwargs): method to_rgb (line 417) | def to_rgb(self, x): class IdentityFirstStage (line 426) | class IdentityFirstStage(torch.nn.Module): method __init__ (line 427) | def __init__(self, *args, vq_interface=False, **kwargs): method encode (line 431) | def encode(self, x, *args, **kwargs): method decode (line 434) | def decode(self, x, *args, **kwargs): method quantize (line 437) | def quantize(self, x, *args, **kwargs): method forward (line 442) | def forward(self, x, *args, **kwargs): FILE: models/instructpix2pix/stable_diffusion/ldm/models/diffusion/classifier.py function disabled_train (line 22) | def disabled_train(self, mode=True): class NoisyLatentImageClassifier (line 28) | class NoisyLatentImageClassifier(pl.LightningModule): method __init__ (line 30) | def __init__(self, method init_from_ckpt (line 70) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method load_diffusion (line 88) | def load_diffusion(self): method load_classifier (line 95) | def load_classifier(self, ckpt_path, pool): method get_x_noisy (line 110) | def get_x_noisy(self, x, t, noise=None): method forward (line 120) | def forward(self, x_noisy, t, *args, **kwargs): method get_input (line 124) | def get_input(self, batch, k): method get_conditioning (line 133) | def get_conditioning(self, batch, k=None): method compute_top_k (line 150) | def compute_top_k(self, logits, labels, k, reduction="mean"): method on_train_epoch_start (line 157) | def on_train_epoch_start(self): method write_logs (line 162) | def write_logs(self, loss, logits, targets): method shared_step (line 179) | def shared_step(self, batch, t=None): method training_step (line 198) | def training_step(self, batch, batch_idx): method reset_noise_accs (line 202) | def reset_noise_accs(self): method on_validation_start (line 206) | def on_validation_start(self): method validation_step (line 210) | def validation_step(self, batch, batch_idx): method configure_optimizers (line 220) | def configure_optimizers(self): method log_images (line 238) | def log_images(self, batch, N=8, *args, **kwargs): FILE: models/instructpix2pix/stable_diffusion/ldm/models/diffusion/ddim.py class DDIMSampler (line 12) | class DDIMSampler(object): method __init__ (line 13) | def __init__(self, model, schedule="linear", **kwargs): method register_buffer (line 19) | def register_buffer(self, name, attr): method make_schedule (line 25) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 57) | def sample(self, method ddim_sampling (line 114) | def ddim_sampling(self, cond, shape, method p_sample_ddim (line 166) | def p_sample_ddim(self, x, c, t, index, repeat_noise=False, use_origin... method stochastic_encode (line 207) | def stochastic_encode(self, x0, t, use_original_steps=False, noise=None): method decode (line 223) | def decode(self, x_latent, cond, t_start, unconditional_guidance_scale... FILE: models/instructpix2pix/stable_diffusion/ldm/models/diffusion/ddpm.py function disabled_train (line 34) | def disabled_train(self, mode=True): function uniform_on_device (line 40) | def uniform_on_device(r1, r2, shape, device): class DDPM (line 44) | class DDPM(pl.LightningModule): method __init__ (line 46) | def __init__(self, method register_schedule (line 117) | def register_schedule(self, given_betas=None, beta_schedule="linear", ... method ema_scope (line 172) | def ema_scope(self, context=None): method init_from_ckpt (line 186) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method q_mean_variance (line 204) | def q_mean_variance(self, x_start, t): method predict_start_from_noise (line 216) | def predict_start_from_noise(self, x_t, t, noise): method q_posterior (line 222) | def q_posterior(self, x_start, x_t, t): method p_mean_variance (line 231) | def p_mean_variance(self, x, t, clip_denoised: bool): method p_sample (line 244) | def p_sample(self, x, t, clip_denoised=True, repeat_noise=False): method p_sample_loop (line 253) | def p_sample_loop(self, shape, return_intermediates=False): method sample (line 268) | def sample(self, batch_size=16, return_intermediates=False): method q_sample (line 274) | def q_sample(self, x_start, t, noise=None): method get_loss (line 279) | def get_loss(self, pred, target, mean=True): method p_losses (line 294) | def p_losses(self, x_start, t, noise=None): method forward (line 323) | def forward(self, x, *args, **kwargs): method get_input (line 329) | def get_input(self, batch, k): method shared_step (line 337) | def shared_step(self, batch): method training_step (line 342) | def training_step(self, batch, batch_idx): method validation_step (line 358) | def validation_step(self, batch, batch_idx): method on_train_batch_end (line 366) | def on_train_batch_end(self, *args, **kwargs): method _get_rows_from_list (line 370) | def _get_rows_from_list(self, samples): method log_images (line 378) | def log_images(self, batch, N=8, n_row=2, sample=True, return_keys=Non... method configure_optimizers (line 415) | def configure_optimizers(self): class LatentDiffusion (line 424) | class LatentDiffusion(DDPM): method __init__ (line 426) | def __init__(self, method make_cond_schedule (line 471) | def make_cond_schedule(self, ): method on_train_batch_start (line 478) | def on_train_batch_start(self, batch, batch_idx, dataloader_idx): method register_schedule (line 493) | def register_schedule(self, method instantiate_first_stage (line 502) | def instantiate_first_stage(self, config): method instantiate_cond_stage (line 509) | def instantiate_cond_stage(self, config): method _get_denoise_row_from_list (line 530) | def _get_denoise_row_from_list(self, samples, desc='', force_no_decode... method get_first_stage_encoding (line 542) | def get_first_stage_encoding(self, encoder_posterior): method get_learned_conditioning (line 551) | def get_learned_conditioning(self, c): method meshgrid (line 564) | def meshgrid(self, h, w): method delta_border (line 571) | def delta_border(self, h, w): method get_weighting (line 585) | def get_weighting(self, h, w, Ly, Lx, device): method get_fold_unfold (line 601) | def get_fold_unfold(self, x, kernel_size, stride, uf=1, df=1): # todo... method get_input (line 654) | def get_input(self, batch, k, return_first_stage_outputs=False, force_... method decode_first_stage (line 706) | def decode_first_stage(self, z, predict_cids=False, force_not_quantize... method differentiable_decode_first_stage (line 766) | def differentiable_decode_first_stage(self, z, predict_cids=False, for... method encode_first_stage (line 826) | def encode_first_stage(self, x): method shared_step (line 865) | def shared_step(self, batch, **kwargs): method forward (line 870) | def forward(self, x, c, *args, **kwargs): method _rescale_annotations (line 881) | def _rescale_annotations(self, bboxes, crop_coordinates): # TODO: mov... method apply_model (line 891) | def apply_model(self, x_noisy, t, cond, return_ids=False): method _predict_eps_from_xstart (line 994) | def _predict_eps_from_xstart(self, x_t, t, pred_xstart): method _prior_bpd (line 998) | def _prior_bpd(self, x_start): method p_losses (line 1012) | def p_losses(self, x_start, cond, t, noise=None): method p_mean_variance (line 1047) | def p_mean_variance(self, x, c, t, clip_denoised: bool, return_codeboo... method p_sample (line 1079) | def p_sample(self, x, c, t, clip_denoised=False, repeat_noise=False, method progressive_denoising (line 1110) | def progressive_denoising(self, cond, shape, verbose=True, callback=No... method p_sample_loop (line 1166) | def p_sample_loop(self, cond, shape, return_intermediates=False, method sample (line 1217) | def sample(self, cond, batch_size=16, return_intermediates=False, x_T=... method sample_log (line 1235) | def sample_log(self,cond,batch_size,ddim, ddim_steps,**kwargs): method log_images (line 1251) | def log_images(self, batch, N=8, n_row=4, sample=True, ddim_steps=200,... method configure_optimizers (line 1361) | def configure_optimizers(self): method to_rgb (line 1386) | def to_rgb(self, x): class DiffusionWrapper (line 1395) | class DiffusionWrapper(pl.LightningModule): method __init__ (line 1396) | def __init__(self, diff_model_config, conditioning_key): method forward (line 1402) | def forward(self, x, t, c_concat: list = None, c_crossattn: list = None): class Layout2ImgDiffusion (line 1424) | class Layout2ImgDiffusion(LatentDiffusion): method __init__ (line 1426) | def __init__(self, cond_stage_key, *args, **kwargs): method log_images (line 1430) | def log_images(self, batch, N=8, *args, **kwargs): FILE: models/instructpix2pix/stable_diffusion/ldm/models/diffusion/ddpm_edit.py function disabled_train (line 37) | def disabled_train(self, mode=True): function uniform_on_device (line 43) | def uniform_on_device(r1, r2, shape, device): class DDPM (line 47) | class DDPM(pl.LightningModule): method __init__ (line 49) | def __init__(self, method register_schedule (line 128) | def register_schedule(self, given_betas=None, beta_schedule="linear", ... method ema_scope (line 183) | def ema_scope(self, context=None): method init_from_ckpt (line 197) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method q_mean_variance (line 236) | def q_mean_variance(self, x_start, t): method predict_start_from_noise (line 248) | def predict_start_from_noise(self, x_t, t, noise): method q_posterior (line 254) | def q_posterior(self, x_start, x_t, t): method p_mean_variance (line 263) | def p_mean_variance(self, x, t, clip_denoised: bool): method p_sample (line 276) | def p_sample(self, x, t, clip_denoised=True, repeat_noise=False): method p_sample_loop (line 285) | def p_sample_loop(self, shape, return_intermediates=False): method sample (line 300) | def sample(self, batch_size=16, return_intermediates=False): method q_sample (line 306) | def q_sample(self, x_start, t, noise=None): method get_loss (line 311) | def get_loss(self, pred, target, mean=True): method p_losses (line 326) | def p_losses(self, x_start, t, noise=None): method forward (line 355) | def forward(self, x, *args, **kwargs): method get_input (line 361) | def get_input(self, batch, k): method shared_step (line 364) | def shared_step(self, batch): method training_step (line 369) | def training_step(self, batch, batch_idx): method validation_step (line 385) | def validation_step(self, batch, batch_idx): method on_train_batch_end (line 393) | def on_train_batch_end(self, *args, **kwargs): method _get_rows_from_list (line 397) | def _get_rows_from_list(self, samples): method log_images (line 405) | def log_images(self, batch, N=8, n_row=2, sample=True, return_keys=Non... method configure_optimizers (line 442) | def configure_optimizers(self): class LatentDiffusion (line 451) | class LatentDiffusion(DDPM): method __init__ (line 453) | def __init__(self, method make_cond_schedule (line 503) | def make_cond_schedule(self, ): method on_train_batch_start (line 510) | def on_train_batch_start(self, batch, batch_idx, dataloader_idx): method register_schedule (line 525) | def register_schedule(self, method instantiate_first_stage (line 534) | def instantiate_first_stage(self, config): method instantiate_cond_stage (line 541) | def instantiate_cond_stage(self, config): method _get_denoise_row_from_list (line 562) | def _get_denoise_row_from_list(self, samples, desc='', force_no_decode... method get_first_stage_encoding (line 574) | def get_first_stage_encoding(self, encoder_posterior): method get_learned_conditioning (line 583) | def get_learned_conditioning(self, c): method meshgrid (line 596) | def meshgrid(self, h, w): method delta_border (line 603) | def delta_border(self, h, w): method get_weighting (line 617) | def get_weighting(self, h, w, Ly, Lx, device): method get_fold_unfold (line 633) | def get_fold_unfold(self, x, kernel_size, stride, uf=1, df=1): # todo... method get_input (line 686) | def get_input(self, batch, k, return_first_stage_outputs=False, force_... method decode_first_stage (line 719) | def decode_first_stage(self, z, predict_cids=False, force_not_quantize... method differentiable_decode_first_stage (line 779) | def differentiable_decode_first_stage(self, z, predict_cids=False, for... method encode_first_stage (line 839) | def encode_first_stage(self, x): method shared_step (line 878) | def shared_step(self, batch, **kwargs): method forward (line 883) | def forward(self, x, c, *args, **kwargs): method _rescale_annotations (line 894) | def _rescale_annotations(self, bboxes, crop_coordinates): # TODO: mov... method apply_model (line 904) | def apply_model(self, x_noisy, t, cond, return_ids=False): method _predict_eps_from_xstart (line 1007) | def _predict_eps_from_xstart(self, x_t, t, pred_xstart): method _prior_bpd (line 1011) | def _prior_bpd(self, x_start): method p_losses (line 1025) | def p_losses(self, x_start, cond, t, noise=None): method p_mean_variance (line 1060) | def p_mean_variance(self, x, c, t, clip_denoised: bool, return_codeboo... method p_sample (line 1092) | def p_sample(self, x, c, t, clip_denoised=False, repeat_noise=False, method progressive_denoising (line 1123) | def progressive_denoising(self, cond, shape, verbose=True, callback=No... method p_sample_loop (line 1179) | def p_sample_loop(self, cond, shape, return_intermediates=False, method sample (line 1230) | def sample(self, cond, batch_size=16, return_intermediates=False, x_T=... method sample_log (line 1248) | def sample_log(self,cond,batch_size,ddim, ddim_steps,**kwargs): method log_images (line 1264) | def log_images(self, batch, N=4, n_row=4, sample=True, ddim_steps=200,... method configure_optimizers (line 1375) | def configure_optimizers(self): method to_rgb (line 1400) | def to_rgb(self, x): class DiffusionWrapper (line 1409) | class DiffusionWrapper(pl.LightningModule): method __init__ (line 1410) | def __init__(self, diff_model_config, conditioning_key): method forward (line 1416) | def forward(self, x, t, c_concat: list = None, c_crossattn: list = None): class Layout2ImgDiffusion (line 1438) | class Layout2ImgDiffusion(LatentDiffusion): method __init__ (line 1440) | def __init__(self, cond_stage_key, *args, **kwargs): method log_images (line 1444) | def log_images(self, batch, N=8, *args, **kwargs): FILE: models/instructpix2pix/stable_diffusion/ldm/models/diffusion/dpm_solver/dpm_solver.py class NoiseScheduleVP (line 6) | class NoiseScheduleVP: method __init__ (line 7) | def __init__( method marginal_log_mean_coeff (line 125) | def marginal_log_mean_coeff(self, t): method marginal_alpha (line 138) | def marginal_alpha(self, t): method marginal_std (line 144) | def marginal_std(self, t): method marginal_lambda (line 150) | def marginal_lambda(self, t): method inverse_lambda (line 158) | def inverse_lambda(self, lamb): function model_wrapper (line 177) | def model_wrapper( class DPM_Solver (line 351) | class DPM_Solver: method __init__ (line 352) | def __init__(self, model_fn, noise_schedule, predict_x0=False, thresho... method noise_prediction_fn (line 380) | def noise_prediction_fn(self, x, t): method data_prediction_fn (line 386) | def data_prediction_fn(self, x, t): method model_fn (line 401) | def model_fn(self, x, t): method get_time_steps (line 410) | def get_time_steps(self, skip_type, t_T, t_0, N, device): method get_orders_and_timesteps_for_singlestep_solver (line 439) | def get_orders_and_timesteps_for_singlestep_solver(self, steps, order,... method denoise_to_zero_fn (line 498) | def denoise_to_zero_fn(self, x, s): method dpm_solver_first_update (line 504) | def dpm_solver_first_update(self, x, s, t, model_s=None, return_interm... method singlestep_dpm_solver_second_update (line 551) | def singlestep_dpm_solver_second_update(self, x, s, t, r1=0.5, model_s... method singlestep_dpm_solver_third_update (line 633) | def singlestep_dpm_solver_third_update(self, x, s, t, r1=1./3., r2=2./... method multistep_dpm_solver_second_update (line 755) | def multistep_dpm_solver_second_update(self, x, model_prev_list, t_pre... method multistep_dpm_solver_third_update (line 812) | def multistep_dpm_solver_third_update(self, x, model_prev_list, t_prev... method singlestep_dpm_solver_update (line 859) | def singlestep_dpm_solver_update(self, x, s, t, order, return_intermed... method multistep_dpm_solver_update (line 885) | def multistep_dpm_solver_update(self, x, model_prev_list, t_prev_list,... method dpm_solver_adaptive (line 909) | def dpm_solver_adaptive(self, x, order, t_T, t_0, h_init=0.05, atol=0.... method sample (line 965) | def sample(self, x, steps=20, t_start=None, t_end=None, order=3, skip_... function interpolate_fn (line 1132) | def interpolate_fn(x, xp, yp): function expand_dims (line 1174) | def expand_dims(v, dims): FILE: models/instructpix2pix/stable_diffusion/ldm/models/diffusion/dpm_solver/sampler.py class DPMSolverSampler (line 8) | class DPMSolverSampler(object): method __init__ (line 9) | def __init__(self, model, **kwargs): method register_buffer (line 15) | def register_buffer(self, name, attr): method sample (line 22) | def sample(self, FILE: models/instructpix2pix/stable_diffusion/ldm/models/diffusion/plms.py class PLMSSampler (line 11) | class PLMSSampler(object): method __init__ (line 12) | def __init__(self, model, schedule="linear", **kwargs): method register_buffer (line 18) | def register_buffer(self, name, attr): method make_schedule (line 24) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 58) | def sample(self, method plms_sampling (line 115) | def plms_sampling(self, cond, shape, method p_sample_plms (line 173) | def p_sample_plms(self, x, c, t, index, repeat_noise=False, use_origin... FILE: models/instructpix2pix/stable_diffusion/ldm/modules/attention.py function exists (line 14) | def exists(val): function uniq (line 18) | def uniq(arr): function default (line 22) | def default(val, d): function max_neg_value (line 28) | def max_neg_value(t): function init_ (line 32) | def init_(tensor): class GEGLU (line 40) | class GEGLU(nn.Module): method __init__ (line 41) | def __init__(self, dim_in, dim_out): method forward (line 45) | def forward(self, x): class FeedForward (line 50) | class FeedForward(nn.Module): method __init__ (line 51) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.): method forward (line 66) | def forward(self, x): function zero_module (line 70) | def zero_module(module): function Normalize (line 79) | def Normalize(in_channels): class LinearAttention (line 83) | class LinearAttention(nn.Module): method __init__ (line 84) | def __init__(self, dim, heads=4, dim_head=32): method forward (line 91) | def forward(self, x): class SpatialSelfAttention (line 102) | class SpatialSelfAttention(nn.Module): method __init__ (line 103) | def __init__(self, in_channels): method forward (line 129) | def forward(self, x): class CrossAttention (line 155) | class CrossAttention(nn.Module): method __init__ (line 156) | def __init__(self, query_dim, context_dim=None, heads=8, dim_head=64, ... method forward (line 175) | def forward(self, x, context=None, mask=None): class BasicTransformerBlock (line 210) | class BasicTransformerBlock(nn.Module): method __init__ (line 211) | def __init__(self, dim, n_heads, d_head, dropout=0., context_dim=None,... method forward (line 222) | def forward(self, x, context=None): method _forward (line 225) | def _forward(self, x, context=None): class SpatialTransformer (line 232) | class SpatialTransformer(nn.Module): method __init__ (line 240) | def __init__(self, in_channels, n_heads, d_head, method forward (line 264) | def forward(self, x, context=None): FILE: models/instructpix2pix/stable_diffusion/ldm/modules/diffusionmodules/model.py function get_timestep_embedding (line 12) | def get_timestep_embedding(timesteps, embedding_dim): function nonlinearity (line 33) | def nonlinearity(x): function Normalize (line 38) | def Normalize(in_channels, num_groups=32): class Upsample (line 42) | class Upsample(nn.Module): method __init__ (line 43) | def __init__(self, in_channels, with_conv): method forward (line 53) | def forward(self, x): class Downsample (line 60) | class Downsample(nn.Module): method __init__ (line 61) | def __init__(self, in_channels, with_conv): method forward (line 72) | def forward(self, x): class ResnetBlock (line 82) | class ResnetBlock(nn.Module): method __init__ (line 83) | def __init__(self, *, in_channels, out_channels=None, conv_shortcut=Fa... method forward (line 121) | def forward(self, x, temb): class LinAttnBlock (line 144) | class LinAttnBlock(LinearAttention): method __init__ (line 146) | def __init__(self, in_channels): class AttnBlock (line 150) | class AttnBlock(nn.Module): method __init__ (line 151) | def __init__(self, in_channels): method forward (line 178) | def forward(self, x): function make_attn (line 205) | def make_attn(in_channels, attn_type="vanilla"): class Model (line 216) | class Model(nn.Module): method __init__ (line 217) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 316) | def forward(self, x, t=None, context=None): method get_last_layer (line 364) | def get_last_layer(self): class Encoder (line 368) | class Encoder(nn.Module): method __init__ (line 369) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 434) | def forward(self, x): class Decoder (line 462) | class Decoder(nn.Module): method __init__ (line 463) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 535) | def forward(self, z): class SimpleDecoder (line 571) | class SimpleDecoder(nn.Module): method __init__ (line 572) | def __init__(self, in_channels, out_channels, *args, **kwargs): method forward (line 594) | def forward(self, x): class UpsampleDecoder (line 607) | class UpsampleDecoder(nn.Module): method __init__ (line 608) | def __init__(self, in_channels, out_channels, ch, num_res_blocks, reso... method forward (line 641) | def forward(self, x): class LatentRescaler (line 655) | class LatentRescaler(nn.Module): method __init__ (line 656) | def __init__(self, factor, in_channels, mid_channels, out_channels, de... method forward (line 680) | def forward(self, x): class MergedRescaleEncoder (line 692) | class MergedRescaleEncoder(nn.Module): method __init__ (line 693) | def __init__(self, in_channels, ch, resolution, out_ch, num_res_blocks, method forward (line 705) | def forward(self, x): class MergedRescaleDecoder (line 711) | class MergedRescaleDecoder(nn.Module): method __init__ (line 712) | def __init__(self, z_channels, out_ch, resolution, num_res_blocks, att... method forward (line 722) | def forward(self, x): class Upsampler (line 728) | class Upsampler(nn.Module): method __init__ (line 729) | def __init__(self, in_size, out_size, in_channels, out_channels, ch_mu... method forward (line 741) | def forward(self, x): class Resize (line 747) | class Resize(nn.Module): method __init__ (line 748) | def __init__(self, in_channels=None, learned=False, mode="bilinear"): method forward (line 763) | def forward(self, x, scale_factor=1.0): class FirstStagePostProcessor (line 770) | class FirstStagePostProcessor(nn.Module): method __init__ (line 772) | def __init__(self, ch_mult:list, in_channels, method instantiate_pretrained (line 807) | def instantiate_pretrained(self, config): method encode_with_pretrained (line 816) | def encode_with_pretrained(self,x): method forward (line 822) | def forward(self,x): FILE: models/instructpix2pix/stable_diffusion/ldm/modules/diffusionmodules/openaimodel.py function convert_module_to_f16 (line 24) | def convert_module_to_f16(x): function convert_module_to_f32 (line 27) | def convert_module_to_f32(x): class AttentionPool2d (line 32) | class AttentionPool2d(nn.Module): method __init__ (line 37) | def __init__( method forward (line 51) | def forward(self, x): class TimestepBlock (line 62) | class TimestepBlock(nn.Module): method forward (line 68) | def forward(self, x, emb): class TimestepEmbedSequential (line 74) | class TimestepEmbedSequential(nn.Sequential, TimestepBlock): method forward (line 80) | def forward(self, x, emb, context=None): class Upsample (line 91) | class Upsample(nn.Module): method __init__ (line 100) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 109) | def forward(self, x): class TransposedUpsample (line 121) | class TransposedUpsample(nn.Module): method __init__ (line 123) | def __init__(self, channels, out_channels=None, ks=5): method forward (line 130) | def forward(self,x): class Downsample (line 134) | class Downsample(nn.Module): method __init__ (line 143) | def __init__(self, channels, use_conv, dims=2, out_channels=None,paddi... method forward (line 158) | def forward(self, x): class ResBlock (line 163) | class ResBlock(TimestepBlock): method __init__ (line 179) | def __init__( method forward (line 243) | def forward(self, x, emb): method _forward (line 255) | def _forward(self, x, emb): class AttentionBlock (line 278) | class AttentionBlock(nn.Module): method __init__ (line 285) | def __init__( method forward (line 314) | def forward(self, x): method _forward (line 318) | def _forward(self, x): function count_flops_attn (line 327) | def count_flops_attn(model, _x, y): class QKVAttentionLegacy (line 347) | class QKVAttentionLegacy(nn.Module): method __init__ (line 352) | def __init__(self, n_heads): method forward (line 356) | def forward(self, qkv): method count_flops (line 375) | def count_flops(model, _x, y): class QKVAttention (line 379) | class QKVAttention(nn.Module): method __init__ (line 384) | def __init__(self, n_heads): method forward (line 388) | def forward(self, qkv): method count_flops (line 409) | def count_flops(model, _x, y): class UNetModel (line 413) | class UNetModel(nn.Module): method __init__ (line 443) | def __init__( method convert_to_fp16 (line 694) | def convert_to_fp16(self): method convert_to_fp32 (line 702) | def convert_to_fp32(self): method forward (line 710) | def forward(self, x, timesteps=None, context=None, y=None,**kwargs): class EncoderUNetModel (line 745) | class EncoderUNetModel(nn.Module): method __init__ (line 751) | def __init__( method convert_to_fp16 (line 924) | def convert_to_fp16(self): method convert_to_fp32 (line 931) | def convert_to_fp32(self): method forward (line 938) | def forward(self, x, timesteps): FILE: models/instructpix2pix/stable_diffusion/ldm/modules/diffusionmodules/util.py function make_beta_schedule (line 21) | def make_beta_schedule(schedule, n_timestep, linear_start=1e-4, linear_e... function make_ddim_timesteps (line 46) | def make_ddim_timesteps(ddim_discr_method, num_ddim_timesteps, num_ddpm_... function make_ddim_sampling_parameters (line 63) | def make_ddim_sampling_parameters(alphacums, ddim_timesteps, eta, verbos... function betas_for_alpha_bar (line 77) | def betas_for_alpha_bar(num_diffusion_timesteps, alpha_bar, max_beta=0.9... function extract_into_tensor (line 96) | def extract_into_tensor(a, t, x_shape): function checkpoint (line 102) | def checkpoint(func, inputs, params, flag): class CheckpointFunction (line 119) | class CheckpointFunction(torch.autograd.Function): method forward (line 121) | def forward(ctx, run_function, length, *args): method backward (line 131) | def backward(ctx, *output_grads): function timestep_embedding (line 151) | def timestep_embedding(timesteps, dim, max_period=10000, repeat_only=Fal... function zero_module (line 174) | def zero_module(module): function scale_module (line 183) | def scale_module(module, scale): function mean_flat (line 192) | def mean_flat(tensor): function normalization (line 199) | def normalization(channels): class SiLU (line 209) | class SiLU(nn.Module): method forward (line 210) | def forward(self, x): class GroupNorm32 (line 214) | class GroupNorm32(nn.GroupNorm): method forward (line 215) | def forward(self, x): function conv_nd (line 218) | def conv_nd(dims, *args, **kwargs): function linear (line 231) | def linear(*args, **kwargs): function avg_pool_nd (line 238) | def avg_pool_nd(dims, *args, **kwargs): class HybridConditioner (line 251) | class HybridConditioner(nn.Module): method __init__ (line 253) | def __init__(self, c_concat_config, c_crossattn_config): method forward (line 258) | def forward(self, c_concat, c_crossattn): function noise_like (line 264) | def noise_like(shape, device, repeat=False): FILE: models/instructpix2pix/stable_diffusion/ldm/modules/distributions/distributions.py class AbstractDistribution (line 5) | class AbstractDistribution: method sample (line 6) | def sample(self): method mode (line 9) | def mode(self): class DiracDistribution (line 13) | class DiracDistribution(AbstractDistribution): method __init__ (line 14) | def __init__(self, value): method sample (line 17) | def sample(self): method mode (line 20) | def mode(self): class DiagonalGaussianDistribution (line 24) | class DiagonalGaussianDistribution(object): method __init__ (line 25) | def __init__(self, parameters, deterministic=False): method sample (line 35) | def sample(self): method kl (line 39) | def kl(self, other=None): method nll (line 53) | def nll(self, sample, dims=[1,2,3]): method mode (line 61) | def mode(self): function normal_kl (line 65) | def normal_kl(mean1, logvar1, mean2, logvar2): FILE: models/instructpix2pix/stable_diffusion/ldm/modules/ema.py class LitEma (line 5) | class LitEma(nn.Module): method __init__ (line 6) | def __init__(self, model, decay=0.9999, use_num_upates=True): method forward (line 25) | def forward(self,model): method copy_to (line 46) | def copy_to(self, model): method store (line 55) | def store(self, parameters): method restore (line 64) | def restore(self, parameters): FILE: models/instructpix2pix/stable_diffusion/ldm/modules/encoders/modules.py class AbstractEncoder (line 12) | class AbstractEncoder(nn.Module): method __init__ (line 13) | def __init__(self): method encode (line 16) | def encode(self, *args, **kwargs): class ClassEmbedder (line 21) | class ClassEmbedder(nn.Module): method __init__ (line 22) | def __init__(self, embed_dim, n_classes=1000, key='class'): method forward (line 27) | def forward(self, batch, key=None): class TransformerEmbedder (line 36) | class TransformerEmbedder(AbstractEncoder): method __init__ (line 38) | def __init__(self, n_embed, n_layer, vocab_size, max_seq_len=77, devic... method forward (line 44) | def forward(self, tokens): method encode (line 49) | def encode(self, x): class BERTTokenizer (line 53) | class BERTTokenizer(AbstractEncoder): method __init__ (line 55) | def __init__(self, device="cuda", vq_interface=True, max_length=77): method forward (line 63) | def forward(self, text): method encode (line 70) | def encode(self, text): method decode (line 76) | def decode(self, text): class BERTEmbedder (line 80) | class BERTEmbedder(AbstractEncoder): method __init__ (line 82) | def __init__(self, n_embed, n_layer, vocab_size=30522, max_seq_len=77, method forward (line 93) | def forward(self, text): method encode (line 101) | def encode(self, text): class SpatialRescaler (line 106) | class SpatialRescaler(nn.Module): method __init__ (line 107) | def __init__(self, method forward (line 125) | def forward(self,x): method encode (line 134) | def encode(self, x): class FrozenCLIPEmbedder (line 137) | class FrozenCLIPEmbedder(AbstractEncoder): method __init__ (line 139) | def __init__(self, version="openai/clip-vit-large-patch14", device="cu... method freeze (line 147) | def freeze(self): method forward (line 152) | def forward(self, text): method encode (line 161) | def encode(self, text): class FrozenCLIPTextEmbedder (line 165) | class FrozenCLIPTextEmbedder(nn.Module): method __init__ (line 169) | def __init__(self, version='ViT-L/14', device="cuda", max_length=77, n... method freeze (line 177) | def freeze(self): method forward (line 182) | def forward(self, text): method encode (line 189) | def encode(self, text): class FrozenClipImageEmbedder (line 197) | class FrozenClipImageEmbedder(nn.Module): method __init__ (line 201) | def __init__( method preprocess (line 216) | def preprocess(self, x): method forward (line 226) | def forward(self, x): FILE: models/instructpix2pix/stable_diffusion/ldm/modules/image_degradation/bsrgan.py function modcrop_np (line 29) | def modcrop_np(img, sf): function analytic_kernel (line 49) | def analytic_kernel(k): function anisotropic_Gaussian (line 65) | def anisotropic_Gaussian(ksize=15, theta=np.pi, l1=6, l2=6): function gm_blur_kernel (line 86) | def gm_blur_kernel(mean, cov, size=15): function shift_pixel (line 99) | def shift_pixel(x, sf, upper_left=True): function blur (line 128) | def blur(x, k): function gen_kernel (line 145) | def gen_kernel(k_size=np.array([15, 15]), scale_factor=np.array([4, 4]),... function fspecial_gaussian (line 187) | def fspecial_gaussian(hsize, sigma): function fspecial_laplacian (line 201) | def fspecial_laplacian(alpha): function fspecial (line 210) | def fspecial(filter_type, *args, **kwargs): function bicubic_degradation (line 228) | def bicubic_degradation(x, sf=3): function srmd_degradation (line 240) | def srmd_degradation(x, k, sf=3): function dpsr_degradation (line 262) | def dpsr_degradation(x, k, sf=3): function classical_degradation (line 284) | def classical_degradation(x, k, sf=3): function add_sharpening (line 299) | def add_sharpening(img, weight=0.5, radius=50, threshold=10): function add_blur (line 325) | def add_blur(img, sf=4): function add_resize (line 339) | def add_resize(img, sf=4): function add_Gaussian_noise (line 369) | def add_Gaussian_noise(img, noise_level1=2, noise_level2=25): function add_speckle_noise (line 386) | def add_speckle_noise(img, noise_level1=2, noise_level2=25): function add_Poisson_noise (line 404) | def add_Poisson_noise(img): function add_JPEG_noise (line 418) | def add_JPEG_noise(img): function random_crop (line 427) | def random_crop(lq, hq, sf=4, lq_patchsize=64): function degradation_bsrgan (line 438) | def degradation_bsrgan(img, sf=4, lq_patchsize=72, isp_model=None): function degradation_bsrgan_variant (line 530) | def degradation_bsrgan_variant(image, sf=4, isp_model=None): function degradation_bsrgan_plus (line 617) | def degradation_bsrgan_plus(img, sf=4, shuffle_prob=0.5, use_sharp=True,... FILE: models/instructpix2pix/stable_diffusion/ldm/modules/image_degradation/bsrgan_light.py function modcrop_np (line 29) | def modcrop_np(img, sf): function analytic_kernel (line 49) | def analytic_kernel(k): function anisotropic_Gaussian (line 65) | def anisotropic_Gaussian(ksize=15, theta=np.pi, l1=6, l2=6): function gm_blur_kernel (line 86) | def gm_blur_kernel(mean, cov, size=15): function shift_pixel (line 99) | def shift_pixel(x, sf, upper_left=True): function blur (line 128) | def blur(x, k): function gen_kernel (line 145) | def gen_kernel(k_size=np.array([15, 15]), scale_factor=np.array([4, 4]),... function fspecial_gaussian (line 187) | def fspecial_gaussian(hsize, sigma): function fspecial_laplacian (line 201) | def fspecial_laplacian(alpha): function fspecial (line 210) | def fspecial(filter_type, *args, **kwargs): function bicubic_degradation (line 228) | def bicubic_degradation(x, sf=3): function srmd_degradation (line 240) | def srmd_degradation(x, k, sf=3): function dpsr_degradation (line 262) | def dpsr_degradation(x, k, sf=3): function classical_degradation (line 284) | def classical_degradation(x, k, sf=3): function add_sharpening (line 299) | def add_sharpening(img, weight=0.5, radius=50, threshold=10): function add_blur (line 325) | def add_blur(img, sf=4): function add_resize (line 343) | def add_resize(img, sf=4): function add_Gaussian_noise (line 373) | def add_Gaussian_noise(img, noise_level1=2, noise_level2=25): function add_speckle_noise (line 390) | def add_speckle_noise(img, noise_level1=2, noise_level2=25): function add_Poisson_noise (line 408) | def add_Poisson_noise(img): function add_JPEG_noise (line 422) | def add_JPEG_noise(img): function random_crop (line 431) | def random_crop(lq, hq, sf=4, lq_patchsize=64): function degradation_bsrgan (line 442) | def degradation_bsrgan(img, sf=4, lq_patchsize=72, isp_model=None): function degradation_bsrgan_variant (line 534) | def degradation_bsrgan_variant(image, sf=4, isp_model=None): FILE: models/instructpix2pix/stable_diffusion/ldm/modules/image_degradation/utils_image.py function is_image_file (line 29) | def is_image_file(filename): function get_timestamp (line 33) | def get_timestamp(): function imshow (line 37) | def imshow(x, title=None, cbar=False, figsize=None): function surf (line 47) | def surf(Z, cmap='rainbow', figsize=None): function get_image_paths (line 67) | def get_image_paths(dataroot): function _get_paths_from_images (line 74) | def _get_paths_from_images(path): function patches_from_image (line 93) | def patches_from_image(img, p_size=512, p_overlap=64, p_max=800): function imssave (line 112) | def imssave(imgs, img_path): function split_imageset (line 125) | def split_imageset(original_dataroot, taget_dataroot, n_channels=3, p_si... function mkdir (line 153) | def mkdir(path): function mkdirs (line 158) | def mkdirs(paths): function mkdir_and_rename (line 166) | def mkdir_and_rename(path): function imread_uint (line 185) | def imread_uint(path, n_channels=3): function imsave (line 203) | def imsave(img, img_path): function imwrite (line 209) | def imwrite(img, img_path): function read_img (line 220) | def read_img(path): function uint2single (line 249) | def uint2single(img): function single2uint (line 254) | def single2uint(img): function uint162single (line 259) | def uint162single(img): function single2uint16 (line 264) | def single2uint16(img): function uint2tensor4 (line 275) | def uint2tensor4(img): function uint2tensor3 (line 282) | def uint2tensor3(img): function tensor2uint (line 289) | def tensor2uint(img): function single2tensor3 (line 302) | def single2tensor3(img): function single2tensor4 (line 307) | def single2tensor4(img): function tensor2single (line 312) | def tensor2single(img): function tensor2single3 (line 320) | def tensor2single3(img): function single2tensor5 (line 329) | def single2tensor5(img): function single32tensor5 (line 333) | def single32tensor5(img): function single42tensor4 (line 337) | def single42tensor4(img): function tensor2img (line 342) | def tensor2img(tensor, out_type=np.uint8, min_max=(0, 1)): function augment_img (line 380) | def augment_img(img, mode=0): function augment_img_tensor4 (line 401) | def augment_img_tensor4(img, mode=0): function augment_img_tensor (line 422) | def augment_img_tensor(img, mode=0): function augment_img_np3 (line 441) | def augment_img_np3(img, mode=0): function augment_imgs (line 469) | def augment_imgs(img_list, hflip=True, rot=True): function modcrop (line 494) | def modcrop(img_in, scale): function shave (line 510) | def shave(img_in, border=0): function rgb2ycbcr (line 529) | def rgb2ycbcr(img, only_y=True): function ycbcr2rgb (line 553) | def ycbcr2rgb(img): function bgr2ycbcr (line 573) | def bgr2ycbcr(img, only_y=True): function channel_convert (line 597) | def channel_convert(in_c, tar_type, img_list): function calculate_psnr (line 621) | def calculate_psnr(img1, img2, border=0): function calculate_ssim (line 642) | def calculate_ssim(img1, img2, border=0): function ssim (line 669) | def ssim(img1, img2): function cubic (line 700) | def cubic(x): function calculate_weights_indices (line 708) | def calculate_weights_indices(in_length, out_length, scale, kernel, kern... function imresize (line 766) | def imresize(img, scale, antialiasing=True): function imresize_np (line 839) | def imresize_np(img, scale, antialiasing=True): FILE: models/instructpix2pix/stable_diffusion/ldm/modules/losses/contperceptual.py class LPIPSWithDiscriminator (line 7) | class LPIPSWithDiscriminator(nn.Module): method __init__ (line 8) | def __init__(self, disc_start, logvar_init=0.0, kl_weight=1.0, pixello... method calculate_adaptive_weight (line 32) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method forward (line 45) | def forward(self, inputs, reconstructions, posteriors, optimizer_idx, FILE: models/instructpix2pix/stable_diffusion/ldm/modules/losses/vqperceptual.py function hinge_d_loss_with_exemplar_weights (line 11) | def hinge_d_loss_with_exemplar_weights(logits_real, logits_fake, weights): function adopt_weight (line 20) | def adopt_weight(weight, global_step, threshold=0, value=0.): function measure_perplexity (line 26) | def measure_perplexity(predicted_indices, n_embed): function l1 (line 35) | def l1(x, y): function l2 (line 39) | def l2(x, y): class VQLPIPSWithDiscriminator (line 43) | class VQLPIPSWithDiscriminator(nn.Module): method __init__ (line 44) | def __init__(self, disc_start, codebook_weight=1.0, pixelloss_weight=1.0, method calculate_adaptive_weight (line 85) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method forward (line 98) | def forward(self, codebook_loss, inputs, reconstructions, optimizer_idx, FILE: models/instructpix2pix/stable_diffusion/ldm/modules/x_transformer.py class AbsolutePositionalEmbedding (line 25) | class AbsolutePositionalEmbedding(nn.Module): method __init__ (line 26) | def __init__(self, dim, max_seq_len): method init_ (line 31) | def init_(self): method forward (line 34) | def forward(self, x): class FixedPositionalEmbedding (line 39) | class FixedPositionalEmbedding(nn.Module): method __init__ (line 40) | def __init__(self, dim): method forward (line 45) | def forward(self, x, seq_dim=1, offset=0): function exists (line 54) | def exists(val): function default (line 58) | def default(val, d): function always (line 64) | def always(val): function not_equals (line 70) | def not_equals(val): function equals (line 76) | def equals(val): function max_neg_value (line 82) | def max_neg_value(tensor): function pick_and_pop (line 88) | def pick_and_pop(keys, d): function group_dict_by_key (line 93) | def group_dict_by_key(cond, d): function string_begins_with (line 102) | def string_begins_with(prefix, str): function group_by_key_prefix (line 106) | def group_by_key_prefix(prefix, d): function groupby_prefix_and_trim (line 110) | def groupby_prefix_and_trim(prefix, d): class Scale (line 117) | class Scale(nn.Module): method __init__ (line 118) | def __init__(self, value, fn): method forward (line 123) | def forward(self, x, **kwargs): class Rezero (line 128) | class Rezero(nn.Module): method __init__ (line 129) | def __init__(self, fn): method forward (line 134) | def forward(self, x, **kwargs): class ScaleNorm (line 139) | class ScaleNorm(nn.Module): method __init__ (line 140) | def __init__(self, dim, eps=1e-5): method forward (line 146) | def forward(self, x): class RMSNorm (line 151) | class RMSNorm(nn.Module): method __init__ (line 152) | def __init__(self, dim, eps=1e-8): method forward (line 158) | def forward(self, x): class Residual (line 163) | class Residual(nn.Module): method forward (line 164) | def forward(self, x, residual): class GRUGating (line 168) | class GRUGating(nn.Module): method __init__ (line 169) | def __init__(self, dim): method forward (line 173) | def forward(self, x, residual): class GEGLU (line 184) | class GEGLU(nn.Module): method __init__ (line 185) | def __init__(self, dim_in, dim_out): method forward (line 189) | def forward(self, x): class FeedForward (line 194) | class FeedForward(nn.Module): method __init__ (line 195) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.): method forward (line 210) | def forward(self, x): class Attention (line 215) | class Attention(nn.Module): method __init__ (line 216) | def __init__( method forward (line 268) | def forward( class AttentionLayers (line 370) | class AttentionLayers(nn.Module): method __init__ (line 371) | def __init__( method forward (line 481) | def forward( class Encoder (line 541) | class Encoder(AttentionLayers): method __init__ (line 542) | def __init__(self, **kwargs): class TransformerWrapper (line 548) | class TransformerWrapper(nn.Module): method __init__ (line 549) | def __init__( method init_ (line 595) | def init_(self): method forward (line 598) | def forward( FILE: models/instructpix2pix/stable_diffusion/ldm/util.py function log_txt_as_img (line 17) | def log_txt_as_img(wh, xc, size=10): function ismap (line 41) | def ismap(x): function isimage (line 47) | def isimage(x): function exists (line 53) | def exists(x): function default (line 57) | def default(val, d): function mean_flat (line 63) | def mean_flat(tensor): function count_params (line 71) | def count_params(model, verbose=False): function instantiate_from_config (line 78) | def instantiate_from_config(config): function get_obj_from_str (line 88) | def get_obj_from_str(string, reload=False): function _do_parallel_data_prefetch (line 96) | def _do_parallel_data_prefetch(func, Q, data, idx, idx_to_fn=False): function parallel_data_prefetch (line 108) | def parallel_data_prefetch( FILE: models/instructpix2pix/stable_diffusion/main.py function get_parser (line 24) | def get_parser(**parser_kwargs): function nondefault_trainer_args (line 126) | def nondefault_trainer_args(opt): class WrappedDataset (line 133) | class WrappedDataset(Dataset): method __init__ (line 136) | def __init__(self, dataset): method __len__ (line 139) | def __len__(self): method __getitem__ (line 142) | def __getitem__(self, idx): function worker_init_fn (line 146) | def worker_init_fn(_): class DataModuleFromConfig (line 162) | class DataModuleFromConfig(pl.LightningDataModule): method __init__ (line 163) | def __init__(self, batch_size, train=None, validation=None, test=None,... method prepare_data (line 185) | def prepare_data(self): method setup (line 189) | def setup(self, stage=None): method _train_dataloader (line 197) | def _train_dataloader(self): method _val_dataloader (line 207) | def _val_dataloader(self, shuffle=False): method _test_dataloader (line 218) | def _test_dataloader(self, shuffle=False): method _predict_dataloader (line 231) | def _predict_dataloader(self, shuffle=False): class SetupCallback (line 240) | class SetupCallback(Callback): method __init__ (line 241) | def __init__(self, resume, now, logdir, ckptdir, cfgdir, config, light... method on_keyboard_interrupt (line 251) | def on_keyboard_interrupt(self, trainer, pl_module): method on_pretrain_routine_start (line 257) | def on_pretrain_routine_start(self, trainer, pl_module): class ImageLogger (line 289) | class ImageLogger(Callback): method __init__ (line 290) | def __init__(self, batch_frequency, max_images, clamp=True, increase_l... method _testtube (line 310) | def _testtube(self, pl_module, images, batch_idx, split): method log_local (line 321) | def log_local(self, save_dir, split, images, method log_img (line 340) | def log_img(self, pl_module, batch, batch_idx, split="train"): method check_frequency (line 372) | def check_frequency(self, check_idx): method on_train_batch_end (line 383) | def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch... method on_validation_batch_end (line 387) | def on_validation_batch_end(self, trainer, pl_module, outputs, batch, ... class CUDACallback (line 395) | class CUDACallback(Callback): method on_train_epoch_start (line 397) | def on_train_epoch_start(self, trainer, pl_module): method on_train_epoch_end (line 403) | def on_train_epoch_end(self, trainer, pl_module, outputs): function melk (line 697) | def melk(*args, **kwargs): function divein (line 705) | def divein(*args, **kwargs): FILE: models/instructpix2pix/stable_diffusion/notebook_helpers.py function download_models (line 19) | def download_models(mode): function load_model_from_config (line 40) | def load_model_from_config(config, ckpt): function get_model (line 52) | def get_model(mode): function get_custom_cond (line 59) | def get_custom_cond(mode): function get_cond_options (line 85) | def get_cond_options(mode): function select_cond_path (line 92) | def select_cond_path(mode): function get_cond (line 107) | def get_cond(mode, selected_path): function visualize_cond_img (line 127) | def visualize_cond_img(path): function run (line 131) | def run(model, selected_path, task, custom_steps, resize_enabled=False, ... function convsample_ddim (line 188) | def convsample_ddim(model, cond, steps, shape, eta=1.0, callback=None, n... function make_convolutional_sample (line 208) | def make_convolutional_sample(batch, model, mode="vanilla", custom_steps... FILE: models/instructpix2pix/stable_diffusion/scripts/img2img.py function chunk (line 23) | def chunk(it, size): function load_model_from_config (line 28) | def load_model_from_config(config, ckpt, verbose=False): function load_img (line 48) | def load_img(path): function main (line 60) | def main(): FILE: models/instructpix2pix/stable_diffusion/scripts/inpaint.py function make_batch (line 11) | def make_batch(image, mask, device): FILE: models/instructpix2pix/stable_diffusion/scripts/knn2img.py function chunk (line 36) | def chunk(it, size): function load_model_from_config (line 41) | def load_model_from_config(config, ckpt, verbose=False): class Searcher (line 61) | class Searcher(object): method __init__ (line 62) | def __init__(self, database, retriever_version='ViT-L/14'): method train_searcher (line 75) | def train_searcher(self, k, method load_single_file (line 91) | def load_single_file(self, saved_embeddings): method load_multi_files (line 96) | def load_multi_files(self, data_archive): method load_database (line 104) | def load_database(self): method load_retriever (line 123) | def load_retriever(self, version='ViT-L/14', ): method load_searcher (line 130) | def load_searcher(self): method search (line 135) | def search(self, x, k): method __call__ (line 163) | def __call__(self, x, n): FILE: models/instructpix2pix/stable_diffusion/scripts/sample_diffusion.py function custom_to_pil (line 15) | def custom_to_pil(x): function custom_to_np (line 27) | def custom_to_np(x): function logs2pil (line 36) | def logs2pil(logs, keys=["sample"]): function convsample (line 54) | def convsample(model, shape, return_intermediates=True, function convsample_ddim (line 69) | def convsample_ddim(model, steps, shape, eta=1.0 function make_convolutional_sample (line 79) | def make_convolutional_sample(model, batch_size, vanilla=False, custom_s... function run (line 108) | def run(model, logdir, batch_size=50, vanilla=False, custom_steps=None, ... function save_logs (line 143) | def save_logs(logs, path, n_saved=0, key="sample", np_path=None): function get_parser (line 162) | def get_parser(): function load_model_from_config (line 220) | def load_model_from_config(config, sd): function load_model (line 228) | def load_model(config, ckpt, gpu, eval_mode): FILE: models/instructpix2pix/stable_diffusion/scripts/tests/test_watermark.py function testit (line 6) | def testit(img_path): FILE: models/instructpix2pix/stable_diffusion/scripts/train_searcher.py function search_bruteforce (line 12) | def search_bruteforce(searcher): function search_partioned_ah (line 16) | def search_partioned_ah(searcher, dims_per_block, aiq_threshold, reorder_k, function search_ah (line 24) | def search_ah(searcher, dims_per_block, aiq_threshold, reorder_k): function load_datapool (line 28) | def load_datapool(dpath): function train_searcher (line 62) | def train_searcher(opt, FILE: models/instructpix2pix/stable_diffusion/scripts/txt2img.py function chunk (line 32) | def chunk(it, size): function numpy_to_pil (line 37) | def numpy_to_pil(images): function load_model_from_config (line 49) | def load_model_from_config(config, ckpt, verbose=False): function put_watermark (line 69) | def put_watermark(img, wm_encoder=None): function load_replacement (line 77) | def load_replacement(x): function check_safety (line 88) | def check_safety(x_image): function main (line 98) | def main(): FILE: models/masactrl/diffuser_utils.py class MasaCtrlPipeline (line 14) | class MasaCtrlPipeline(StableDiffusionPipeline): method next_step (line 16) | def next_step( method step (line 39) | def step( method image2latent (line 60) | def image2latent(self, image): method latent2image (line 72) | def latent2image(self, latents, return_type='np'): method latent2image_grad (line 84) | def latent2image_grad(self, latents): method __call__ (line 91) | def __call__( method invert (line 196) | def invert( FILE: models/masactrl/masactrl.py class MutualSelfAttentionControl (line 14) | class MutualSelfAttentionControl(AttentionBase): method __init__ (line 20) | def __init__(self, start_step=4, start_layer=10, layer_idx=None, step_... method attn_batch (line 41) | def attn_batch(self, q, k, v, sim, attn, is_cross, place_in_unet, num_... method forward (line 56) | def forward(self, q, k, v, sim, attn, is_cross, place_in_unet, num_hea... class MutualSelfAttentionControlUnion (line 75) | class MutualSelfAttentionControlUnion(MutualSelfAttentionControl): method __init__ (line 76) | def __init__(self, start_step=4, start_layer=10, layer_idx=None, step_... method forward (line 89) | def forward(self, q, k, v, sim, attn, is_cross, place_in_unet, num_hea... class MutualSelfAttentionControlMask (line 114) | class MutualSelfAttentionControlMask(MutualSelfAttentionControl): method __init__ (line 115) | def __init__(self, start_step=4, start_layer=10, layer_idx=None, step... method attn_batch (line 138) | def attn_batch(self, q, k, v, sim, attn, is_cross, place_in_unet, num_... method forward (line 163) | def forward(self, q, k, v, sim, attn, is_cross, place_in_unet, num_hea... class MutualSelfAttentionControlMaskAuto (line 196) | class MutualSelfAttentionControlMaskAuto(MutualSelfAttentionControl): method __init__ (line 197) | def __init__(self, start_step=4, start_layer=10, layer_idx=None, step_... method after_step (line 227) | def after_step(self): method attn_batch (line 231) | def attn_batch(self, q, k, v, sim, attn, is_cross, place_in_unet, num_... method aggregate_cross_attn_map (line 260) | def aggregate_cross_attn_map(self, idx): method forward (line 273) | def forward(self, q, k, v, sim, attn, is_cross, place_in_unet, num_hea... FILE: models/masactrl/masactrl_utils.py class AttentionBase (line 14) | class AttentionBase: method __init__ (line 15) | def __init__(self): method after_step (line 20) | def after_step(self): method __call__ (line 23) | def __call__(self, q, k, v, sim, attn, is_cross, place_in_unet, num_he... method forward (line 33) | def forward(self, q, k, v, sim, attn, is_cross, place_in_unet, num_hea... method reset (line 38) | def reset(self): class AttentionStore (line 43) | class AttentionStore(AttentionBase): method __init__ (line 44) | def __init__(self, res=[32], min_step=0, max_step=1000): method after_step (line 57) | def after_step(self): method forward (line 70) | def forward(self, q, k, v, sim, attn, is_cross, place_in_unet, num_hea... function regiter_attention_editor_diffusers (line 79) | def regiter_attention_editor_diffusers(model, editor: AttentionBase): function regiter_attention_editor_ldm (line 147) | def regiter_attention_editor_ldm(model, editor: AttentionBase): FILE: models/p2p/attention_control.py function register_attention_control (line 12) | def register_attention_control(model, controller): function get_equalizer (line 84) | def get_equalizer(text, word_select, values, tokenizer=None): class LocalBlend (line 95) | class LocalBlend: method get_mask (line 97) | def get_mask(self, maps, alpha, use_pool): method __call__ (line 108) | def __call__(self, x_t, attention_store): method __init__ (line 123) | def __init__(self, prompts, words, substruct_words=None, start_blend=0... class EmptyControl (line 150) | class EmptyControl: method step_callback (line 152) | def step_callback(self, x_t): method between_steps (line 155) | def between_steps(self): method __call__ (line 158) | def __call__(self, attn, is_cross, place_in_unet): class AttentionControl (line 162) | class AttentionControl(abc.ABC): method step_callback (line 164) | def step_callback(self, x_t): method between_steps (line 167) | def between_steps(self): method num_uncond_att_layers (line 171) | def num_uncond_att_layers(self): method forward (line 175) | def forward (self, attn, is_cross, place_in_unet): method __call__ (line 178) | def __call__(self, attn, is_cross, place_in_unet): method reset (line 192) | def reset(self): method __init__ (line 196) | def __init__(self): class SpatialReplace (line 201) | class SpatialReplace(EmptyControl): method step_callback (line 203) | def step_callback(self, x_t): method __init__ (line 209) | def __init__(self, stop_inject,num_ddim_steps=50): class AttentionStore (line 214) | class AttentionStore(AttentionControl): method get_empty_store (line 217) | def get_empty_store(): method forward (line 221) | def forward(self, attn, is_cross, place_in_unet): method between_steps (line 227) | def between_steps(self): method get_average_attention (line 236) | def get_average_attention(self): method reset (line 240) | def reset(self): method __init__ (line 245) | def __init__(self): class AttentionControlEdit (line 251) | class AttentionControlEdit(AttentionStore, abc.ABC): method step_callback (line 253) | def step_callback(self, x_t): method replace_self_attention (line 258) | def replace_self_attention(self, attn_base, att_replace, place_in_unet): method replace_cross_attention (line 266) | def replace_cross_attention(self, attn_base, att_replace): method forward (line 269) | def forward(self, attn, is_cross, place_in_unet): method __init__ (line 284) | def __init__(self, class AttentionReplace (line 301) | class AttentionReplace(AttentionControlEdit): method replace_cross_attention (line 303) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 306) | def __init__(self, prompts, num_steps, cross_replace_steps, self_repla... class AttentionRefine (line 317) | class AttentionRefine(AttentionControlEdit): method replace_cross_attention (line 319) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 325) | def __init__(self, prompts, num_steps, cross_replace_steps, self_repla... class AttentionReweight (line 338) | class AttentionReweight(AttentionControlEdit): method replace_cross_attention (line 340) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 347) | def __init__(self, function make_controller (line 366) | def make_controller(pipeline, FILE: models/p2p/inversion.py class NegativePromptInversion (line 10) | class NegativePromptInversion: method prev_step (line 12) | def prev_step(self, model_output, timestep, sample): method next_step (line 22) | def next_step(self, model_output, timestep, sample): method get_noise_pred_single (line 32) | def get_noise_pred_single(self, latents, t, context): method init_prompt (line 37) | def init_prompt(self, prompt): method ddim_loop (line 55) | def ddim_loop(self, latent): method scheduler (line 68) | def scheduler(self): method ddim_inversion (line 72) | def ddim_inversion(self, image): method invert (line 78) | def invert(self, image_gt, prompt, npi_interp=0.0): method __init__ (line 103) | def __init__(self, model,num_ddim_steps): class NullInversion (line 113) | class NullInversion: method prev_step (line 115) | def prev_step(self, model_output, timestep: int, sample): method next_step (line 125) | def next_step(self, model_output, timestep: int, sample): method get_noise_pred_single (line 135) | def get_noise_pred_single(self, latents, t, context): method get_noise_pred (line 139) | def get_noise_pred(self, latents, t, guidance_scale, is_forward=True, ... method init_prompt (line 154) | def init_prompt(self, prompt: str): method ddim_loop (line 174) | def ddim_loop(self, latent): method scheduler (line 186) | def scheduler(self): method ddim_inversion (line 190) | def ddim_inversion(self, image): method null_optimization (line 196) | def null_optimization(self, latents, num_inner_steps, epsilon, guidanc... method invert (line 227) | def invert(self, image_gt, prompt, guidance_scale, num_inner_steps=10,... method __init__ (line 236) | def __init__(self, model,num_ddim_steps): class DirectInversion (line 245) | class DirectInversion: method prev_step (line 247) | def prev_step(self, model_output, timestep: int, sample): method next_step (line 262) | def next_step(self, model_output, timestep: int, sample): method get_noise_pred_single (line 272) | def get_noise_pred_single(self, latents, t, context): method get_noise_pred (line 276) | def get_noise_pred(self, latents, t, guidance_scale, is_forward=True, ... method init_prompt (line 291) | def init_prompt(self, prompt: str): method ddim_loop (line 309) | def ddim_loop(self, latent): method ddim_null_loop (line 322) | def ddim_null_loop(self, latent): method ddim_with_guidance_scale_loop (line 335) | def ddim_with_guidance_scale_loop(self, latent,guidance_scale): method scheduler (line 351) | def scheduler(self): method ddim_inversion (line 355) | def ddim_inversion(self, image): method ddim_null_inversion (line 362) | def ddim_null_inversion(self, image): method ddim_with_guidance_scale_inversion (line 369) | def ddim_with_guidance_scale_inversion(self, image,guidance_scale): method offset_calculate (line 375) | def offset_calculate(self, latents, num_inner_steps, epsilon, guidance... method invert (line 393) | def invert(self, image_gt, prompt, guidance_scale, num_inner_steps=10,... method invert_without_attn_controller (line 402) | def invert_without_attn_controller(self, image_gt, prompt, guidance_sc... method invert_with_guidance_scale_vary_guidance (line 410) | def invert_with_guidance_scale_vary_guidance(self, image_gt, prompt, i... method null_latent_calculate (line 419) | def null_latent_calculate(self, latents, num_inner_steps, epsilon, gui... method invert_null_latent (line 463) | def invert_null_latent(self, image_gt, prompt, guidance_scale, num_inn... method offset_calculate_not_full (line 472) | def offset_calculate_not_full(self, latents, num_inner_steps, epsilon,... method invert_not_full (line 491) | def invert_not_full(self, image_gt, prompt, guidance_scale, num_inner_... method offset_calculate_skip_step (line 500) | def offset_calculate_skip_step(self, latents, num_inner_steps, epsilon... method invert_skip_step (line 522) | def invert_skip_step(self, image_gt, prompt, guidance_scale, skip_step... method __init__ (line 532) | def __init__(self, model,num_ddim_steps): FILE: models/p2p/p2p_guidance_forward.py function p2p_guidance_diffusion_step (line 6) | def p2p_guidance_diffusion_step(model, controller, latents, context, t, ... function p2p_guidance_forward (line 22) | def p2p_guidance_forward( function p2p_guidance_forward_single_branch (line 65) | def p2p_guidance_forward_single_branch( function direct_inversion_p2p_guidance_diffusion_step (line 103) | def direct_inversion_p2p_guidance_diffusion_step(model, controller, late... function direct_inversion_p2p_guidance_diffusion_step_add_target (line 119) | def direct_inversion_p2p_guidance_diffusion_step_add_target(model, contr... function direct_inversion_p2p_guidance_forward (line 136) | def direct_inversion_p2p_guidance_forward( function direct_inversion_p2p_guidance_forward_add_target (line 176) | def direct_inversion_p2p_guidance_forward_add_target( FILE: models/p2p/proximal_guidance_forward.py function dilate (line 7) | def dilate(image, kernel_size, stride=1, padding=0): function proximal_guidance_diffusion_step (line 19) | def proximal_guidance_diffusion_step(model, controller, latents, context... function proximal_guidance_forward (line 86) | def proximal_guidance_forward( FILE: models/p2p/scheduler_dev.py class DDIMSchedulerDev (line 8) | class DDIMSchedulerDev(DDIMScheduler): method step (line 10) | def step( FILE: models/p2p/seq_aligner.py class ScoreParams (line 18) | class ScoreParams: method __init__ (line 20) | def __init__(self, gap, match, mismatch): method mis_match_char (line 25) | def mis_match_char(self, x, y): function get_matrix (line 32) | def get_matrix(size_x, size_y, gap): function get_matrix (line 46) | def get_matrix(size_x, size_y, gap): function get_traceback_matrix (line 53) | def get_traceback_matrix(size_x, size_y): function global_align (line 61) | def global_align(x, y, score): function get_aligned_sequences (line 79) | def get_aligned_sequences(x, y, trace_back): function get_mapper (line 107) | def get_mapper(x, y, tokenizer, max_len=77): function get_refinement_mapper (line 121) | def get_refinement_mapper(prompts, tokenizer, max_len=77): function get_word_inds (line 131) | def get_word_inds(text, word_place, tokenizer): function get_replacement_mapper_ (line 152) | def get_replacement_mapper_(x, y, tokenizer, max_len=77): function get_replacement_mapper (line 189) | def get_replacement_mapper(prompts, tokenizer, max_len=77): FILE: models/p2p_editor.py class P2PEditor (line 12) | class P2PEditor: method __init__ (line 13) | def __init__(self, method_list, device, num_ddim_steps=50) -> None: method __call__ (line 28) | def __call__(self, method edit_image_ddim (line 137) | def edit_image_ddim( method edit_image_null_text_inversion (line 199) | def edit_image_null_text_inversion( method edit_image_null_text_inversion_single_branch (line 261) | def edit_image_null_text_inversion_single_branch( method edit_image_negative_prompt_inversion (line 324) | def edit_image_negative_prompt_inversion( method edit_image_directinversion (line 415) | def edit_image_directinversion( method edit_image_directinversion_vary_guidance_scale (line 481) | def edit_image_directinversion_vary_guidance_scale( method edit_image_null_text_inversion_proximal_guidanca (line 550) | def edit_image_null_text_inversion_proximal_guidanca( method edit_image_null_latent_inversion (line 640) | def edit_image_null_latent_inversion( method edit_image_directinversion_not_full (line 707) | def edit_image_directinversion_not_full( method edit_image_directinversion_skip_step (line 775) | def edit_image_directinversion_skip_step( method edit_image_directinversion_add_target (line 842) | def edit_image_directinversion_add_target( method edit_image_directinversion_add_source (line 909) | def edit_image_directinversion_add_source( FILE: models/pix2pix_zero/base_pipeline.py class BasePipeline (line 17) | class BasePipeline(DiffusionPipeline): method __init__ (line 19) | def __init__( method _execution_device (line 110) | def _execution_device(self): method _encode_prompt (line 129) | def _encode_prompt( method decode_latents (line 269) | def decode_latents(self, latents): method prepare_latents (line 277) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method prepare_extra_step_kwargs (line 295) | def prepare_extra_step_kwargs(self, generator, eta): method run_safety_checker (line 313) | def run_safety_checker(self, image, device, dtype): FILE: models/pix2pix_zero/cross_attention.py class MyCrossAttnProcessor (line 4) | class MyCrossAttnProcessor: method __call__ (line 5) | def __call__(self, attn: CrossAttention, hidden_states, encoder_hidden... function prep_unet (line 45) | def prep_unet(unet): FILE: models/pix2pix_zero/ddim_inv.py class DDIMInversion (line 21) | class DDIMInversion(BasePipeline): method auto_corr_loss (line 23) | def auto_corr_loss(self, x, random_shift=True): method kl_divergence (line 41) | def kl_divergence(self, x): method __call__ (line 47) | def __call__( FILE: models/pix2pix_zero/edit_directions.py function construct_direction (line 22) | def construct_direction(task_name): FILE: models/pix2pix_zero/edit_pipeline.py class EditingPipeline (line 17) | class EditingPipeline(BasePipeline): method __call__ (line 18) | def __call__( FILE: models/pix2pix_zero/scheduler.py class DDIMSchedulerOutput (line 32) | class DDIMSchedulerOutput(BaseOutput): function betas_for_alpha_bar (line 49) | def betas_for_alpha_bar(num_diffusion_timesteps, max_beta=0.999) -> torc... class DDIMInverseScheduler (line 78) | class DDIMInverseScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 119) | def __init__( method scale_model_input (line 162) | def scale_model_input(self, sample: torch.FloatTensor, timestep: Optio... method _get_variance (line 176) | def _get_variance(self, timestep, prev_timestep): method set_timesteps (line 186) | def set_timesteps(self, num_inference_steps: int, device: Union[str, t... method step (line 210) | def step( method add_noise (line 250) | def add_noise( method get_velocity (line 273) | def get_velocity( method __len__ (line 293) | def __len__(self): FILE: models/stylediffusion/clip_util.py class VisionTransformer (line 12) | class VisionTransformer(nn.Module): method __init__ (line 13) | def __init__(self, input_resolution: int, patch_size: int, width: int,... method forward (line 29) | def forward(self, x: torch.Tensor): FILE: models/stylediffusion/global_var.py function _init (line 3) | def _init(): function set_value (line 7) | def set_value(key, value): function get_value (line 10) | def get_value(key): FILE: models/stylediffusion/inversion.py class VaeInversion (line 18) | class VaeInversion: method prev_step (line 20) | def prev_step(self, model_output: Union[torch.FloatTensor, np.ndarray]... method next_step (line 32) | def next_step(self, model_output: Union[torch.FloatTensor, np.ndarray]... method get_noise_pred_single (line 44) | def get_noise_pred_single(self, latents, t, context): method get_noise_pred (line 48) | def get_noise_pred(self, latents, t, is_forward=True, context=None, tr... method latent2image (line 66) | def latent2image(self, latents, return_type='np'): method image2latent (line 76) | def image2latent(self, image): method init_prompt (line 90) | def init_prompt(self, prompt: List[str]): method ddim_loop (line 108) | def ddim_loop(self, latent, trainer=None): method scheduler (line 147) | def scheduler(self): method ddim_inversion (line 151) | def ddim_inversion(self, image, trainer=None): method optimization (line 157) | def optimization(self, trainer, latents, image, num_inner_steps, num_e... method invert (line 234) | def invert(self, image_path: List[str], prompt: List[str], offsets=(0,... method eval_init (line 257) | def eval_init(self, image_path: List[str], prompt_gt: List[str], offse... method __init__ (line 271) | def __init__(self, model): FILE: models/stylediffusion/ptp_utils_v.py function image_grid (line 24) | def image_grid(imgs, rows, cols): function text_under_image (line 35) | def text_under_image(image: np.ndarray, text: str, text_color: Tuple[int... function view_images (line 48) | def view_images(images, num_rows=1, offset_ratio=0.02, save_name='ptp'): function save_image_grid (line 73) | def save_image_grid(img, fname, grid_size): function diffusion_step (line 87) | def diffusion_step(model, controller, latents, context, t, guidance_scal... function latent2image (line 103) | def latent2image(vae, latents): function init_latent (line 112) | def init_latent(latent, model, height, width, generator, batch_size): function text2image_ldm (line 123) | def text2image_ldm( function text2image_ldm_stable (line 154) | def text2image_ldm_stable( function register_attention_control (line 199) | def register_attention_control(model, controller): function get_word_inds (line 269) | def get_word_inds(text: str, word_place: int, tokenizer): function update_alpha_time_word (line 290) | def update_alpha_time_word(alpha, bounds: Union[float, Tuple[float, floa... function get_time_words_attention_alpha (line 303) | def get_time_words_attention_alpha(prompts, num_steps, FILE: models/stylediffusion/seq_aligner.py class ScoreParams (line 18) | class ScoreParams: method __init__ (line 20) | def __init__(self, gap, match, mismatch): method mis_match_char (line 25) | def mis_match_char(self, x, y): function get_matrix (line 32) | def get_matrix(size_x, size_y, gap): function get_matrix (line 46) | def get_matrix(size_x, size_y, gap): function get_traceback_matrix (line 53) | def get_traceback_matrix(size_x, size_y): function global_align (line 61) | def global_align(x, y, score): function get_aligned_sequences (line 79) | def get_aligned_sequences(x, y, trace_back): function get_mapper (line 107) | def get_mapper(x: str, y: str, tokenizer, max_len=77): function get_refinement_mapper (line 121) | def get_refinement_mapper(prompts, tokenizer, max_len=77): function get_word_inds (line 131) | def get_word_inds(text: str, word_place: int, tokenizer): function get_replacement_mapper_ (line 152) | def get_replacement_mapper_(x: str, y: str, tokenizer, max_len=77): function get_replacement_mapper (line 189) | def get_replacement_mapper(prompts, tokenizer, max_len=77): FILE: models/stylediffusion/utils.py class LocalBlend (line 26) | class LocalBlend: method get_mask (line 28) | def get_mask(self, maps, alpha, use_pool): method __call__ (line 39) | def __call__(self, x_t, attention_store): method __init__ (line 54) | def __init__(self, prompts: List[str], words: [List[List[str]]], subst... class EmptyControl (line 80) | class EmptyControl: method step_callback (line 82) | def step_callback(self, x_t): method between_steps (line 85) | def between_steps(self): method __call__ (line 88) | def __call__(self, attn, is_cross: bool, place_in_unet: str): class AttentionControl (line 91) | class AttentionControl(abc.ABC): method step_callback (line 93) | def step_callback(self, x_t): method between_steps (line 96) | def between_steps(self): method num_uncond_att_layers (line 100) | def num_uncond_att_layers(self): method forward (line 104) | def forward(self, attn, is_cross: bool, place_in_unet: str): method replace_uncond (line 108) | def replace_uncond(self, attn, is_cross: bool, place_in_unet: str): method __call__ (line 111) | def __call__(self, attn, is_cross: bool, place_in_unet: str): method reset (line 127) | def reset(self): method __init__ (line 131) | def __init__(self): class SpatialReplace (line 136) | class SpatialReplace(EmptyControl): method step_callback (line 138) | def step_callback(self, x_t): method __init__ (line 144) | def __init__(self, stop_inject: float): class AttentionStore (line 148) | class AttentionStore(AttentionControl): method get_empty_store (line 151) | def get_empty_store(): method forward (line 155) | def forward(self, attn, is_cross: bool, place_in_unet: str): method replace_uncond (line 161) | def replace_uncond(self, attn, is_cross: bool, place_in_unet: str): method between_steps (line 164) | def between_steps(self): method get_average_attention (line 173) | def get_average_attention(self): method reset (line 178) | def reset(self): method __init__ (line 183) | def __init__(self, tau_neg=.0): class AttentionControlEdit (line 189) | class AttentionControlEdit(AttentionStore, abc.ABC): method step_callback (line 191) | def step_callback(self, x_t): method replace_self_attention (line 196) | def replace_self_attention(self, attn_base, att_replace, place_in_unet): method replace_cross_attention (line 204) | def replace_cross_attention(self, attn_base, att_replace): method forward (line 207) | def forward(self, attn, is_cross: bool, place_in_unet: str): method replace_uncond (line 223) | def replace_uncond(self, attn, is_cross: bool, place_in_unet: str): method __init__ (line 233) | def __init__(self, prompts, num_steps: int, class AttentionReplace (line 250) | class AttentionReplace(AttentionControlEdit): method replace_cross_attention (line 252) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 255) | def __init__(self, prompts, num_steps: int, cross_replace_steps: float... class AttentionRefine (line 260) | class AttentionRefine(AttentionControlEdit): method replace_cross_attention (line 262) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 268) | def __init__(self, prompts, num_steps: int, cross_replace_steps: float... class AttentionReweight (line 276) | class AttentionReweight(AttentionControlEdit): method replace_cross_attention (line 278) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 285) | def __init__(self, prompts, num_steps: int, cross_replace_steps: float... function get_equalizer (line 292) | def get_equalizer(text: str, word_select: Union[int, Tuple[int, ...]], v... function aggregate_attention (line 303) | def aggregate_attention(attention_store: AttentionStore, prompts: List[s... function make_controller (line 316) | def make_controller(prompts: List[str], is_replace_controller: bool, cro... function show_cross_attention (line 335) | def show_cross_attention(attention_store: AttentionStore, prompts: List[... function show_hot_cross_attention (line 350) | def show_hot_cross_attention(attention_store: AttentionStore, prompts: L... function show_self_attention_comp (line 390) | def show_self_attention_comp(attention_store: AttentionStore, prompts: L... function load_512 (line 406) | def load_512(image_path, left=0, right=0, top=0, bottom=0): function register_attention_control (line 427) | def register_attention_control(model, trainer, controller): function image_grid (line 533) | def image_grid(img, grid_size): class Trainer (line 541) | class Trainer(AttentionStore): method __init__ (line 542) | def __init__(self): method load_pretrained (line 573) | def load_pretrained(self, pretrained_embedding): method named_params_and_buffers (line 578) | def named_params_and_buffers(self, module): method copy_params_and_buffers (line 582) | def copy_params_and_buffers(self, src_vae, dst_vae, require_all=False): method encode_images (line 597) | def encode_images(self, images: torch.Tensor) -> torch.Tensor: method forward_embed (line 601) | def forward_embed(self, context): FILE: run_editing_blended_latent_diffusion.py function setup_seed (line 13) | def setup_seed(seed=1234): function mask_decode (line 22) | def mask_decode(encoded_mask,image_shape=[512,512]): class BlendedLatnetDiffusion (line 42) | class BlendedLatnetDiffusion: method __init__ (line 43) | def __init__(self,model_path="stabilityai/stable-diffusion-2-1-base",d... method load_models (line 48) | def load_models(self): method edit_image (line 65) | def edit_image( method _image2latent (line 155) | def _image2latent(self, image): method _read_mask (line 164) | def _read_mask(self, mask, dest_size=(64, 64)): FILE: run_editing_edict.py function mask_decode (line 6) | def mask_decode(encoded_mask,image_shape=[512,512]): function setup_seed (line 24) | def setup_seed(seed=1234): function edit_image_edict_p2p (line 32) | def edit_image_edict_p2p( FILE: run_editing_edit_friendly_p2p.py function mask_decode (line 19) | def mask_decode(encoded_mask,image_shape=[512,512]): function setup_seed (line 38) | def setup_seed(seed=1234): function edit_image_EF (line 64) | def edit_image_EF(edit_method, FILE: run_editing_instructdiffusion.py class CFGDenoiser (line 32) | class CFGDenoiser(nn.Module): method __init__ (line 33) | def __init__(self, model): method forward (line 37) | def forward(self, z, sigma, cond, uncond, text_cfg_scale, image_cfg_sc... function load_model_from_config (line 50) | def load_model_from_config(config, ckpt, vae_ckpt=None, verbose=False): function mask_decode (line 63) | def mask_decode(encoded_mask,image_shape=[512,512]): function setup_seed (line 82) | def setup_seed(seed=1234): function instruct_diffusion_edit (line 90) | def instruct_diffusion_edit(edit_method, image_path,model, edit_prompt, ... FILE: run_editing_instructpix2pix.py function setup_seed (line 24) | def setup_seed(seed=1234): class CFGDenoiser (line 33) | class CFGDenoiser(nn.Module): method __init__ (line 34) | def __init__(self, model): method forward (line 38) | def forward(self, z, sigma, cond, uncond, text_cfg_scale, image_cfg_sc... function load_model_from_config (line 49) | def load_model_from_config(config, ckpt, vae_ckpt=None, verbose=False): function mask_decode (line 73) | def mask_decode(encoded_mask,image_shape=[512,512]): function edit_instruct_pix2pix (line 92) | def edit_instruct_pix2pix( FILE: run_editing_masactrl.py function mask_decode (line 21) | def mask_decode(encoded_mask,image_shape=[512,512]): function setup_seed (line 40) | def setup_seed(seed=1234): function load_image (line 49) | def load_image(image_path, device): class MasaCtrlEditor (line 58) | class MasaCtrlEditor: method __init__ (line 59) | def __init__(self, method_list, device, num_ddim_steps=50) -> None: method __call__ (line 74) | def __call__(self, method edit_image_directinversion_MasaCtrl (line 89) | def edit_image_directinversion_MasaCtrl(self,image_path,prompt_src,pro... method edit_image_ddim_MasaCtrl (line 131) | def edit_image_ddim_MasaCtrl(self, image_path,prompt_src,prompt_tar,gu... FILE: run_editing_p2p.py function mask_decode (line 11) | def mask_decode(encoded_mask,image_shape=[512,512]): function setup_seed (line 30) | def setup_seed(seed=1234): FILE: run_editing_p2p_one_image.py function mask_decode (line 11) | def mask_decode(encoded_mask,image_shape=[512,512]): function setup_seed (line 30) | def setup_seed(seed=1234): FILE: run_editing_pix2pix_zero.py function setup_seed (line 45) | def setup_seed(seed=1234): function load_sentence_embeddings (line 55) | def load_sentence_embeddings(l_sentences, tokenizer, text_encoder, devic... function edit_image_ddim_pix2pix_zero (line 72) | def edit_image_ddim_pix2pix_zero(image_path, function edit_image_directinversion_pix2pix_zero (line 108) | def edit_image_directinversion_pix2pix_zero(image_path, function mask_decode (line 145) | def mask_decode(encoded_mask,image_shape=[512,512]): FILE: run_editing_pnp.py function setup_seed (line 21) | def setup_seed(seed=1234): function get_timesteps (line 30) | def get_timesteps(scheduler, num_inference_steps, strength, device): class Preprocess (line 40) | class Preprocess(nn.Module): method __init__ (line 41) | def __init__(self, device,model_key): method get_text_embeds (line 61) | def get_text_embeds(self, prompt, negative_prompt, device="cuda"): method decode_latents (line 72) | def decode_latents(self, latents): method load_img (line 79) | def load_img(self, image_path): method encode_imgs (line 85) | def encode_imgs(self, imgs): method ddim_inversion (line 93) | def ddim_inversion(self, cond, latent): method ddim_sample (line 119) | def ddim_sample(self, x, cond): method extract_latents (line 144) | def extract_latents(self, num_steps, data_path, function register_time (line 159) | def register_time(model, t): function register_attention_control_efficient (line 176) | def register_attention_control_efficient(model, injection_schedule): function register_conv_control_efficient (line 239) | def register_conv_control_efficient(model, injection_schedule): class PNP (line 296) | class PNP(nn.Module): method __init__ (line 297) | def __init__(self, model_key,n_timesteps=NUM_DDIM_STEPS,device="cuda"): method get_text_embeds (line 318) | def get_text_embeds(self, prompt, negative_prompt, batch_size=1): method decode_latent (line 335) | def decode_latent(self, latent): method get_data (line 343) | def get_data(self,image_path): method denoise_step (line 351) | def denoise_step(self, x, t,guidance_scale,noisy_latent): method init_pnp (line 371) | def init_pnp(self, conv_injection_t, qk_injection_t): method run_pnp (line 377) | def run_pnp(self,image_path,noisy_latent,target_prompt,guidance_scale=... method sample_loop (line 393) | def sample_loop(self, x,guidance_scale,noisy_latent): function edit_image_ddim_PnP (line 414) | def edit_image_ddim_PnP( function edit_image_directinversion_PnP (line 440) | def edit_image_directinversion_PnP( function mask_decode (line 465) | def mask_decode(encoded_mask,image_shape=[512,512]): FILE: run_editing_stylediffusion.py function mask_decode (line 45) | def mask_decode(encoded_mask,image_shape=[512,512]): function text2image_ldm_stable (line 66) | def text2image_ldm_stable( function run_and_display (line 117) | def run_and_display(stable, prompts, trainer, controller, latent=None, r... function setup_seed (line 132) | def setup_seed(seed=1234): function edit_image_stylediffusion_p2p (line 140) | def edit_image_stylediffusion_p2p( FILE: utils/utils.py function slerp (line 7) | def slerp(val, low, high): function slerp_tensor (line 19) | def slerp_tensor(val, low, high): function load_512 (line 27) | def load_512(image_path, left=0, right=0, top=0, bottom=0): function init_latent (line 48) | def init_latent(latent, model, height, width, generator, batch_size): function latent2image (line 59) | def latent2image(model, latents, return_type='np'): function image2latent (line 69) | def image2latent(model, image): function get_word_inds (line 84) | def get_word_inds(text: str, word_place: int, tokenizer): function update_alpha_time_word (line 104) | def update_alpha_time_word(alpha, bounds, prompt_ind, function get_time_words_attention_alpha (line 117) | def get_time_words_attention_alpha(prompts, num_steps, function txt_draw (line 137) | def txt_draw(text,