SYMBOL INDEX (2905 symbols across 181 files) FILE: build_launcher.py function build_launcher (line 14) | def build_launcher(): FILE: extras/BLIP/models/blip.py class BLIP_Base (line 23) | class BLIP_Base(nn.Module): method __init__ (line 24) | def __init__(self, method forward (line 46) | def forward(self, image, caption, mode): class BLIP_Decoder (line 78) | class BLIP_Decoder(nn.Module): method __init__ (line 79) | def __init__(self, method forward (line 105) | def forward(self, image, caption): method generate (line 128) | def generate(self, image, sample=False, num_beams=3, max_length=30, mi... function blip_decoder (line 172) | def blip_decoder(pretrained='',**kwargs): function blip_feature_extractor (line 179) | def blip_feature_extractor(pretrained='',**kwargs): function init_tokenizer (line 186) | def init_tokenizer(): function create_vit (line 195) | def create_vit(vit, image_size, use_grad_checkpointing=False, ckpt_layer... function is_url (line 212) | def is_url(url_or_filename): function load_checkpoint (line 216) | def load_checkpoint(model,url_or_filename): FILE: extras/BLIP/models/blip_itm.py class BLIP_ITM (line 10) | class BLIP_ITM(nn.Module): method __init__ (line 11) | def __init__(self, method forward (line 41) | def forward(self, image, caption, match_head='itm'): function blip_itm (line 70) | def blip_itm(pretrained='',**kwargs): FILE: extras/BLIP/models/blip_nlvr.py class BLIP_NLVR (line 16) | class BLIP_NLVR(nn.Module): method __init__ (line 17) | def __init__(self, method forward (line 44) | def forward(self, image, text, targets, train=True): function blip_nlvr (line 69) | def blip_nlvr(pretrained='',**kwargs): function load_checkpoint (line 78) | def load_checkpoint(model,url_or_filename): FILE: extras/BLIP/models/blip_pretrain.py class BLIP_Pretrain (line 19) | class BLIP_Pretrain(nn.Module): method __init__ (line 20) | def __init__(self, method forward (line 97) | def forward(self, image, caption, alpha): method copy_params (line 217) | def copy_params(self): method _momentum_update (line 225) | def _momentum_update(self): method _dequeue_and_enqueue (line 232) | def _dequeue_and_enqueue(self, image_feat, text_feat): function blip_pretrain (line 250) | def blip_pretrain(**kwargs): function concat_all_gather (line 256) | def concat_all_gather(tensor): function tie_encoder_decoder_weights (line 270) | def tie_encoder_decoder_weights(encoder: nn.Module, decoder: nn.Module, ... FILE: extras/BLIP/models/blip_retrieval.py class BLIP_Retrieval (line 10) | class BLIP_Retrieval(nn.Module): method __init__ (line 11) | def __init__(self, method forward (line 72) | def forward(self, image, caption, alpha, idx): method copy_params (line 229) | def copy_params(self): method _momentum_update (line 237) | def _momentum_update(self): method _dequeue_and_enqueue (line 244) | def _dequeue_and_enqueue(self, image_feat, text_feat, idxs): function blip_retrieval (line 264) | def blip_retrieval(pretrained='',**kwargs): function concat_all_gather (line 274) | def concat_all_gather(tensor): class GatherLayer (line 287) | class GatherLayer(torch.autograd.Function): method forward (line 294) | def forward(ctx, x): method backward (line 300) | def backward(ctx, *grads): function all_gather_with_grad (line 306) | def all_gather_with_grad(tensors): FILE: extras/BLIP/models/blip_vqa.py class BLIP_VQA (line 10) | class BLIP_VQA(nn.Module): method __init__ (line 11) | def __init__(self, method forward (line 37) | def forward(self, image, question, answer=None, n=None, weights=None, ... method rank_answer (line 120) | def rank_answer(self, question_states, question_atts, answer_ids, answ... function blip_vqa (line 170) | def blip_vqa(pretrained='',**kwargs): function tile (line 178) | def tile(x, dim, n_tile): FILE: extras/BLIP/models/med.py class BertEmbeddings (line 52) | class BertEmbeddings(nn.Module): method __init__ (line 55) | def __init__(self, config): method forward (line 71) | def forward( class BertSelfAttention (line 97) | class BertSelfAttention(nn.Module): method __init__ (line 98) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 126) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 129) | def get_attn_gradients(self): method save_attention_map (line 132) | def save_attention_map(self, attention_map): method get_attention_map (line 135) | def get_attention_map(self): method transpose_for_scores (line 138) | def transpose_for_scores(self, x): method forward (line 143) | def forward( class BertSelfOutput (line 228) | class BertSelfOutput(nn.Module): method __init__ (line 229) | def __init__(self, config): method forward (line 235) | def forward(self, hidden_states, input_tensor): class BertAttention (line 242) | class BertAttention(nn.Module): method __init__ (line 243) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 249) | def prune_heads(self, heads): method forward (line 267) | def forward( class BertIntermediate (line 291) | class BertIntermediate(nn.Module): method __init__ (line 292) | def __init__(self, config): method forward (line 300) | def forward(self, hidden_states): class BertOutput (line 306) | class BertOutput(nn.Module): method __init__ (line 307) | def __init__(self, config): method forward (line 313) | def forward(self, hidden_states, input_tensor): class BertLayer (line 320) | class BertLayer(nn.Module): method __init__ (line 321) | def __init__(self, config, layer_num): method forward (line 333) | def forward( method feed_forward_chunk (line 380) | def feed_forward_chunk(self, attention_output): class BertEncoder (line 386) | class BertEncoder(nn.Module): method __init__ (line 387) | def __init__(self, config): method forward (line 393) | def forward( class BertPooler (line 486) | class BertPooler(nn.Module): method __init__ (line 487) | def __init__(self, config): method forward (line 492) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 501) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 502) | def __init__(self, config): method forward (line 511) | def forward(self, hidden_states): class BertLMPredictionHead (line 518) | class BertLMPredictionHead(nn.Module): method __init__ (line 519) | def __init__(self, config): method forward (line 532) | def forward(self, hidden_states): class BertOnlyMLMHead (line 538) | class BertOnlyMLMHead(nn.Module): method __init__ (line 539) | def __init__(self, config): method forward (line 543) | def forward(self, sequence_output): class BertPreTrainedModel (line 548) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 558) | def _init_weights(self, module): class BertModel (line 571) | class BertModel(BertPreTrainedModel): method __init__ (line 581) | def __init__(self, config, add_pooling_layer=True): method get_input_embeddings (line 594) | def get_input_embeddings(self): method set_input_embeddings (line 597) | def set_input_embeddings(self, value): method _prune_heads (line 600) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 609) | def get_extended_attention_mask(self, attention_mask: Tensor, input_sh... method forward (line 670) | def forward( class BertLMHeadModel (line 811) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 816) | def __init__(self, config): method get_output_embeddings (line 824) | def get_output_embeddings(self): method set_output_embeddings (line 827) | def set_output_embeddings(self, new_embeddings): method forward (line 830) | def forward( method prepare_inputs_for_generation (line 932) | def prepare_inputs_for_generation(self, input_ids, past=None, attentio... method _reorder_cache (line 951) | def _reorder_cache(self, past, beam_idx): FILE: extras/BLIP/models/nlvr_encoder.py class BertEmbeddings (line 42) | class BertEmbeddings(nn.Module): method __init__ (line 45) | def __init__(self, config): method forward (line 61) | def forward( class BertSelfAttention (line 87) | class BertSelfAttention(nn.Module): method __init__ (line 88) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 116) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 119) | def get_attn_gradients(self): method save_attention_map (line 122) | def save_attention_map(self, attention_map): method get_attention_map (line 125) | def get_attention_map(self): method transpose_for_scores (line 128) | def transpose_for_scores(self, x): method forward (line 133) | def forward( class BertSelfOutput (line 218) | class BertSelfOutput(nn.Module): method __init__ (line 219) | def __init__(self, config, twin=False, merge=False): method forward (line 235) | def forward(self, hidden_states, input_tensor): class BertAttention (line 251) | class BertAttention(nn.Module): method __init__ (line 252) | def __init__(self, config, is_cross_attention=False, layer_num=-1): method prune_heads (line 262) | def prune_heads(self, heads): method forward (line 280) | def forward( class BertIntermediate (line 327) | class BertIntermediate(nn.Module): method __init__ (line 328) | def __init__(self, config): method forward (line 336) | def forward(self, hidden_states): class BertOutput (line 342) | class BertOutput(nn.Module): method __init__ (line 343) | def __init__(self, config): method forward (line 349) | def forward(self, hidden_states, input_tensor): class BertLayer (line 356) | class BertLayer(nn.Module): method __init__ (line 357) | def __init__(self, config, layer_num): method forward (line 369) | def forward( method feed_forward_chunk (line 415) | def feed_forward_chunk(self, attention_output): class BertEncoder (line 421) | class BertEncoder(nn.Module): method __init__ (line 422) | def __init__(self, config): method forward (line 428) | def forward( class BertPooler (line 521) | class BertPooler(nn.Module): method __init__ (line 522) | def __init__(self, config): method forward (line 527) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 536) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 537) | def __init__(self, config): method forward (line 546) | def forward(self, hidden_states): class BertLMPredictionHead (line 553) | class BertLMPredictionHead(nn.Module): method __init__ (line 554) | def __init__(self, config): method forward (line 567) | def forward(self, hidden_states): class BertOnlyMLMHead (line 573) | class BertOnlyMLMHead(nn.Module): method __init__ (line 574) | def __init__(self, config): method forward (line 578) | def forward(self, sequence_output): class BertPreTrainedModel (line 583) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 593) | def _init_weights(self, module): class BertModel (line 606) | class BertModel(BertPreTrainedModel): method __init__ (line 616) | def __init__(self, config, add_pooling_layer=True): method get_input_embeddings (line 629) | def get_input_embeddings(self): method set_input_embeddings (line 632) | def set_input_embeddings(self, value): method _prune_heads (line 635) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 644) | def get_extended_attention_mask(self, attention_mask: Tensor, input_sh... method forward (line 705) | def forward( FILE: extras/BLIP/models/vit.py function checkpoint_wrapper (line 22) | def checkpoint_wrapper(x): class Mlp (line 26) | class Mlp(nn.Module): method __init__ (line 29) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 38) | def forward(self, x): class Attention (line 47) | class Attention(nn.Module): method __init__ (line 48) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at... method save_attn_gradients (line 61) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 64) | def get_attn_gradients(self): method save_attention_map (line 67) | def save_attention_map(self, attention_map): method get_attention_map (line 70) | def get_attention_map(self): method forward (line 73) | def forward(self, x, register_hook=False): class Block (line 92) | class Block(nn.Module): method __init__ (line 94) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 110) | def forward(self, x, register_hook=False): class VisionTransformer (line 116) | class VisionTransformer(nn.Module): method __init__ (line 121) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method _init_weights (line 170) | def _init_weights(self, m): method no_weight_decay (line 180) | def no_weight_decay(self): method forward (line 183) | def forward(self, x, register_blk=-1): method load_pretrained (line 200) | def load_pretrained(self, checkpoint_path, prefix=''): function _load_weights (line 205) | def _load_weights(model: VisionTransformer, checkpoint_path: str, prefix... function interpolate_pos_embed (line 284) | def interpolate_pos_embed(pos_embed_checkpoint, visual_encoder): FILE: extras/GroundingDINO/util/inference.py class GroundingDinoModel (line 15) | class GroundingDinoModel(Model): method __init__ (line 16) | def __init__(self): method predict_with_caption (line 24) | def predict_with_caption( function predict (line 64) | def predict( FILE: extras/censor.py class Censor (line 17) | class Censor: method __init__ (line 18) | def __init__(self): method init (line 24) | def init(self): method censor (line 39) | def censor(self, images: list | np.ndarray) -> list | np.ndarray: FILE: extras/expansion.py function safe_str (line 24) | def safe_str(x): function remove_pattern (line 31) | def remove_pattern(x, pattern): class FooocusExpansion (line 37) | class FooocusExpansion: method __init__ (line 38) | def __init__(self): method logits_processor (line 83) | def logits_processor(self, input_ids, scores): method __call__ (line 95) | def __call__(self, prompt, seed): FILE: extras/face_crop.py function align_warp_face (line 9) | def align_warp_face(self, landmark, border_mode='constant'): function crop_image (line 24) | def crop_image(img_rgb): FILE: extras/facexlib/detection/__init__.py function init_detection_model (line 8) | def init_detection_model(model_name, half=False, device='cuda', model_ro... FILE: extras/facexlib/detection/align_trans.py class FaceWarpException (line 13) | class FaceWarpException(Exception): method __str__ (line 15) | def __str__(self): function get_reference_facial_points (line 19) | def get_reference_facial_points(output_size=None, inner_padding_factor=0... function get_affine_transform_matrix (line 112) | def get_affine_transform_matrix(src_pts, dst_pts): function warp_and_crop_face (line 145) | def warp_and_crop_face(src_img, facial_pts, reference_pts=None, crop_siz... FILE: extras/facexlib/detection/matlab_cp2tform.py class MatlabCp2tormException (line 7) | class MatlabCp2tormException(Exception): method __str__ (line 9) | def __str__(self): function tformfwd (line 13) | def tformfwd(trans, uv): function tforminv (line 37) | def tforminv(trans, uv): function findNonreflectiveSimilarity (line 60) | def findNonreflectiveSimilarity(uv, xy, options=None): function findSimilarity (line 94) | def findSimilarity(uv, xy, options=None): function get_similarity_transform (line 130) | def get_similarity_transform(src_pts, dst_pts, reflective=True): function cvt_tform_mat_for_cv2 (line 170) | def cvt_tform_mat_for_cv2(trans): function get_similarity_transform_for_cv2 (line 198) | def get_similarity_transform_for_cv2(src_pts, dst_pts, reflective=True): FILE: extras/facexlib/detection/retinaface.py function generate_config (line 15) | def generate_config(network_name): class RetinaFace (line 71) | class RetinaFace(nn.Module): method __init__ (line 73) | def __init__(self, network_name='resnet50', half=False, phase='test', ... method forward (line 120) | def forward(self, inputs): method __detect_faces (line 145) | def __detect_faces(self, inputs): method transform (line 165) | def transform(self, image, use_origin_size): method detect_faces (line 192) | def detect_faces( method __align_multi (line 235) | def __align_multi(self, image, boxes, landmarks, limit=None): method align_multi (line 253) | def align_multi(self, img, conf_threshold=0.8, limit=None): method batched_transform (line 261) | def batched_transform(self, frames, use_origin_size): method batched_detect_faces (line 304) | def batched_detect_faces(self, frames, conf_threshold=0.8, nms_thresho... FILE: extras/facexlib/detection/retinaface_net.py function conv_bn (line 6) | def conv_bn(inp, oup, stride=1, leaky=0): function conv_bn_no_relu (line 12) | def conv_bn_no_relu(inp, oup, stride): function conv_bn1X1 (line 19) | def conv_bn1X1(inp, oup, stride, leaky=0): function conv_dw (line 25) | def conv_dw(inp, oup, stride, leaky=0.1): class SSH (line 36) | class SSH(nn.Module): method __init__ (line 38) | def __init__(self, in_channel, out_channel): method forward (line 52) | def forward(self, input): class FPN (line 66) | class FPN(nn.Module): method __init__ (line 68) | def __init__(self, in_channels_list, out_channels): method forward (line 80) | def forward(self, input): class MobileNetV1 (line 100) | class MobileNetV1(nn.Module): method __init__ (line 102) | def __init__(self): method forward (line 127) | def forward(self, x): class ClassHead (line 138) | class ClassHead(nn.Module): method __init__ (line 140) | def __init__(self, inchannels=512, num_anchors=3): method forward (line 145) | def forward(self, x): class BboxHead (line 152) | class BboxHead(nn.Module): method __init__ (line 154) | def __init__(self, inchannels=512, num_anchors=3): method forward (line 158) | def forward(self, x): class LandmarkHead (line 165) | class LandmarkHead(nn.Module): method __init__ (line 167) | def __init__(self, inchannels=512, num_anchors=3): method forward (line 171) | def forward(self, x): function make_class_head (line 178) | def make_class_head(fpn_num=3, inchannels=64, anchor_num=2): function make_bbox_head (line 185) | def make_bbox_head(fpn_num=3, inchannels=64, anchor_num=2): function make_landmark_head (line 192) | def make_landmark_head(fpn_num=3, inchannels=64, anchor_num=2): FILE: extras/facexlib/detection/retinaface_utils.py class PriorBox (line 8) | class PriorBox(object): method __init__ (line 10) | def __init__(self, cfg, image_size=None, phase='train'): method forward (line 19) | def forward(self): function py_cpu_nms (line 39) | def py_cpu_nms(dets, thresh): function point_form (line 50) | def point_form(boxes): function center_size (line 65) | def center_size(boxes): function intersect (line 79) | def intersect(box_a, box_b): function jaccard (line 98) | def jaccard(box_a, box_b): function matrix_iou (line 117) | def matrix_iou(a, b): function matrix_iof (line 130) | def matrix_iof(a, b): function match (line 142) | def match(threshold, truths, priors, variances, labels, landms, loc_t, c... function encode (line 200) | def encode(matched, priors, variances): function encode_landm (line 224) | def encode_landm(matched, priors, variances): function decode (line 254) | def decode(loc, priors, variances): function decode_landm (line 274) | def decode_landm(pre, priors, variances): function batched_decode (line 297) | def batched_decode(b_loc, priors, variances): function batched_decode_landm (line 320) | def batched_decode_landm(pre, priors, variances): function log_sum_exp (line 343) | def log_sum_exp(x): function nms (line 357) | def nms(boxes, scores, overlap=0.5, top_k=200): FILE: extras/facexlib/parsing/__init__.py function init_parsing_model (line 8) | def init_parsing_model(model_name='bisenet', half=False, device='cuda', ... FILE: extras/facexlib/parsing/bisenet.py class ConvBNReLU (line 8) | class ConvBNReLU(nn.Module): method __init__ (line 10) | def __init__(self, in_chan, out_chan, ks=3, stride=1, padding=1): method forward (line 15) | def forward(self, x): class BiSeNetOutput (line 21) | class BiSeNetOutput(nn.Module): method __init__ (line 23) | def __init__(self, in_chan, mid_chan, num_class): method forward (line 28) | def forward(self, x): class AttentionRefinementModule (line 34) | class AttentionRefinementModule(nn.Module): method __init__ (line 36) | def __init__(self, in_chan, out_chan): method forward (line 43) | def forward(self, x): class ContextPath (line 53) | class ContextPath(nn.Module): method __init__ (line 55) | def __init__(self): method forward (line 64) | def forward(self, x): class FeatureFusionModule (line 87) | class FeatureFusionModule(nn.Module): method __init__ (line 89) | def __init__(self, in_chan, out_chan): method forward (line 97) | def forward(self, fsp, fcp): class BiSeNet (line 110) | class BiSeNet(nn.Module): method __init__ (line 112) | def __init__(self, num_class): method forward (line 120) | def forward(self, x, return_feat=False): FILE: extras/facexlib/parsing/parsenet.py class NormLayer (line 8) | class NormLayer(nn.Module): method __init__ (line 16) | def __init__(self, channels, normalize_shape=None, norm_type='bn'): method forward (line 35) | def forward(self, x, ref=None): class ReluLayer (line 42) | class ReluLayer(nn.Module): method __init__ (line 54) | def __init__(self, channels, relu_type='relu'): method forward (line 70) | def forward(self, x): class ConvLayer (line 74) | class ConvLayer(nn.Module): method __init__ (line 76) | def __init__(self, method forward (line 103) | def forward(self, x): class ResidualBlock (line 113) | class ResidualBlock(nn.Module): method __init__ (line 118) | def __init__(self, c_in, c_out, relu_type='prelu', norm_type='bn', sca... method forward (line 132) | def forward(self, x): class ParseNet (line 140) | class ParseNet(nn.Module): method __init__ (line 142) | def __init__(self, method forward (line 188) | def forward(self, x): FILE: extras/facexlib/parsing/resnet.py function conv3x3 (line 5) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 10) | class BasicBlock(nn.Module): method __init__ (line 12) | def __init__(self, in_chan, out_chan, stride=1): method forward (line 26) | def forward(self, x): function create_layer_basic (line 41) | def create_layer_basic(in_chan, out_chan, bnum, stride=1): class ResNet18 (line 48) | class ResNet18(nn.Module): method __init__ (line 50) | def __init__(self): method forward (line 60) | def forward(self, x): FILE: extras/facexlib/utils/face_restoration_helper.py function get_largest_face (line 12) | def get_largest_face(det_faces, h, w): function get_center_face (line 34) | def get_center_face(det_faces, h=0, w=0, center=None): class FaceRestoreHelper (line 48) | class FaceRestoreHelper(object): method __init__ (line 51) | def __init__(self, method set_upscale_factor (line 105) | def set_upscale_factor(self, upscale_factor): method read_image (line 108) | def read_image(self, img): method get_face_landmarks_5 (line 123) | def get_face_landmarks_5(self, method align_warp_face (line 234) | def align_warp_face(self, save_cropped_path=None, border_mode='constan... method get_inverse_affine (line 266) | def get_inverse_affine(self, save_inverse_affine_path=None): method add_restored_face (line 278) | def add_restored_face(self, face): method paste_faces_to_input_image (line 281) | def paste_faces_to_input_image(self, save_path=None, upsample_img=None): method clean_all (line 367) | def clean_all(self): FILE: extras/facexlib/utils/face_utils.py function compute_increased_bbox (line 6) | def compute_increased_bbox(bbox, increase_area, preserve_aspect=True): function get_valid_bboxes (line 23) | def get_valid_bboxes(bboxes, h, w): function align_crop_face_landmarks (line 31) | def align_crop_face_landmarks(img, function paste_face_back (line 190) | def paste_face_back(img, face, inverse_affine): FILE: extras/facexlib/utils/misc.py function imwrite (line 11) | def imwrite(img, file_path, params=None, auto_mkdir=True): function img2tensor (line 30) | def img2tensor(imgs, bgr2rgb=True, float32=True): function load_file_from_url (line 59) | def load_file_from_url(url, model_dir=None, progress=True, file_name=Non... function scandir (line 81) | def scandir(dir_path, suffix=None, recursive=False, full_path=False): FILE: extras/inpaint_mask.py class SAMOptions (line 13) | class SAMOptions: method __init__ (line 14) | def __init__(self, function optimize_masks (line 35) | def optimize_masks(masks: torch.Tensor) -> torch.Tensor: function generate_mask_from_image (line 46) | def generate_mask_from_image(image: np.ndarray, mask_model: str = 'sam',... FILE: extras/interrogate.py class Interrogator (line 17) | class Interrogator: method __init__ (line 18) | def __init__(self): method interrogate (line 26) | def interrogate(self, img_rgb): FILE: extras/ip_adapter.py function sdp (line 18) | def sdp(q, k, v, extra_options): class ImageProjModel (line 22) | class ImageProjModel(torch.nn.Module): method __init__ (line 23) | def __init__(self, cross_attention_dim=1024, clip_embeddings_dim=1024,... method forward (line 31) | def forward(self, image_embeds): class To_KV (line 39) | class To_KV(torch.nn.Module): method __init__ (line 40) | def __init__(self, cross_attention_dim): method load_state_dict_ordered (line 47) | def load_state_dict_ordered(self, sd): class IPAdapterModel (line 58) | class IPAdapterModel(torch.nn.Module): method __init__ (line 59) | def __init__(self, state_dict, plus, cross_attention_dim=768, clip_emb... function load_ip_adapter (line 91) | def load_ip_adapter(clip_vision_path, ip_negative_path, ip_adapter_path): function clip_preprocess (line 153) | def clip_preprocess(image): function preprocess (line 167) | def preprocess(img, ip_adapter_path): function patch_model (line 204) | def patch_model(model, tasks): FILE: extras/preprocessors.py function centered_canny (line 5) | def centered_canny(x: np.ndarray, canny_low_threshold, canny_high_thresh... function centered_canny_color (line 14) | def centered_canny_color(x: np.ndarray, canny_low_threshold, canny_high_... function pyramid_canny_color (line 23) | def pyramid_canny_color(x: np.ndarray, canny_low_threshold, canny_high_t... function norm255 (line 43) | def norm255(x, low=4, high=96): function canny_pyramid (line 56) | def canny_pyramid(x, canny_low_threshold, canny_high_threshold): function cpds (line 66) | def cpds(x): FILE: extras/resampler.py function FeedForward (line 9) | def FeedForward(dim, mult=4): function reshape_tensor (line 19) | def reshape_tensor(x, heads): class PerceiverAttention (line 30) | class PerceiverAttention(nn.Module): method __init__ (line 31) | def __init__(self, *, dim, dim_head=64, heads=8): method forward (line 46) | def forward(self, x, latents): class Resampler (line 78) | class Resampler(nn.Module): method __init__ (line 79) | def __init__( method forward (line 110) | def forward(self, x): FILE: extras/safety_checker/models/safety_checker.py function cosine_distance (line 26) | def cosine_distance(image_embeds, text_embeds): class StableDiffusionSafetyChecker (line 32) | class StableDiffusionSafetyChecker(PreTrainedModel): method __init__ (line 38) | def __init__(self, config: CLIPConfig): method forward (line 51) | def forward(self, clip_input, images): method forward_onnx (line 103) | def forward_onnx(self, clip_input: torch.Tensor, images: torch.Tensor): FILE: extras/sam/predictor.py class SamPredictor (line 19) | class SamPredictor: method __init__ (line 20) | def __init__( method set_image (line 45) | def set_image( method set_torch_image (line 74) | def set_torch_image( method predict (line 104) | def predict( method predict_torch (line 181) | def predict_torch( method get_image_embedding (line 264) | def get_image_embedding(self) -> torch.Tensor: method device (line 278) | def device(self) -> torch.device: method reset_image (line 281) | def reset_image(self) -> None: FILE: extras/vae_interpose.py class ResBlock (line 14) | class ResBlock(nn.Module): method __init__ (line 17) | def __init__(self, ch): method forward (line 30) | def forward(self, x): class ExtractBlock (line 35) | class ExtractBlock(nn.Module): method __init__ (line 38) | def __init__(self, ch_in, ch_out): method forward (line 51) | def forward(self, x): class InterposerModel (line 55) | class InterposerModel(nn.Module): method __init__ (line 58) | def __init__(self, ch_in=4, ch_out=4, ch_mid=64, scale=1.0, blocks=12): method forward (line 75) | def forward(self, x): function parse (line 85) | def parse(x): FILE: extras/wd14tagger.py function default_interrogator (line 27) | def default_interrogator(image_rgb, threshold=0.35, character_threshold=... FILE: javascript/contextMenus.js function showContextMenu (line 11) | function showContextMenu(event, element, menuEntries) { function appendContextMenuOption (line 62) | function appendContextMenuOption(targetElementSelector, entryName, entry... function removeContextMenuOption (line 81) | function removeContextMenuOption(uid) { function addContextMenuEventListener (line 95) | function addContextMenuEventListener() { FILE: javascript/edit-attention.js function updateInput (line 1) | function updateInput(target) { function keyupEditAttention (line 7) | function keyupEditAttention(event) { FILE: javascript/imageviewer.js function closeModal (line 3) | function closeModal() { function showModal (line 7) | function showModal(event) { function negmod (line 21) | function negmod(n, m) { function updateOnBackgroundChange (line 25) | function updateOnBackgroundChange() { function all_gallery_buttons (line 40) | function all_gallery_buttons() { function selected_gallery_button (line 51) | function selected_gallery_button() { function selected_gallery_index (line 55) | function selected_gallery_index() { function modalImageSwitch (line 59) | function modalImageSwitch(offset) { function saveImage (line 88) | function saveImage() { function modalSaveImage (line 92) | function modalSaveImage(event) { function modalNextImage (line 96) | function modalNextImage(event) { function modalPrevImage (line 101) | function modalPrevImage(event) { function modalKeyHandler (line 106) | function modalKeyHandler(event) { function setupImageForLightbox (line 123) | function setupImageForLightbox(e) { function modalZoomSet (line 154) | function modalZoomSet(modalImage, enable) { function modalZoomToggle (line 158) | function modalZoomToggle(event) { function modalTileImageToggle (line 164) | function modalTileImageToggle(event) { FILE: javascript/localization.js function hasLocalization (line 6) | function hasLocalization() { function textNodesUnder (line 10) | function textNodesUnder(el) { function canBeTranslated (line 16) | function canBeTranslated(node, text) { function getTranslation (line 25) | function getTranslation(text) { function processTextNode (line 40) | function processTextNode(node) { function processNode (line 54) | function processNode(node) { function refresh_style_localization (line 79) | function refresh_style_localization() { function refresh_aspect_ratios_label (line 83) | function refresh_aspect_ratios_label(value) { function localizeWholePage (line 92) | function localizeWholePage() { FILE: javascript/script.js function gradioApp (line 2) | function gradioApp() { function get_uiCurrentTab (line 17) | function get_uiCurrentTab() { function get_uiCurrentTabContent (line 24) | function get_uiCurrentTabContent() { function onUiUpdate (line 40) | function onUiUpdate(callback) { function onAfterUiUpdate (line 52) | function onAfterUiUpdate(callback) { function onUiLoaded (line 60) | function onUiLoaded(callback) { function onUiTabChange (line 68) | function onUiTabChange(callback) { function onOptionsChanged (line 77) | function onOptionsChanged(callback) { function executeCallbacks (line 81) | function executeCallbacks(queue, arg) { function scheduleAfterUiUpdateCallbacks (line 97) | function scheduleAfterUiUpdateCallbacks() { function addObserverIfDesiredNodeAvailable (line 136) | function addObserverIfDesiredNodeAvailable(querySelector, callback) { function initStylePreviewOverlay (line 186) | function initStylePreviewOverlay() { function uiElementIsVisible (line 229) | function uiElementIsVisible(el) { function uiElementInSight (line 241) | function uiElementInSight(el) { function playNotification (line 249) | function playNotification() { function set_theme (line 253) | function set_theme(theme) { function htmlDecode (line 260) | function htmlDecode(input) { FILE: javascript/viewer.js function refresh_grid (line 3) | function refresh_grid() { function refresh_grid_delayed (line 15) | function refresh_grid_delayed() { function resized (line 22) | function resized() { function viewer_to_top (line 37) | function viewer_to_top(delay = 100) { function viewer_to_bottom (line 41) | function viewer_to_bottom(delay = 100) { function on_style_selection_blur (line 60) | function on_style_selection_blur() { FILE: javascript/zoom.js function hasHorizontalScrollbar (line 5) | function hasHorizontalScrollbar(element) { function isModifierKey (line 10) | function isModifierKey(event, key) { function createHotkeyConfig (line 24) | function createHotkeyConfig(defaultHotkeysConfig) { function applyZoomAndPan (line 56) | function applyZoomAndPan(elemId) { FILE: launch.py function prepare_environment (line 29) | def prepare_environment(): function ini_args (line 70) | def ini_args(): function download_models (line 103) | def download_models(default_model, previous_default_models, checkpoint_d... FILE: ldm_patched/contrib/external.py function before_node_execution (line 39) | def before_node_execution(): function interrupt_processing (line 42) | def interrupt_processing(value=True): class CLIPTextEncode (line 47) | class CLIPTextEncode: method INPUT_TYPES (line 49) | def INPUT_TYPES(s): method encode (line 56) | def encode(self, clip, text): class ConditioningCombine (line 61) | class ConditioningCombine: method INPUT_TYPES (line 63) | def INPUT_TYPES(s): method combine (line 70) | def combine(self, conditioning_1, conditioning_2): class ConditioningAverage (line 73) | class ConditioningAverage : method INPUT_TYPES (line 75) | def INPUT_TYPES(s): method addWeighted (line 84) | def addWeighted(self, conditioning_to, conditioning_from, conditioning... class ConditioningConcat (line 111) | class ConditioningConcat: method INPUT_TYPES (line 113) | def INPUT_TYPES(s): method concat (line 123) | def concat(self, conditioning_to, conditioning_from): class ConditioningSetArea (line 139) | class ConditioningSetArea: method INPUT_TYPES (line 141) | def INPUT_TYPES(s): method append (line 154) | def append(self, conditioning, width, height, x, y, strength): class ConditioningSetAreaPercentage (line 164) | class ConditioningSetAreaPercentage: method INPUT_TYPES (line 166) | def INPUT_TYPES(s): method append (line 179) | def append(self, conditioning, width, height, x, y, strength): class ConditioningSetMask (line 189) | class ConditioningSetMask: method INPUT_TYPES (line 191) | def INPUT_TYPES(s): method append (line 202) | def append(self, conditioning, mask, set_cond_area, strength): class ConditioningZeroOut (line 218) | class ConditioningZeroOut: method INPUT_TYPES (line 220) | def INPUT_TYPES(s): method zero_out (line 227) | def zero_out(self, conditioning): class ConditioningSetTimestepRange (line 237) | class ConditioningSetTimestepRange: method INPUT_TYPES (line 239) | def INPUT_TYPES(s): method set_range (line 249) | def set_range(self, conditioning, start, end): class VAEDecode (line 259) | class VAEDecode: method INPUT_TYPES (line 261) | def INPUT_TYPES(s): method decode (line 268) | def decode(self, vae, samples): class VAEDecodeTiled (line 271) | class VAEDecodeTiled: method INPUT_TYPES (line 273) | def INPUT_TYPES(s): method decode (line 282) | def decode(self, vae, samples, tile_size): class VAEEncode (line 285) | class VAEEncode: method INPUT_TYPES (line 287) | def INPUT_TYPES(s): method vae_encode_crop_pixels (line 295) | def vae_encode_crop_pixels(pixels): method encode (line 304) | def encode(self, vae, pixels): class VAEEncodeTiled (line 309) | class VAEEncodeTiled: method INPUT_TYPES (line 311) | def INPUT_TYPES(s): method encode (line 320) | def encode(self, vae, pixels, tile_size): class VAEEncodeForInpaint (line 325) | class VAEEncodeForInpaint: method INPUT_TYPES (line 327) | def INPUT_TYPES(s): method encode (line 334) | def encode(self, vae, pixels, mask, grow_mask_by=6): class InpaintModelConditioning (line 365) | class InpaintModelConditioning: method INPUT_TYPES (line 367) | def INPUT_TYPES(s): method encode (line 381) | def encode(self, positive, negative, pixels, vae, mask): class SaveLatent (line 420) | class SaveLatent: method __init__ (line 421) | def __init__(self): method INPUT_TYPES (line 425) | def INPUT_TYPES(s): method save (line 437) | def save(self, samples, filename_prefix="ldm_patched", prompt=None, ex... class LoadLatent (line 471) | class LoadLatent: method INPUT_TYPES (line 473) | def INPUT_TYPES(s): method load (line 483) | def load(self, latent): method IS_CHANGED (line 493) | def IS_CHANGED(s, latent): method VALIDATE_INPUTS (line 501) | def VALIDATE_INPUTS(s, latent): class CheckpointLoader (line 507) | class CheckpointLoader: method INPUT_TYPES (line 509) | def INPUT_TYPES(s): method load_checkpoint (line 517) | def load_checkpoint(self, config_name, ckpt_name, output_vae=True, out... class CheckpointLoaderSimple (line 522) | class CheckpointLoaderSimple: method INPUT_TYPES (line 524) | def INPUT_TYPES(s): method load_checkpoint (line 532) | def load_checkpoint(self, ckpt_name, output_vae=True, output_clip=True): class DiffusersLoader (line 537) | class DiffusersLoader: method INPUT_TYPES (line 539) | def INPUT_TYPES(cls): method load_checkpoint (line 553) | def load_checkpoint(self, model_path, output_vae=True, output_clip=True): class unCLIPCheckpointLoader (line 564) | class unCLIPCheckpointLoader: method INPUT_TYPES (line 566) | def INPUT_TYPES(s): method load_checkpoint (line 574) | def load_checkpoint(self, ckpt_name, output_vae=True, output_clip=True): class CLIPSetLastLayer (line 579) | class CLIPSetLastLayer: method INPUT_TYPES (line 581) | def INPUT_TYPES(s): method set_last_layer (line 590) | def set_last_layer(self, clip, stop_at_clip_layer): class LoraLoader (line 595) | class LoraLoader: method __init__ (line 596) | def __init__(self): method INPUT_TYPES (line 600) | def INPUT_TYPES(s): method load_lora (line 612) | def load_lora(self, model, clip, lora_name, strength_model, strength_c... class LoraLoaderModelOnly (line 633) | class LoraLoaderModelOnly(LoraLoader): method INPUT_TYPES (line 635) | def INPUT_TYPES(s): method load_lora_model_only (line 643) | def load_lora_model_only(self, model, lora_name, strength_model): class VAELoader (line 646) | class VAELoader: method vae_list (line 648) | def vae_list(): method load_taesd (line 672) | def load_taesd(name): method INPUT_TYPES (line 694) | def INPUT_TYPES(s): method load_vae (line 702) | def load_vae(self, vae_name): class ControlNetLoader (line 711) | class ControlNetLoader: method INPUT_TYPES (line 713) | def INPUT_TYPES(s): method load_controlnet (line 721) | def load_controlnet(self, control_net_name): class DiffControlNetLoader (line 726) | class DiffControlNetLoader: method INPUT_TYPES (line 728) | def INPUT_TYPES(s): method load_controlnet (line 737) | def load_controlnet(self, model, control_net_name): class ControlNetApply (line 743) | class ControlNetApply: method INPUT_TYPES (line 745) | def INPUT_TYPES(s): method apply_controlnet (line 756) | def apply_controlnet(self, conditioning, control_net, image, strength): class ControlNetApplyAdvanced (line 773) | class ControlNetApplyAdvanced: method INPUT_TYPES (line 775) | def INPUT_TYPES(s): method apply_controlnet (line 791) | def apply_controlnet(self, positive, negative, control_net, image, str... class UNETLoader (line 820) | class UNETLoader: method INPUT_TYPES (line 822) | def INPUT_TYPES(s): method load_unet (line 830) | def load_unet(self, unet_name): class CLIPLoader (line 835) | class CLIPLoader: method INPUT_TYPES (line 837) | def INPUT_TYPES(s): method load_clip (line 845) | def load_clip(self, clip_name): class DualCLIPLoader (line 850) | class DualCLIPLoader: method INPUT_TYPES (line 852) | def INPUT_TYPES(s): method load_clip (line 860) | def load_clip(self, clip_name1, clip_name2): class CLIPVisionLoader (line 866) | class CLIPVisionLoader: method INPUT_TYPES (line 868) | def INPUT_TYPES(s): method load_clip (line 876) | def load_clip(self, clip_name): class CLIPVisionEncode (line 881) | class CLIPVisionEncode: method INPUT_TYPES (line 883) | def INPUT_TYPES(s): method encode (line 892) | def encode(self, clip_vision, image): class StyleModelLoader (line 896) | class StyleModelLoader: method INPUT_TYPES (line 898) | def INPUT_TYPES(s): method load_style_model (line 906) | def load_style_model(self, style_model_name): class StyleModelApply (line 912) | class StyleModelApply: method INPUT_TYPES (line 914) | def INPUT_TYPES(s): method apply_stylemodel (line 924) | def apply_stylemodel(self, clip_vision_output, style_model, conditioni... class unCLIPConditioning (line 932) | class unCLIPConditioning: method INPUT_TYPES (line 934) | def INPUT_TYPES(s): method apply_adm (line 945) | def apply_adm(self, conditioning, clip_vision_output, strength, noise_... class GLIGENLoader (line 961) | class GLIGENLoader: method INPUT_TYPES (line 963) | def INPUT_TYPES(s): method load_gligen (line 971) | def load_gligen(self, gligen_name): class GLIGENTextBoxApply (line 976) | class GLIGENTextBoxApply: method INPUT_TYPES (line 978) | def INPUT_TYPES(s): method append (line 993) | def append(self, conditioning_to, clip, gligen_textbox_model, text, wi... class EmptyLatentImage (line 1007) | class EmptyLatentImage: method __init__ (line 1008) | def __init__(self): method INPUT_TYPES (line 1012) | def INPUT_TYPES(s): method generate (line 1021) | def generate(self, width, height, batch_size=1): class LatentFromBatch (line 1026) | class LatentFromBatch: method INPUT_TYPES (line 1028) | def INPUT_TYPES(s): method frombatch (line 1038) | def frombatch(self, samples, batch_index, length): class RepeatLatentBatch (line 1058) | class RepeatLatentBatch: method INPUT_TYPES (line 1060) | def INPUT_TYPES(s): method repeat (line 1069) | def repeat(self, samples, amount): class LatentUpscale (line 1084) | class LatentUpscale: method INPUT_TYPES (line 1089) | def INPUT_TYPES(s): method upscale (line 1099) | def upscale(self, samples, upscale_method, width, height, crop): class LatentUpscaleBy (line 1118) | class LatentUpscaleBy: method INPUT_TYPES (line 1122) | def INPUT_TYPES(s): method upscale (line 1130) | def upscale(self, samples, upscale_method, scale_by): class LatentRotate (line 1137) | class LatentRotate: method INPUT_TYPES (line 1139) | def INPUT_TYPES(s): method rotate (line 1148) | def rotate(self, samples, rotation): class LatentFlip (line 1161) | class LatentFlip: method INPUT_TYPES (line 1163) | def INPUT_TYPES(s): method flip (line 1172) | def flip(self, samples, flip_method): class LatentComposite (line 1181) | class LatentComposite: method INPUT_TYPES (line 1183) | def INPUT_TYPES(s): method composite (line 1195) | def composite(self, samples_to, samples_from, x, y, composite_method="... class LatentBlend (line 1223) | class LatentBlend: method INPUT_TYPES (line 1225) | def INPUT_TYPES(s): method blend (line 1242) | def blend(self, samples1, samples2, blend_factor:float, blend_mode: st... method blend_mode (line 1258) | def blend_mode(self, img1, img2, mode): class LatentCrop (line 1264) | class LatentCrop: method INPUT_TYPES (line 1266) | def INPUT_TYPES(s): method crop (line 1278) | def crop(self, samples, width, height, x, y): class SetLatentNoiseMask (line 1297) | class SetLatentNoiseMask: method INPUT_TYPES (line 1299) | def INPUT_TYPES(s): method set_mask (line 1308) | def set_mask(self, samples, mask): function common_ksampler (line 1313) | def common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, po... class KSampler (line 1334) | class KSampler: method INPUT_TYPES (line 1336) | def INPUT_TYPES(s): method sample (line 1356) | def sample(self, model, seed, steps, cfg, sampler_name, scheduler, pos... class KSamplerAdvanced (line 1359) | class KSamplerAdvanced: method INPUT_TYPES (line 1361) | def INPUT_TYPES(s): method sample (line 1384) | def sample(self, model, add_noise, noise_seed, steps, cfg, sampler_nam... class SaveImage (line 1393) | class SaveImage: method __init__ (line 1394) | def __init__(self): method INPUT_TYPES (line 1401) | def INPUT_TYPES(s): method save_images (line 1415) | def save_images(self, images, filename_prefix="ldm_patched", prompt=No... class PreviewImage (line 1442) | class PreviewImage(SaveImage): method __init__ (line 1443) | def __init__(self): method INPUT_TYPES (line 1450) | def INPUT_TYPES(s): class LoadImage (line 1456) | class LoadImage: method INPUT_TYPES (line 1458) | def INPUT_TYPES(s): method load_image (line 1469) | def load_image(self, image): method IS_CHANGED (line 1499) | def IS_CHANGED(s, image): method VALIDATE_INPUTS (line 1507) | def VALIDATE_INPUTS(s, image): class LoadImageMask (line 1513) | class LoadImageMask: method INPUT_TYPES (line 1516) | def INPUT_TYPES(s): method load_image (line 1528) | def load_image(self, image, channel): method IS_CHANGED (line 1548) | def IS_CHANGED(s, image, channel): method VALIDATE_INPUTS (line 1556) | def VALIDATE_INPUTS(s, image): class ImageScale (line 1562) | class ImageScale: method INPUT_TYPES (line 1567) | def INPUT_TYPES(s): method upscale (line 1577) | def upscale(self, image, upscale_method, width, height, crop): class ImageScaleBy (line 1592) | class ImageScaleBy: method INPUT_TYPES (line 1596) | def INPUT_TYPES(s): method upscale (line 1604) | def upscale(self, image, upscale_method, scale_by): class ImageInvert (line 1612) | class ImageInvert: method INPUT_TYPES (line 1615) | def INPUT_TYPES(s): method invert (line 1623) | def invert(self, image): class ImageBatch (line 1627) | class ImageBatch: method INPUT_TYPES (line 1630) | def INPUT_TYPES(s): method batch (line 1638) | def batch(self, image1, image2): class EmptyImage (line 1644) | class EmptyImage: method __init__ (line 1645) | def __init__(self, device="cpu"): method INPUT_TYPES (line 1649) | def INPUT_TYPES(s): method generate (line 1660) | def generate(self, width, height, batch_size=1, color=0): class ImagePadForOutpaint (line 1666) | class ImagePadForOutpaint: method INPUT_TYPES (line 1669) | def INPUT_TYPES(s): method expand_image (line 1686) | def expand_image(self, image, left, top, right, bottom, feathering): function load_custom_node (line 1859) | def load_custom_node(module_path, ignore=set()): function load_custom_nodes (line 1896) | def load_custom_nodes(): function init_custom_nodes (line 1923) | def init_custom_nodes(): FILE: ldm_patched/contrib/external_align_your_steps.py function loglinear_interp (line 7) | def loglinear_interp(t_steps, num_steps): class AlignYourStepsScheduler (line 24) | class AlignYourStepsScheduler: method INPUT_TYPES (line 26) | def INPUT_TYPES(s): method get_sigmas (line 38) | def get_sigmas(self, model_type, steps, denoise): FILE: ldm_patched/contrib/external_canny.py function get_canny_nms_kernel (line 10) | def get_canny_nms_kernel(device=None, dtype=None): function get_hysteresis_kernel (line 28) | def get_hysteresis_kernel(device=None, dtype=None): function gaussian_blur_2d (line 45) | def gaussian_blur_2d(img, kernel_size, sigma): function get_sobel_kernel2d (line 65) | def get_sobel_kernel2d(device=None, dtype=None): function spatial_gradient (line 70) | def spatial_gradient(input, normalized: bool = True): function rgb_to_grayscale (line 108) | def rgb_to_grayscale(image, rgb_weights = None): function canny (line 155) | def canny( class Canny (line 281) | class Canny: method INPUT_TYPES (line 283) | def INPUT_TYPES(s): method detect_edge (line 294) | def detect_edge(self, image, low_threshold, high_threshold): FILE: ldm_patched/contrib/external_clip_sdxl.py class CLIPTextEncodeSDXLRefiner (line 6) | class CLIPTextEncodeSDXLRefiner: method INPUT_TYPES (line 8) | def INPUT_TYPES(s): method encode (line 20) | def encode(self, clip, ascore, width, height, text): class CLIPTextEncodeSDXL (line 25) | class CLIPTextEncodeSDXL: method INPUT_TYPES (line 27) | def INPUT_TYPES(s): method encode (line 43) | def encode(self, clip, width, height, crop_w, crop_h, target_width, ta... FILE: ldm_patched/contrib/external_compositing.py function resize_mask (line 8) | def resize_mask(mask, shape): class PorterDuffMode (line 11) | class PorterDuffMode(Enum): function porter_duff_composite (line 32) | def porter_duff_composite(src_image: torch.Tensor, src_alpha: torch.Tens... class PorterDuffImageComposite (line 94) | class PorterDuffImageComposite: method INPUT_TYPES (line 96) | def INPUT_TYPES(s): method composite (line 111) | def composite(self, source: torch.Tensor, source_alpha: torch.Tensor, ... class SplitImageWithAlpha (line 147) | class SplitImageWithAlpha: method INPUT_TYPES (line 149) | def INPUT_TYPES(s): method split_image_with_alpha (line 160) | def split_image_with_alpha(self, image: torch.Tensor): class JoinImageWithAlpha (line 167) | class JoinImageWithAlpha: method INPUT_TYPES (line 169) | def INPUT_TYPES(s): method join_image_with_alpha (line 181) | def join_image_with_alpha(self, image: torch.Tensor, alpha: torch.Tens... FILE: ldm_patched/contrib/external_custom_sampler.py class BasicScheduler (line 11) | class BasicScheduler: method INPUT_TYPES (line 13) | def INPUT_TYPES(s): method get_sigmas (line 26) | def get_sigmas(self, model, scheduler, steps, denoise): class KarrasScheduler (line 37) | class KarrasScheduler: method INPUT_TYPES (line 39) | def INPUT_TYPES(s): method get_sigmas (line 52) | def get_sigmas(self, steps, sigma_max, sigma_min, rho): class ExponentialScheduler (line 56) | class ExponentialScheduler: method INPUT_TYPES (line 58) | def INPUT_TYPES(s): method get_sigmas (line 70) | def get_sigmas(self, steps, sigma_max, sigma_min): class PolyexponentialScheduler (line 74) | class PolyexponentialScheduler: method INPUT_TYPES (line 76) | def INPUT_TYPES(s): method get_sigmas (line 89) | def get_sigmas(self, steps, sigma_max, sigma_min, rho): class SDTurboScheduler (line 93) | class SDTurboScheduler: method INPUT_TYPES (line 95) | def INPUT_TYPES(s): method get_sigmas (line 107) | def get_sigmas(self, model, steps, denoise): class VPScheduler (line 114) | class VPScheduler: method INPUT_TYPES (line 116) | def INPUT_TYPES(s): method get_sigmas (line 129) | def get_sigmas(self, steps, beta_d, beta_min, eps_s): class SplitSigmas (line 133) | class SplitSigmas: method INPUT_TYPES (line 135) | def INPUT_TYPES(s): method get_sigmas (line 146) | def get_sigmas(self, sigmas, step): class FlipSigmas (line 151) | class FlipSigmas: method INPUT_TYPES (line 153) | def INPUT_TYPES(s): method get_sigmas (line 163) | def get_sigmas(self, sigmas): class KSamplerSelect (line 169) | class KSamplerSelect: method INPUT_TYPES (line 171) | def INPUT_TYPES(s): method get_sampler (line 181) | def get_sampler(self, sampler_name): class SamplerDPMPP_2M_SDE (line 185) | class SamplerDPMPP_2M_SDE: method INPUT_TYPES (line 187) | def INPUT_TYPES(s): method get_sampler (line 200) | def get_sampler(self, solver_type, eta, s_noise, noise_device): class SamplerDPMPP_SDE (line 209) | class SamplerDPMPP_SDE: method INPUT_TYPES (line 211) | def INPUT_TYPES(s): method get_sampler (line 224) | def get_sampler(self, eta, s_noise, r, noise_device): class SamplerTCD (line 233) | class SamplerTCD: method INPUT_TYPES (line 235) | def INPUT_TYPES(s): method get_sampler (line 246) | def get_sampler(self, eta=0.3): class SamplerCustom (line 251) | class SamplerCustom: method INPUT_TYPES (line 253) | def INPUT_TYPES(s): method sample (line 274) | def sample(self, model, add_noise, noise_seed, cfg, positive, negative... FILE: ldm_patched/contrib/external_freelunch.py function Fourier_filter (line 8) | def Fourier_filter(x, threshold, scale): class FreeU (line 27) | class FreeU: method INPUT_TYPES (line 29) | def INPUT_TYPES(s): method patch (line 41) | def patch(self, model, b1, b2, s1, s2): class FreeU_V2 (line 66) | class FreeU_V2: method INPUT_TYPES (line 68) | def INPUT_TYPES(s): method patch (line 80) | def patch(self, model, b1, b2, s1, s2): FILE: ldm_patched/contrib/external_hypernetwork.py function load_hypernetwork_patch (line 7) | def load_hypernetwork_patch(path, strength): class HypernetworkLoader (line 98) | class HypernetworkLoader: method INPUT_TYPES (line 100) | def INPUT_TYPES(s): method load_hypernetwork (line 110) | def load_hypernetwork(self, model, hypernetwork_name, strength): FILE: ldm_patched/contrib/external_hypertile.py function random_divisor (line 10) | def random_divisor(value: int, min_value: int, /, max_options: int = 1) ... class HyperTile (line 25) | class HyperTile: method INPUT_TYPES (line 27) | def INPUT_TYPES(s): method patch (line 39) | def patch(self, model, tile_size, swap_size, max_depth, scale_depth): FILE: ldm_patched/contrib/external_images.py class ImageCrop (line 16) | class ImageCrop: method INPUT_TYPES (line 18) | def INPUT_TYPES(s): method crop (line 30) | def crop(self, image, width, height, x, y): class RepeatImageBatch (line 38) | class RepeatImageBatch: method INPUT_TYPES (line 40) | def INPUT_TYPES(s): method repeat (line 49) | def repeat(self, image, amount): class SaveAnimatedWEBP (line 53) | class SaveAnimatedWEBP: method __init__ (line 54) | def __init__(self): method INPUT_TYPES (line 61) | def INPUT_TYPES(s): method save_images (line 81) | def save_images(self, images, fps, filename_prefix, lossless, quality,... class SaveAnimatedPNG (line 119) | class SaveAnimatedPNG: method __init__ (line 120) | def __init__(self): method INPUT_TYPES (line 126) | def INPUT_TYPES(s): method save_images (line 143) | def save_images(self, images, fps, compress_level, filename_prefix="ld... FILE: ldm_patched/contrib/external_latent.py function reshape_latent_to (line 6) | def reshape_latent_to(target_shape, latent): class LatentAdd (line 12) | class LatentAdd: method INPUT_TYPES (line 14) | def INPUT_TYPES(s): method op (line 22) | def op(self, samples1, samples2): class LatentSubtract (line 32) | class LatentSubtract: method INPUT_TYPES (line 34) | def INPUT_TYPES(s): method op (line 42) | def op(self, samples1, samples2): class LatentMultiply (line 52) | class LatentMultiply: method INPUT_TYPES (line 54) | def INPUT_TYPES(s): method op (line 64) | def op(self, samples, multiplier): class LatentInterpolate (line 71) | class LatentInterpolate: method INPUT_TYPES (line 73) | def INPUT_TYPES(s): method op (line 84) | def op(self, samples1, samples2, ratio): class LatentBatch (line 105) | class LatentBatch: method INPUT_TYPES (line 107) | def INPUT_TYPES(s): method batch (line 115) | def batch(self, samples1, samples2): class LatentBatchSeedBehavior (line 127) | class LatentBatchSeedBehavior: method INPUT_TYPES (line 129) | def INPUT_TYPES(s): method op (line 138) | def op(self, samples, seed_behavior): FILE: ldm_patched/contrib/external_mask.py function composite (line 10) | def composite(destination, source, x, y, mask = None, multiplier = 8, re... class LatentCompositeMasked (line 44) | class LatentCompositeMasked: method INPUT_TYPES (line 46) | def INPUT_TYPES(s): method composite (line 64) | def composite(self, destination, source, x, y, resize_source, mask = N... class ImageCompositeMasked (line 71) | class ImageCompositeMasked: method INPUT_TYPES (line 73) | def INPUT_TYPES(s): method composite (line 91) | def composite(self, destination, source, x, y, resize_source, mask = N... class MaskToImage (line 96) | class MaskToImage: method INPUT_TYPES (line 98) | def INPUT_TYPES(s): method mask_to_image (line 110) | def mask_to_image(self, mask): class ImageToMask (line 114) | class ImageToMask: method INPUT_TYPES (line 116) | def INPUT_TYPES(s): method image_to_mask (line 129) | def image_to_mask(self, image, channel): class ImageColorToMask (line 134) | class ImageColorToMask: method INPUT_TYPES (line 136) | def INPUT_TYPES(s): method image_to_mask (line 149) | def image_to_mask(self, image, color): class SolidMask (line 155) | class SolidMask: method INPUT_TYPES (line 157) | def INPUT_TYPES(cls): method solid (line 172) | def solid(self, value, width, height): class InvertMask (line 176) | class InvertMask: method INPUT_TYPES (line 178) | def INPUT_TYPES(cls): method invert (line 191) | def invert(self, mask): class CropMask (line 195) | class CropMask: method INPUT_TYPES (line 197) | def INPUT_TYPES(cls): method crop (line 214) | def crop(self, mask, x, y, width, height): class MaskComposite (line 219) | class MaskComposite: method INPUT_TYPES (line 221) | def INPUT_TYPES(cls): method combine (line 238) | def combine(self, destination, source, x, y, operation): class FeatherMask (line 266) | class FeatherMask: method INPUT_TYPES (line 268) | def INPUT_TYPES(cls): method feather (line 285) | def feather(self, mask, left, top, right, bottom): class GrowMask (line 311) | class GrowMask: method INPUT_TYPES (line 313) | def INPUT_TYPES(cls): method expand_mask (line 328) | def expand_mask(self, mask, expand, tapered_corners): FILE: ldm_patched/contrib/external_model_advanced.py class LCM (line 8) | class LCM(ldm_patched.modules.model_sampling.EPS): method calculate_denoised (line 9) | def calculate_denoised(self, sigma, model_output, model_input): class ModelSamplingDiscreteDistilled (line 22) | class ModelSamplingDiscreteDistilled(ldm_patched.modules.model_sampling.... method __init__ (line 25) | def __init__(self, model_config=None): method timestep (line 36) | def timestep(self, sigma): method sigma (line 41) | def sigma(self, timestep): function rescale_zero_terminal_snr_sigmas (line 50) | def rescale_zero_terminal_snr_sigmas(sigmas): class ModelSamplingDiscrete (line 69) | class ModelSamplingDiscrete: method INPUT_TYPES (line 71) | def INPUT_TYPES(s): method patch (line 82) | def patch(self, model, sampling, zsnr): class ModelSamplingContinuousEDM (line 107) | class ModelSamplingContinuousEDM: method INPUT_TYPES (line 109) | def INPUT_TYPES(s): method patch (line 121) | def patch(self, model, sampling, sigma_max, sigma_min): class RescaleCFG (line 145) | class RescaleCFG: method INPUT_TYPES (line 147) | def INPUT_TYPES(s): method patch (line 156) | def patch(self, model, multiplier): FILE: ldm_patched/contrib/external_model_downscale.py class PatchModelAddDownscale (line 6) | class PatchModelAddDownscale: method INPUT_TYPES (line 9) | def INPUT_TYPES(s): method patch (line 24) | def patch(self, model, block_number, downscale_factor, start_percent, ... FILE: ldm_patched/contrib/external_model_merging.py class ModelMergeSimple (line 14) | class ModelMergeSimple: method INPUT_TYPES (line 16) | def INPUT_TYPES(s): method merge (line 26) | def merge(self, model1, model2, ratio): class ModelSubtract (line 33) | class ModelSubtract: method INPUT_TYPES (line 35) | def INPUT_TYPES(s): method merge (line 45) | def merge(self, model1, model2, multiplier): class ModelAdd (line 52) | class ModelAdd: method INPUT_TYPES (line 54) | def INPUT_TYPES(s): method merge (line 63) | def merge(self, model1, model2): class CLIPMergeSimple (line 71) | class CLIPMergeSimple: method INPUT_TYPES (line 73) | def INPUT_TYPES(s): method merge (line 83) | def merge(self, clip1, clip2, ratio): class ModelMergeBlocks (line 92) | class ModelMergeBlocks: method INPUT_TYPES (line 94) | def INPUT_TYPES(s): method merge (line 106) | def merge(self, model1, model2, **kwargs): function save_checkpoint (line 124) | def save_checkpoint(model, clip=None, vae=None, clip_vision=None, filena... class CheckpointSave (line 166) | class CheckpointSave: method __init__ (line 167) | def __init__(self): method INPUT_TYPES (line 171) | def INPUT_TYPES(s): method save (line 183) | def save(self, model, clip, vae, filename_prefix, prompt=None, extra_p... class CLIPSave (line 187) | class CLIPSave: method __init__ (line 188) | def __init__(self): method INPUT_TYPES (line 192) | def INPUT_TYPES(s): method save (line 202) | def save(self, clip, filename_prefix, prompt=None, extra_pnginfo=None): class VAESave (line 243) | class VAESave: method __init__ (line 244) | def __init__(self): method INPUT_TYPES (line 248) | def INPUT_TYPES(s): method save (line 258) | def save(self, vae, filename_prefix, prompt=None, extra_pnginfo=None): FILE: ldm_patched/contrib/external_perpneg.py class PerpNeg (line 10) | class PerpNeg: method INPUT_TYPES (line 12) | def INPUT_TYPES(s): method patch (line 22) | def patch(self, model, empty_conditioning, neg_scale): FILE: ldm_patched/contrib/external_photomaker.py class MLP (line 23) | class MLP(nn.Module): method __init__ (line 24) | def __init__(self, in_dim, out_dim, hidden_dim, use_residual=True, ope... method forward (line 34) | def forward(self, x): class FuseModule (line 45) | class FuseModule(nn.Module): method __init__ (line 46) | def __init__(self, embed_dim, operations): method fuse_fn (line 52) | def fuse_fn(self, prompt_embeds, id_embeds): method forward (line 59) | def forward( class PhotoMakerIDEncoder (line 93) | class PhotoMakerIDEncoder(ldm_patched.modules.clip_model.CLIPVisionModel... method __init__ (line 94) | def __init__(self): method forward (line 103) | def forward(self, id_pixel_values, prompt_embeds, class_tokens_mask): class PhotoMakerLoader (line 120) | class PhotoMakerLoader: method INPUT_TYPES (line 122) | def INPUT_TYPES(s): method load_photomaker_model (line 130) | def load_photomaker_model(self, photomaker_model_name): class PhotoMakerEncode (line 140) | class PhotoMakerEncode: method INPUT_TYPES (line 142) | def INPUT_TYPES(s): method apply_photomaker (line 154) | def apply_photomaker(self, photomaker, image, clip, text): FILE: ldm_patched/contrib/external_post_processing.py class Blend (line 12) | class Blend: method __init__ (line 13) | def __init__(self): method INPUT_TYPES (line 17) | def INPUT_TYPES(s): method blend_images (line 37) | def blend_images(self, image1: torch.Tensor, image2: torch.Tensor, ble... method blend_mode (line 49) | def blend_mode(self, img1, img2, mode): method g (line 65) | def g(self, x): function gaussian_kernel (line 68) | def gaussian_kernel(kernel_size: int, sigma: float, device=None): class Blur (line 74) | class Blur: method __init__ (line 75) | def __init__(self): method INPUT_TYPES (line 79) | def INPUT_TYPES(s): method blur (line 103) | def blur(self, image: torch.Tensor, blur_radius: int, sigma: float): class Quantize (line 119) | class Quantize: method __init__ (line 120) | def __init__(self): method INPUT_TYPES (line 124) | def INPUT_TYPES(s): method bayer (line 143) | def bayer(im, pal_im, order): method quantize (line 168) | def quantize(self, image: torch.Tensor, colors: int, dither: str): class Sharpen (line 190) | class Sharpen: method __init__ (line 191) | def __init__(self): method INPUT_TYPES (line 195) | def INPUT_TYPES(s): method sharpen (line 225) | def sharpen(self, image: torch.Tensor, sharpen_radius: int, sigma:floa... class ImageScaleToTotalPixels (line 246) | class ImageScaleToTotalPixels: method INPUT_TYPES (line 251) | def INPUT_TYPES(s): method upscale (line 260) | def upscale(self, image, upscale_method, megapixels): FILE: ldm_patched/contrib/external_rebatch.py class LatentRebatch (line 5) | class LatentRebatch: method INPUT_TYPES (line 7) | def INPUT_TYPES(s): method get_batch (line 20) | def get_batch(latents, list_ind, offset): method get_slices (line 36) | def get_slices(indexable, num, batch_size): method slice_batch (line 47) | def slice_batch(batch, num, batch_size): method cat_batch (line 52) | def cat_batch(batch1, batch2): method rebatch (line 58) | def rebatch(self, latents, batch_size): class ImageRebatch (line 104) | class ImageRebatch: method INPUT_TYPES (line 106) | def INPUT_TYPES(s): method rebatch (line 118) | def rebatch(self, images, batch_size): FILE: ldm_patched/contrib/external_sag.py function attention_basic_with_sim (line 15) | def attention_basic_with_sim(q, k, v, heads, mask=None): function create_blur_map (line 56) | def create_blur_map(x0, attn, sigma=3.0, threshold=1.0): function gaussian_blur_2d (line 79) | def gaussian_blur_2d(img, kernel_size, sigma): class SelfAttentionGuidance (line 98) | class SelfAttentionGuidance: method INPUT_TYPES (line 100) | def INPUT_TYPES(s): method patch (line 110) | def patch(self, model, scale, blur_sigma): FILE: ldm_patched/contrib/external_sdupscale.py class SD_4XUpscale_Conditioning (line 7) | class SD_4XUpscale_Conditioning: method INPUT_TYPES (line 9) | def INPUT_TYPES(s): method encode (line 23) | def encode(self, images, positive, negative, scale_ratio, noise_augmen... FILE: ldm_patched/contrib/external_stable3d.py function camera_embeddings (line 7) | def camera_embeddings(elevation, azimuth): class StableZero123_Conditioning (line 25) | class StableZero123_Conditioning: method INPUT_TYPES (line 27) | def INPUT_TYPES(s): method encode (line 44) | def encode(self, clip_vision, init_image, vae, width, height, batch_si... class StableZero123_Conditioning_Batched (line 58) | class StableZero123_Conditioning_Batched: method INPUT_TYPES (line 60) | def INPUT_TYPES(s): method encode (line 79) | def encode(self, clip_vision, init_image, vae, width, height, batch_si... FILE: ldm_patched/contrib/external_tomesd.py function do_nothing (line 9) | def do_nothing(x: torch.Tensor, mode:str=None): function mps_gather_workaround (line 13) | def mps_gather_workaround(input, dim, index): function bipartite_soft_matching_random2d (line 24) | def bipartite_soft_matching_random2d(metric: torch.Tensor, function get_functions (line 129) | def get_functions(x, ratio, original_shape): class TomePatchModel (line 150) | class TomePatchModel: method INPUT_TYPES (line 152) | def INPUT_TYPES(s): method patch (line 161) | def patch(self, model, ratio): FILE: ldm_patched/contrib/external_upscale_model.py class UpscaleModelLoader (line 10) | class UpscaleModelLoader: method INPUT_TYPES (line 12) | def INPUT_TYPES(s): method load_model (line 20) | def load_model(self, model_name): class ImageUpscaleWithModel (line 29) | class ImageUpscaleWithModel: method INPUT_TYPES (line 31) | def INPUT_TYPES(s): method upscale (line 40) | def upscale(self, upscale_model, image): FILE: ldm_patched/contrib/external_video_model.py class ImageOnlyCheckpointLoader (line 11) | class ImageOnlyCheckpointLoader: method INPUT_TYPES (line 13) | def INPUT_TYPES(s): method load_checkpoint (line 21) | def load_checkpoint(self, ckpt_name, output_vae=True, output_clip=True): class SVD_img2vid_Conditioning (line 27) | class SVD_img2vid_Conditioning: method INPUT_TYPES (line 29) | def INPUT_TYPES(s): method encode (line 47) | def encode(self, clip_vision, init_image, vae, width, height, video_fr... class VideoLinearCFGGuidance (line 60) | class VideoLinearCFGGuidance: method INPUT_TYPES (line 62) | def INPUT_TYPES(s): method patch (line 71) | def patch(self, model, min_cfg): class ImageOnlyCheckpointSave (line 84) | class ImageOnlyCheckpointSave(ldm_patched.contrib.external_model_merging... method INPUT_TYPES (line 88) | def INPUT_TYPES(s): method save (line 95) | def save(self, model, clip_vision, vae, filename_prefix, prompt=None, ... FILE: ldm_patched/controlnet/cldm.py class ControlledUnetModel (line 18) | class ControlledUnetModel(UNetModel): class ControlNet (line 22) | class ControlNet(nn.Module): method __init__ (line 23) | def __init__( method make_zero_conv (line 282) | def make_zero_conv(self, channels, operations=None, dtype=None, device... method forward (line 285) | def forward(self, x, hint, timesteps, context, y=None, **kwargs): FILE: ldm_patched/k_diffusion/sampling.py function append_zero (line 12) | def append_zero(x): function get_sigmas_karras (line 16) | def get_sigmas_karras(n, sigma_min, sigma_max, rho=7., device='cpu'): function get_sigmas_exponential (line 25) | def get_sigmas_exponential(n, sigma_min, sigma_max, device='cpu'): function get_sigmas_polyexponential (line 31) | def get_sigmas_polyexponential(n, sigma_min, sigma_max, rho=1., device='... function get_sigmas_vp (line 38) | def get_sigmas_vp(n, beta_d=19.9, beta_min=0.1, eps_s=1e-3, device='cpu'): function to_d (line 45) | def to_d(x, sigma, denoised): function get_ancestral_step (line 50) | def get_ancestral_step(sigma_from, sigma_to, eta=1.): function default_noise_sampler (line 60) | def default_noise_sampler(x): class BatchedBrownianTree (line 64) | class BatchedBrownianTree: method __init__ (line 67) | def __init__(self, x, t0, t1, seed=None, **kwargs): method sort (line 88) | def sort(a, b): method __call__ (line 91) | def __call__(self, t0, t1): class BrownianTreeNoiseSampler (line 101) | class BrownianTreeNoiseSampler: method __init__ (line 116) | def __init__(self, x, sigma_min, sigma_max, seed=None, transform=lambd... method __call__ (line 121) | def __call__(self, sigma, sigma_next): function sample_euler (line 127) | def sample_euler(model, x, sigmas, extra_args=None, callback=None, disab... function sample_euler_ancestral (line 148) | def sample_euler_ancestral(model, x, sigmas, extra_args=None, callback=N... function sample_heun (line 168) | def sample_heun(model, x, sigmas, extra_args=None, callback=None, disabl... function sample_dpm_2 (line 197) | def sample_dpm_2(model, x, sigmas, extra_args=None, callback=None, disab... function sample_dpm_2_ancestral (line 228) | def sample_dpm_2_ancestral(model, x, sigmas, extra_args=None, callback=N... function linear_multistep_coeff (line 256) | def linear_multistep_coeff(order, t, i, j): function sample_lms (line 270) | def sample_lms(model, x, sigmas, extra_args=None, callback=None, disable... class PIDStepSizeController (line 289) | class PIDStepSizeController: method __init__ (line 291) | def __init__(self, h, pcoeff, icoeff, dcoeff, order=1, accept_safety=0... method limiter (line 300) | def limiter(self, x): method propose_step (line 303) | def propose_step(self, error): class DPMSolver (line 318) | class DPMSolver(nn.Module): method __init__ (line 321) | def __init__(self, model, extra_args=None, eps_callback=None, info_cal... method t (line 328) | def t(self, sigma): method sigma (line 331) | def sigma(self, t): method eps (line 334) | def eps(self, eps_cache, key, x, t, *args, **kwargs): method dpm_solver_1_step (line 343) | def dpm_solver_1_step(self, x, t, t_next, eps_cache=None): method dpm_solver_2_step (line 350) | def dpm_solver_2_step(self, x, t, t_next, r1=1 / 2, eps_cache=None): method dpm_solver_3_step (line 360) | def dpm_solver_3_step(self, x, t, t_next, r1=1 / 3, r2=2 / 3, eps_cach... method dpm_solver_fast (line 373) | def dpm_solver_fast(self, x, t_start, t_end, nfe, eta=0., s_noise=1., ... method dpm_solver_adaptive (line 412) | def dpm_solver_adaptive(self, x, t_start, t_end, order=3, rtol=0.05, a... function sample_dpm_fast (line 467) | def sample_dpm_fast(model, x, sigma_min, sigma_max, n, extra_args=None, ... function sample_dpm_adaptive (line 479) | def sample_dpm_adaptive(model, x, sigma_min, sigma_max, extra_args=None,... function sample_dpmpp_2s_ancestral (line 494) | def sample_dpmpp_2s_ancestral(model, x, sigmas, extra_args=None, callbac... function sample_dpmpp_sde (line 528) | def sample_dpmpp_sde(model, x, sigmas, extra_args=None, callback=None, d... function sample_dpmpp_2m (line 571) | def sample_dpmpp_2m(model, x, sigmas, extra_args=None, callback=None, di... function sample_dpmpp_2m_sde (line 596) | def sample_dpmpp_2m_sde(model, x, sigmas, extra_args=None, callback=None... function sample_dpmpp_3m_sde (line 642) | def sample_dpmpp_3m_sde(model, x, sigmas, extra_args=None, callback=None... function sample_dpmpp_3m_sde_gpu (line 692) | def sample_dpmpp_3m_sde_gpu(model, x, sigmas, extra_args=None, callback=... function sample_dpmpp_2m_sde_gpu (line 698) | def sample_dpmpp_2m_sde_gpu(model, x, sigmas, extra_args=None, callback=... function sample_dpmpp_sde_gpu (line 704) | def sample_dpmpp_sde_gpu(model, x, sigmas, extra_args=None, callback=Non... function DDPMSampler_step (line 710) | def DDPMSampler_step(x, sigma, sigma_prev, noise, noise_sampler): function generic_step_sampler (line 720) | def generic_step_sampler(model, x, sigmas, extra_args=None, callback=Non... function sample_ddpm (line 736) | def sample_ddpm(model, x, sigmas, extra_args=None, callback=None, disabl... function sample_lcm (line 740) | def sample_lcm(model, x, sigmas, extra_args=None, callback=None, disable... function sample_heunpp2 (line 756) | def sample_heunpp2(model, x, sigmas, extra_args=None, callback=None, dis... function sample_tcd (line 813) | def sample_tcd(model, x, sigmas, extra_args=None, callback=None, disable... function sample_restart (line 842) | def sample_restart(model, x, sigmas, extra_args=None, callback=None, dis... FILE: ldm_patched/k_diffusion/utils.py function hf_datasets_augs_helper (line 15) | def hf_datasets_augs_helper(examples, transform, image_key, mode='RGB'): function append_dims (line 21) | def append_dims(x, target_dims): function n_params (line 32) | def n_params(module): function download_file (line 37) | def download_file(path, url, digest=None): function train_mode (line 52) | def train_mode(model, mode=True): function eval_mode (line 63) | def eval_mode(model): function ema_update (line 70) | def ema_update(model, averaged_model, decay): class EMAWarmup (line 88) | class EMAWarmup: method __init__ (line 104) | def __init__(self, inv_gamma=1., power=1., min_value=0., max_value=1.,... method state_dict (line 113) | def state_dict(self): method load_state_dict (line 117) | def load_state_dict(self, state_dict): method get_value (line 125) | def get_value(self): method step (line 131) | def step(self): class InverseLR (line 136) | class InverseLR(optim.lr_scheduler._LRScheduler): method __init__ (line 153) | def __init__(self, optimizer, inv_gamma=1., power=1., warmup=0., min_l... method get_lr (line 163) | def get_lr(self): method _get_closed_form_lr (line 170) | def _get_closed_form_lr(self): class ExponentialLR (line 177) | class ExponentialLR(optim.lr_scheduler._LRScheduler): method __init__ (line 194) | def __init__(self, optimizer, num_steps, decay=0.5, warmup=0., min_lr=0., method get_lr (line 204) | def get_lr(self): method _get_closed_form_lr (line 211) | def _get_closed_form_lr(self): function rand_log_normal (line 218) | def rand_log_normal(shape, loc=0., scale=1., device='cpu', dtype=torch.f... function rand_log_logistic (line 223) | def rand_log_logistic(shape, loc=0., scale=1., min_value=0., max_value=f... function rand_log_uniform (line 233) | def rand_log_uniform(shape, min_value, max_value, device='cpu', dtype=to... function rand_v_diffusion (line 240) | def rand_v_diffusion(shape, sigma_data=1., min_value=0., max_value=float... function rand_split_log_normal (line 248) | def rand_split_log_normal(shape, loc, scale_1, scale_2, device='cpu', dt... class FolderOfImages (line 258) | class FolderOfImages(data.Dataset): method __init__ (line 264) | def __init__(self, root, transform=None): method __repr__ (line 270) | def __repr__(self): method __len__ (line 273) | def __len__(self): method __getitem__ (line 276) | def __getitem__(self, key): class CSVLogger (line 284) | class CSVLogger: method __init__ (line 285) | def __init__(self, filename, columns): method write (line 294) | def write(self, *args): function tf32_mode (line 299) | def tf32_mode(cudnn=None, matmul=None): FILE: ldm_patched/ldm/models/autoencoder.py class DiagonalGaussianRegularizer (line 13) | class DiagonalGaussianRegularizer(torch.nn.Module): method __init__ (line 14) | def __init__(self, sample: bool = True): method get_trainable_parameters (line 18) | def get_trainable_parameters(self) -> Any: method forward (line 21) | def forward(self, z: torch.Tensor) -> Tuple[torch.Tensor, dict]: class AbstractAutoencoder (line 34) | class AbstractAutoencoder(torch.nn.Module): method __init__ (line 41) | def __init__( method get_input (line 59) | def get_input(self, batch) -> Any: method on_train_batch_end (line 62) | def on_train_batch_end(self, *args, **kwargs): method ema_scope (line 68) | def ema_scope(self, context=None): method encode (line 82) | def encode(self, *args, **kwargs) -> torch.Tensor: method decode (line 85) | def decode(self, *args, **kwargs) -> torch.Tensor: method instantiate_optimizer_from_config (line 88) | def instantiate_optimizer_from_config(self, params, lr, cfg): method configure_optimizers (line 94) | def configure_optimizers(self) -> Any: class AutoencodingEngine (line 98) | class AutoencodingEngine(AbstractAutoencoder): method __init__ (line 105) | def __init__( method get_last_layer (line 121) | def get_last_layer(self): method encode (line 124) | def encode( method decode (line 138) | def decode(self, z: torch.Tensor, **kwargs) -> torch.Tensor: method forward (line 142) | def forward( class AutoencodingEngineLegacy (line 150) | class AutoencodingEngineLegacy(AutoencodingEngine): method __init__ (line 151) | def __init__(self, embed_dim: int, **kwargs): method get_autoencoder_params (line 173) | def get_autoencoder_params(self) -> list: method encode (line 177) | def encode( method decode (line 199) | def decode(self, z: torch.Tensor, **decoder_kwargs) -> torch.Tensor: class AutoencoderKL (line 217) | class AutoencoderKL(AutoencodingEngineLegacy): method __init__ (line 218) | def __init__(self, **kwargs): FILE: ldm_patched/ldm/modules/attention.py function exists (line 29) | def exists(val): function uniq (line 33) | def uniq(arr): function default (line 37) | def default(val, d): function max_neg_value (line 43) | def max_neg_value(t): function init_ (line 47) | def init_(tensor): class GEGLU (line 55) | class GEGLU(nn.Module): method __init__ (line 56) | def __init__(self, dim_in, dim_out, dtype=None, device=None, operation... method forward (line 60) | def forward(self, x): class FeedForward (line 65) | class FeedForward(nn.Module): method __init__ (line 66) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0., d... method forward (line 81) | def forward(self, x): function Normalize (line 84) | def Normalize(in_channels, dtype=None, device=None): function attention_basic (line 87) | def attention_basic(q, k, v, heads, mask=None): function attention_sub_quad (line 132) | def attention_sub_quad(query, key, value, heads, mask=None): function attention_split (line 185) | def attention_split(q, k, v, heads, mask=None): function attention_xformers (line 285) | def attention_xformers(q, k, v, heads, mask=None): function attention_pytorch (line 317) | def attention_pytorch(q, k, v, heads, mask=None): function optimized_attention_for_device (line 350) | def optimized_attention_for_device(device, mask=False, small_input=False): class CrossAttention (line 366) | class CrossAttention(nn.Module): method __init__ (line 367) | def __init__(self, query_dim, context_dim=None, heads=8, dim_head=64, ... method forward (line 381) | def forward(self, x, context=None, value=None, mask=None): class BasicTransformerBlock (line 398) | class BasicTransformerBlock(nn.Module): method __init__ (line 399) | def __init__(self, dim, n_heads, d_head, dropout=0., context_dim=None,... method forward (line 439) | def forward(self, x, context=None, transformer_options={}): method _forward (line 442) | def _forward(self, x, context=None, transformer_options={}): class SpatialTransformer (line 557) | class SpatialTransformer(nn.Module): method __init__ (line 566) | def __init__(self, in_channels, n_heads, d_head, method forward (line 599) | def forward(self, x, context=None, transformer_options={}): class SpatialVideoTransformer (line 622) | class SpatialVideoTransformer(SpatialTransformer): method __init__ (line 623) | def __init__( method forward (line 706) | def forward( FILE: ldm_patched/ldm/modules/diffusionmodules/model.py function get_timestep_embedding (line 17) | def get_timestep_embedding(timesteps, embedding_dim): function nonlinearity (line 38) | def nonlinearity(x): function Normalize (line 43) | def Normalize(in_channels, 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 76) | class Downsample(nn.Module): method __init__ (line 77) | def __init__(self, in_channels, with_conv): method forward (line 88) | def forward(self, x): class ResnetBlock (line 98) | class ResnetBlock(nn.Module): method __init__ (line 99) | def __init__(self, *, in_channels, out_channels=None, conv_shortcut=Fa... method forward (line 138) | def forward(self, x, temb): function slice_attention (line 160) | def slice_attention(q, k, v): function normal_attention (line 197) | def normal_attention(q, k, v): function xformers_attention (line 211) | def xformers_attention(q, k, v): function pytorch_attention (line 226) | def pytorch_attention(q, k, v): class AttnBlock (line 243) | class AttnBlock(nn.Module): method __init__ (line 244) | def __init__(self, in_channels): method forward (line 280) | def forward(self, x): function make_attn (line 294) | def make_attn(in_channels, attn_type="vanilla", attn_kwargs=None): class Model (line 298) | class Model(nn.Module): method __init__ (line 299) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 398) | def forward(self, x, t=None, context=None): method get_last_layer (line 446) | def get_last_layer(self): class Encoder (line 450) | class Encoder(nn.Module): method __init__ (line 451) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 516) | def forward(self, x): class Decoder (line 541) | class Decoder(nn.Module): method __init__ (line 542) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 617) | def forward(self, z, **kwargs): FILE: ldm_patched/ldm/modules/diffusionmodules/openaimodel.py class TimestepBlock (line 20) | class TimestepBlock(nn.Module): method forward (line 26) | def forward(self, x, emb): function forward_timestep_embed (line 32) | def forward_timestep_embed(ts, x, emb, context=None, transformer_options... class TimestepEmbedSequential (line 52) | class TimestepEmbedSequential(nn.Sequential, TimestepBlock): method forward (line 58) | def forward(self, *args, **kwargs): class Upsample (line 61) | class Upsample(nn.Module): method __init__ (line 70) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 79) | def forward(self, x, output_shape=None): class Downsample (line 97) | class Downsample(nn.Module): method __init__ (line 106) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 121) | def forward(self, x): class ResBlock (line 126) | class ResBlock(TimestepBlock): method __init__ (line 142) | def __init__( method forward (line 222) | def forward(self, x, emb): method _forward (line 234) | def _forward(self, x, emb): class VideoResBlock (line 266) | class VideoResBlock(ResBlock): method __init__ (line 267) | def __init__( method forward (line 325) | def forward( class Timestep (line 347) | class Timestep(nn.Module): method __init__ (line 348) | def __init__(self, dim): method forward (line 352) | def forward(self, t): function apply_control (line 355) | def apply_control(h, control, name): class UNetModel (line 365) | class UNetModel(nn.Module): method __init__ (line 391) | def __init__( method forward (line 816) | def forward(self, x, timesteps=None, context=None, y=None, control=Non... FILE: ldm_patched/ldm/modules/diffusionmodules/upscaling.py class AbstractLowScaleModel (line 10) | class AbstractLowScaleModel(nn.Module): method __init__ (line 12) | def __init__(self, noise_schedule_config=None): method register_schedule (line 17) | def register_schedule(self, beta_schedule="linear", timesteps=1000, method q_sample (line 44) | def q_sample(self, x_start, t, noise=None, seed=None): method forward (line 53) | def forward(self, x): method decode (line 56) | def decode(self, x): class SimpleImageConcat (line 60) | class SimpleImageConcat(AbstractLowScaleModel): method __init__ (line 62) | def __init__(self): method forward (line 66) | def forward(self, x): class ImageConcatWithNoiseAugmentation (line 71) | class ImageConcatWithNoiseAugmentation(AbstractLowScaleModel): method __init__ (line 72) | def __init__(self, noise_schedule_config, max_noise_level=1000, to_cud... method forward (line 76) | def forward(self, x, noise_level=None, seed=None): FILE: ldm_patched/ldm/modules/diffusionmodules/util.py class AlphaBlender (line 20) | class AlphaBlender(nn.Module): method __init__ (line 23) | def __init__( method get_alpha (line 49) | def get_alpha(self, image_only_indicator: torch.Tensor) -> torch.Tensor: method forward (line 73) | def forward( function make_beta_schedule (line 87) | def make_beta_schedule(schedule, n_timestep, linear_start=1e-4, linear_e... function make_ddim_timesteps (line 119) | def make_ddim_timesteps(ddim_discr_method, num_ddim_timesteps, num_ddpm_... function make_ddim_sampling_parameters (line 136) | def make_ddim_sampling_parameters(alphacums, ddim_timesteps, eta, verbos... function betas_for_alpha_bar (line 150) | def betas_for_alpha_bar(num_diffusion_timesteps, alpha_bar, max_beta=0.9... function extract_into_tensor (line 169) | def extract_into_tensor(a, t, x_shape): function checkpoint (line 175) | def checkpoint(func, inputs, params, flag): class CheckpointFunction (line 192) | class CheckpointFunction(torch.autograd.Function): method forward (line 194) | def forward(ctx, run_function, length, *args): method backward (line 206) | def backward(ctx, *output_grads): function timestep_embedding (line 227) | def timestep_embedding(timesteps, dim, max_period=10000, repeat_only=Fal... function zero_module (line 250) | def zero_module(module): function scale_module (line 259) | def scale_module(module, scale): function mean_flat (line 268) | def mean_flat(tensor): function avg_pool_nd (line 275) | def avg_pool_nd(dims, *args, **kwargs): class HybridConditioner (line 288) | class HybridConditioner(nn.Module): method __init__ (line 290) | def __init__(self, c_concat_config, c_crossattn_config): method forward (line 295) | def forward(self, c_concat, c_crossattn): function noise_like (line 301) | def noise_like(shape, device, repeat=False): FILE: ldm_patched/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: ldm_patched/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 reset_num_updates (line 25) | def reset_num_updates(self): method forward (line 29) | def forward(self, model): method copy_to (line 50) | def copy_to(self, model): method store (line 59) | def store(self, parameters): method restore (line 68) | def restore(self, parameters): FILE: ldm_patched/ldm/modules/encoders/noise_aug_modules.py class CLIPEmbeddingNoiseAugmentation (line 5) | class CLIPEmbeddingNoiseAugmentation(ImageConcatWithNoiseAugmentation): method __init__ (line 6) | def __init__(self, *args, clip_stats_path=None, timestep_dim=256, **kw... method scale (line 16) | def scale(self, x): method unscale (line 21) | def unscale(self, x): method forward (line 26) | def forward(self, x, noise_level=None, seed=None): FILE: ldm_patched/ldm/modules/sub_quadratic_attention.py function dynamic_slice (line 29) | def dynamic_slice( class AttnChunk (line 37) | class AttnChunk(NamedTuple): class SummarizeChunk (line 42) | class SummarizeChunk(Protocol): method __call__ (line 44) | def __call__( class ComputeQueryChunkAttn (line 50) | class ComputeQueryChunkAttn(Protocol): method __call__ (line 52) | def __call__( function _summarize_chunk (line 58) | def _summarize_chunk( function _query_chunk_attention (line 96) | def _query_chunk_attention( function _get_attention_scores_no_kv_chunking (line 139) | def _get_attention_scores_no_kv_chunking( class ScannedChunk (line 183) | class ScannedChunk(NamedTuple): function efficient_dot_product_attention (line 187) | def efficient_dot_product_attention( FILE: ldm_patched/ldm/modules/temporal_ae.py function partialclass (line 18) | def partialclass(cls, *args, **kwargs): class VideoResBlock (line 25) | class VideoResBlock(ResnetBlock): method __init__ (line 26) | def __init__( method get_alpha (line 63) | def get_alpha(self, bs): method forward (line 71) | def forward(self, x, temb, skip_video=False, timesteps=None): class AE3DConv (line 92) | class AE3DConv(ops.Conv2d): method __init__ (line 93) | def __init__(self, in_channels, out_channels, video_kernel_size=3, *ar... method forward (line 107) | def forward(self, input, timesteps=None, skip_video=False): class AttnVideoBlock (line 118) | class AttnVideoBlock(AttnBlock): method __init__ (line 119) | def __init__( method forward (line 149) | def forward(self, x, timesteps=None, skip_time_block=False): method get_alpha (line 179) | def get_alpha( function make_time_attn (line 191) | def make_time_attn( class Conv2DWrapper (line 203) | class Conv2DWrapper(torch.nn.Conv2d): method forward (line 204) | def forward(self, input: torch.Tensor, **kwargs) -> torch.Tensor: class VideoDecoder (line 208) | class VideoDecoder(Decoder): method __init__ (line 211) | def __init__( method get_last_layer (line 237) | def get_last_layer(self, skip_time_mix=False, **kwargs): FILE: ldm_patched/ldm/util.py function log_txt_as_img (line 11) | def log_txt_as_img(wh, xc, size=10): function ismap (line 35) | def ismap(x): function isimage (line 41) | def isimage(x): function exists (line 47) | def exists(x): function default (line 51) | def default(val, d): function mean_flat (line 57) | def mean_flat(tensor): function count_params (line 65) | def count_params(model, verbose=False): function instantiate_from_config (line 72) | def instantiate_from_config(config): function get_obj_from_str (line 82) | def get_obj_from_str(string, reload=False): class AdamWwithEMAandWings (line 90) | class AdamWwithEMAandWings(optim.Optimizer): method __init__ (line 92) | def __init__(self, params, lr=1.e-3, betas=(0.9, 0.999), eps=1.e-8, #... method __setstate__ (line 113) | def __setstate__(self, state): method step (line 119) | def step(self, closure=None): FILE: ldm_patched/modules/args_parser.py class EnumAction (line 5) | class EnumAction(argparse.Action): method __init__ (line 9) | def __init__(self, **kwargs): method __call__ (line 28) | def __call__(self, parser, namespace, values, option_string=None): class LatentPreviewMethod (line 83) | class LatentPreviewMethod(enum.Enum): FILE: ldm_patched/modules/checkpoint_pickle.py class Empty (line 5) | class Empty: class Unpickler (line 8) | class Unpickler(pickle.Unpickler): method find_class (line 9) | def find_class(self, module, name): FILE: ldm_patched/modules/clip_model.py class CLIPAttention (line 4) | class CLIPAttention(torch.nn.Module): method __init__ (line 5) | def __init__(self, embed_dim, heads, dtype, device, operations): method forward (line 15) | def forward(self, x, mask=None, optimized_attention=None): class CLIPMLP (line 27) | class CLIPMLP(torch.nn.Module): method __init__ (line 28) | def __init__(self, embed_dim, intermediate_size, activation, dtype, de... method forward (line 34) | def forward(self, x): class CLIPLayer (line 40) | class CLIPLayer(torch.nn.Module): method __init__ (line 41) | def __init__(self, embed_dim, heads, intermediate_size, intermediate_a... method forward (line 48) | def forward(self, x, mask=None, optimized_attention=None): class CLIPEncoder (line 54) | class CLIPEncoder(torch.nn.Module): method __init__ (line 55) | def __init__(self, num_layers, embed_dim, heads, intermediate_size, in... method forward (line 59) | def forward(self, x, mask=None, intermediate_output=None): class CLIPEmbeddings (line 73) | class CLIPEmbeddings(torch.nn.Module): method __init__ (line 74) | def __init__(self, embed_dim, vocab_size=49408, num_positions=77, dtyp... method forward (line 79) | def forward(self, input_tokens): class CLIPTextModel_ (line 83) | class CLIPTextModel_(torch.nn.Module): method __init__ (line 84) | def __init__(self, config_dict, dtype, device, operations): method forward (line 96) | def forward(self, input_tokens, attention_mask=None, intermediate_outp... class CLIPTextModel (line 117) | class CLIPTextModel(torch.nn.Module): method __init__ (line 118) | def __init__(self, config_dict, dtype, device, operations): method get_input_embeddings (line 124) | def get_input_embeddings(self): method set_input_embeddings (line 127) | def set_input_embeddings(self, embeddings): method forward (line 130) | def forward(self, *args, **kwargs): class CLIPVisionEmbeddings (line 133) | class CLIPVisionEmbeddings(torch.nn.Module): method __init__ (line 134) | def __init__(self, embed_dim, num_channels=3, patch_size=14, image_siz... method forward (line 152) | def forward(self, pixel_values): class CLIPVision (line 157) | class CLIPVision(torch.nn.Module): method __init__ (line 158) | def __init__(self, config_dict, dtype, device, operations): method forward (line 171) | def forward(self, pixel_values, attention_mask=None, intermediate_outp... class CLIPVisionModelProjection (line 179) | class CLIPVisionModelProjection(torch.nn.Module): method __init__ (line 180) | def __init__(self, config_dict, dtype, device, operations): method forward (line 185) | def forward(self, *args, **kwargs): FILE: ldm_patched/modules/clip_vision.py class Output (line 12) | class Output: method __getitem__ (line 13) | def __getitem__(self, key): method __setitem__ (line 15) | def __setitem__(self, key, item): function clip_preprocess (line 18) | def clip_preprocess(image, size=224): class ClipVisionModel (line 31) | class ClipVisionModel(): method __init__ (line 32) | def __init__(self, json_config): method load_sd (line 44) | def load_sd(self, sd): method get_sd (line 47) | def get_sd(self): method encode_image (line 50) | def encode_image(self, image): function convert_to_transformers (line 61) | def convert_to_transformers(sd, prefix): function load_clipvision_from_sd (line 87) | def load_clipvision_from_sd(sd, prefix="", convert_keys=False): function load (line 111) | def load(ckpt_path): FILE: ldm_patched/modules/conds.py class CONDRegular (line 7) | class CONDRegular: method __init__ (line 8) | def __init__(self, cond): method _copy_with (line 11) | def _copy_with(self, cond): method process_cond (line 14) | def process_cond(self, batch_size, device, **kwargs): method can_concat (line 17) | def can_concat(self, other): method concat (line 22) | def concat(self, others): class CONDNoiseShape (line 28) | class CONDNoiseShape(CONDRegular): method process_cond (line 29) | def process_cond(self, batch_size, device, area, **kwargs): class CONDCrossAttn (line 34) | class CONDCrossAttn(CONDRegular): method can_concat (line 35) | def can_concat(self, other): method concat (line 48) | def concat(self, others): class CONDConstant (line 63) | class CONDConstant(CONDRegular): method __init__ (line 64) | def __init__(self, cond): method process_cond (line 67) | def process_cond(self, batch_size, device, **kwargs): method can_concat (line 70) | def can_concat(self, other): method concat (line 75) | def concat(self, others): FILE: ldm_patched/modules/controlnet.py function broadcast_image_to (line 14) | def broadcast_image_to(tensor, target_batch_size, batched_number): class ControlBase (line 32) | class ControlBase: method __init__ (line 33) | def __init__(self, device=None): method set_cond_hint (line 46) | def set_cond_hint(self, cond_hint, strength=1.0, timestep_percent_rang... method pre_run (line 52) | def pre_run(self, model, percent_to_timestep_function): method set_previous_controlnet (line 57) | def set_previous_controlnet(self, controlnet): method cleanup (line 61) | def cleanup(self): method get_models (line 69) | def get_models(self): method copy_to (line 75) | def copy_to(self, c): method inference_memory_requirements (line 81) | def inference_memory_requirements(self, dtype): method control_merge (line 86) | def control_merge(self, control_input, control_output, control_prev, o... class ControlNet (line 134) | class ControlNet(ControlBase): method __init__ (line 135) | def __init__(self, control_model, global_average_pooling=False, device... method get_control (line 144) | def get_control(self, x_noisy, t, cond, batched_number): method copy (line 179) | def copy(self): method get_models (line 184) | def get_models(self): method pre_run (line 189) | def pre_run(self, model, percent_to_timestep_function): method cleanup (line 193) | def cleanup(self): class ControlLoraOps (line 197) | class ControlLoraOps: class Linear (line 198) | class Linear(torch.nn.Module): method __init__ (line 199) | def __init__(self, in_features: int, out_features: int, bias: bool =... method forward (line 210) | def forward(self, input): class Conv2d (line 217) | class Conv2d(torch.nn.Module): method __init__ (line 218) | def __init__( method forward (line 250) | def forward(self, input): class ControlLora (line 258) | class ControlLora(ControlNet): method __init__ (line 259) | def __init__(self, control_weights, global_average_pooling=False, devi... method pre_run (line 264) | def pre_run(self, model, percent_to_timestep_function): method copy (line 298) | def copy(self): method cleanup (line 303) | def cleanup(self): method get_models (line 308) | def get_models(self): method inference_memory_requirements (line 312) | def inference_memory_requirements(self, dtype): function load_controlnet (line 315) | def load_controlnet(ckpt_path, model=None): class T2IAdapter (line 425) | class T2IAdapter(ControlBase): method __init__ (line 426) | def __init__(self, t2i_model, channels_in, device=None): method scale_image_to (line 432) | def scale_image_to(self, width, height): method get_control (line 438) | def get_control(self, x_noisy, t, cond, batched_number): method copy (line 474) | def copy(self): function load_t2i_adapter (line 479) | def load_t2i_adapter(t2i_data): FILE: ldm_patched/modules/diffusers_convert.py function convert_unet_state_dict (line 85) | def convert_unet_state_dict(unet_state_dict): function reshape_weight_for_sd (line 159) | def reshape_weight_for_sd(w): function convert_vae_state_dict (line 164) | def convert_vae_state_dict(vae_state_dict): function convert_text_enc_state_dict_v20 (line 209) | def convert_text_enc_state_dict_v20(text_enc_dict, prefix=""): function convert_text_enc_state_dict (line 258) | def convert_text_enc_state_dict(text_enc_dict): FILE: ldm_patched/modules/diffusers_load.py function first_file (line 5) | def first_file(path, filenames): function load_diffusers (line 12) | def load_diffusers(model_path, output_vae=True, output_clip=True, embedd... FILE: ldm_patched/modules/gligen.py function exists (line 7) | def exists(val): function uniq (line 11) | def uniq(arr): function default (line 15) | def default(val, d): class GEGLU (line 22) | class GEGLU(nn.Module): method __init__ (line 23) | def __init__(self, dim_in, dim_out): method forward (line 27) | def forward(self, x): class FeedForward (line 32) | class FeedForward(nn.Module): method __init__ (line 33) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.): method forward (line 48) | def forward(self, x): class GatedCrossAttentionDense (line 52) | class GatedCrossAttentionDense(nn.Module): method __init__ (line 53) | def __init__(self, query_dim, context_dim, n_heads, d_head): method forward (line 74) | def forward(self, x, objs): class GatedSelfAttentionDense (line 84) | class GatedSelfAttentionDense(nn.Module): method __init__ (line 85) | def __init__(self, query_dim, context_dim, n_heads, d_head): method forward (line 110) | def forward(self, x, objs): class GatedSelfAttentionDense2 (line 123) | class GatedSelfAttentionDense2(nn.Module): method __init__ (line 124) | def __init__(self, query_dim, context_dim, n_heads, d_head): method forward (line 146) | def forward(self, x, objs): class FourierEmbedder (line 177) | class FourierEmbedder(): method __init__ (line 178) | def __init__(self, num_freqs=64, temperature=100): method __call__ (line 185) | def __call__(self, x, cat_dim=-1): class PositionNet (line 194) | class PositionNet(nn.Module): method __init__ (line 195) | def __init__(self, in_dim, out_dim, fourier_freqs=8): method forward (line 216) | def forward(self, boxes, masks, positive_embeddings): class Gligen (line 240) | class Gligen(nn.Module): method __init__ (line 241) | def __init__(self, modules, position_net, key_dim): method _set_position (line 249) | def _set_position(self, boxes, masks, positive_embeddings): method set_position (line 257) | def set_position(self, latent_image_shape, position_params, device): method set_empty (line 288) | def set_empty(self, latent_image_shape, device): function load_gligen (line 301) | def load_gligen(sd): FILE: ldm_patched/modules/latent_formats.py class LatentFormat (line 3) | class LatentFormat: method process_in (line 8) | def process_in(self, latent): method process_out (line 11) | def process_out(self, latent): class SD15 (line 14) | class SD15(LatentFormat): method __init__ (line 15) | def __init__(self, scale_factor=0.18215): class SDXL (line 26) | class SDXL(LatentFormat): method __init__ (line 27) | def __init__(self): class SDXL_Playground_2_5 (line 38) | class SDXL_Playground_2_5(LatentFormat): method __init__ (line 39) | def __init__(self): method process_in (line 53) | def process_in(self, latent): method process_out (line 58) | def process_out(self, latent): class SD_X4 (line 64) | class SD_X4(LatentFormat): method __init__ (line 65) | def __init__(self): class SC_Prior (line 74) | class SC_Prior(LatentFormat): method __init__ (line 75) | def __init__(self): class SC_B (line 96) | class SC_B(LatentFormat): method __init__ (line 97) | def __init__(self): FILE: ldm_patched/modules/lora.py function load_lora (line 13) | def load_lora(lora, to_load): function model_lora_keys_clip (line 162) | def model_lora_keys_clip(model, key_map={}): function model_lora_keys_unet (line 203) | def model_lora_keys_unet(model, key_map={}): FILE: ldm_patched/modules/model_base.py class ModelType (line 11) | class ModelType(Enum): function model_sampling (line 20) | def model_sampling(model_config, model_type): class BaseModel (line 37) | class BaseModel(torch.nn.Module): method __init__ (line 38) | def __init__(self, model_config, model_type=ModelType.EPS, device=None): method apply_model (line 62) | def apply_model(self, x, t, c_concat=None, c_crossattn=None, control=N... method get_dtype (line 88) | def get_dtype(self): method is_adm (line 91) | def is_adm(self): method encode_adm (line 94) | def encode_adm(self, **kwargs): method extra_conds (line 97) | def extra_conds(self, **kwargs): method load_model_weights (line 158) | def load_model_weights(self, sd, unet_prefix=""): method process_latent_in (line 175) | def process_latent_in(self, latent): method process_latent_out (line 178) | def process_latent_out(self, latent): method state_dict_for_saving (line 181) | def state_dict_for_saving(self, clip_state_dict=None, vae_state_dict=N... method set_inpaint (line 204) | def set_inpaint(self): method memory_required (line 207) | def memory_required(self, input_shape): function unclip_adm (line 221) | def unclip_adm(unclip_conditioning, device, noise_augmentor, noise_augme... class SD21UNCLIP (line 245) | class SD21UNCLIP(BaseModel): method __init__ (line 246) | def __init__(self, model_config, noise_aug_config, model_type=ModelTyp... method encode_adm (line 250) | def encode_adm(self, **kwargs): function sdxl_pooled (line 258) | def sdxl_pooled(args, noise_augmentor): class SDXLRefiner (line 264) | class SDXLRefiner(BaseModel): method __init__ (line 265) | def __init__(self, model_config, model_type=ModelType.EPS, device=None): method encode_adm (line 270) | def encode_adm(self, **kwargs): class SDXL (line 291) | class SDXL(BaseModel): method __init__ (line 292) | def __init__(self, model_config, model_type=ModelType.EPS, device=None): method encode_adm (line 297) | def encode_adm(self, **kwargs): class SVD_img2vid (line 316) | class SVD_img2vid(BaseModel): method __init__ (line 317) | def __init__(self, model_config, model_type=ModelType.V_PREDICTION_EDM... method encode_adm (line 321) | def encode_adm(self, **kwargs): method extra_conds (line 334) | def extra_conds(self, **kwargs): class Stable_Zero123 (line 365) | class Stable_Zero123(BaseModel): method __init__ (line 366) | def __init__(self, model_config, model_type=ModelType.EPS, device=None... method extra_conds (line 372) | def extra_conds(self, **kwargs): class SD_X4Upscaler (line 395) | class SD_X4Upscaler(BaseModel): method __init__ (line 396) | def __init__(self, model_config, model_type=ModelType.V_PREDICTION, de... method extra_conds (line 400) | def extra_conds(self, **kwargs): FILE: ldm_patched/modules/model_detection.py function count_blocks (line 4) | def count_blocks(state_dict_keys, prefix_string): function calculate_transformer_depth (line 17) | def calculate_transformer_depth(prefix, state_dict_keys, state_dict): function detect_unet_config (line 31) | def detect_unet_config(state_dict, key_prefix, dtype): function model_config_from_unet_config (line 154) | def model_config_from_unet_config(unet_config): function model_config_from_unet (line 162) | def model_config_from_unet(state_dict, unet_key_prefix, dtype, use_base_... function convert_config (line 170) | def convert_config(unet_config): function unet_config_from_diffusers_unet (line 209) | def unet_config_from_diffusers_unet(state_dict, dtype): function model_config_from_diffusers_unet (line 316) | def model_config_from_diffusers_unet(state_dict, dtype): FILE: ldm_patched/modules/model_management.py class VRAMState (line 8) | class VRAMState(Enum): class CPUState (line 16) | class CPUState(Enum): function is_intel_xpu (line 68) | def is_intel_xpu(): function get_torch_device (line 76) | def get_torch_device(): function get_total_memory (line 92) | def get_total_memory(dev=None, torch_total_too=False): function is_nvidia (line 161) | def is_nvidia(): function get_torch_device_name (line 244) | def get_torch_device_name(device): function module_size (line 268) | def module_size(module): class LoadedModel (line 276) | class LoadedModel: method __init__ (line 277) | def __init__(self, model): method model_memory (line 282) | def model_memory(self): method model_memory_required (line 285) | def model_memory_required(self, device): method model_load (line 291) | def model_load(self, lowvram_model_memory=0): method model_unload (line 329) | def model_unload(self): method __eq__ (line 341) | def __eq__(self, other): function minimum_inference_memory (line 344) | def minimum_inference_memory(): function unload_model_clones (line 347) | def unload_model_clones(model): function free_memory (line 357) | def free_memory(memory_required, device, keep_loaded=[]): function load_models_gpu (line 379) | def load_models_gpu(models, memory_required=0): function load_model_gpu (line 442) | def load_model_gpu(model): function cleanup_models (line 445) | def cleanup_models(): function dtype_size (line 456) | def dtype_size(dtype): function unet_offload_device (line 469) | def unet_offload_device(): function unet_inital_load_device (line 475) | def unet_inital_load_device(parameters, dtype): function unet_dtype (line 493) | def unet_dtype(device=None, model_params=0): function unet_manual_cast (line 507) | def unet_manual_cast(weight_dtype, inference_device): function text_encoder_offload_device (line 520) | def text_encoder_offload_device(): function text_encoder_device (line 526) | def text_encoder_device(): function text_encoder_dtype (line 539) | def text_encoder_dtype(device=None): function intermediate_device (line 557) | def intermediate_device(): function vae_device (line 563) | def vae_device(): function vae_offload_device (line 568) | def vae_offload_device(): function vae_dtype (line 574) | def vae_dtype(): function get_autocast_device (line 578) | def get_autocast_device(dev): function supports_dtype (line 583) | def supports_dtype(device, dtype): #TODO function device_supports_non_blocking (line 594) | def device_supports_non_blocking(device): function cast_to_device (line 599) | def cast_to_device(tensor, device, dtype, copy=False): function xformers_enabled (line 621) | def xformers_enabled(): function xformers_enabled_vae (line 633) | def xformers_enabled_vae(): function pytorch_attention_enabled (line 640) | def pytorch_attention_enabled(): function pytorch_attention_flash_attention (line 644) | def pytorch_attention_flash_attention(): function get_free_memory (line 652) | def get_free_memory(dev=None, torch_free_too=False): function cpu_mode (line 684) | def cpu_mode(): function mps_mode (line 688) | def mps_mode(): function is_device_cpu (line 692) | def is_device_cpu(device): function is_device_mps (line 698) | def is_device_mps(device): function should_use_fp16 (line 704) | def should_use_fp16(device=None, model_params=0, prioritize_performance=... function soft_empty_cache (line 762) | def soft_empty_cache(force=False): function unload_all_models (line 773) | def unload_all_models(): function resolve_lowvram_weight (line 777) | def resolve_lowvram_weight(weight, model, key): #TODO: remove class InterruptProcessingException (line 783) | class InterruptProcessingException(Exception): function interrupt_current_processing (line 789) | def interrupt_current_processing(value=True): function processing_interrupted (line 795) | def processing_interrupted(): function throw_exception_if_processing_interrupted (line 801) | def throw_exception_if_processing_interrupted(): FILE: ldm_patched/modules/model_patcher.py class ModelPatcher (line 8) | class ModelPatcher: method __init__ (line 9) | def __init__(self, model, load_device, offload_device, size=0, current... method model_size (line 27) | def model_size(self): method clone (line 35) | def clone(self): method is_clone (line 46) | def is_clone(self, other): method memory_required (line 51) | def memory_required(self, input_shape): method set_model_sampler_cfg_function (line 54) | def set_model_sampler_cfg_function(self, sampler_cfg_function, disable... method set_model_sampler_post_cfg_function (line 62) | def set_model_sampler_post_cfg_function(self, post_cfg_function, disab... method set_model_unet_function_wrapper (line 67) | def set_model_unet_function_wrapper(self, unet_wrapper_function): method set_model_patch (line 70) | def set_model_patch(self, patch, name): method set_model_patch_replace (line 76) | def set_model_patch_replace(self, patch, name, block_name, number, tra... method set_model_attn1_patch (line 88) | def set_model_attn1_patch(self, patch): method set_model_attn2_patch (line 91) | def set_model_attn2_patch(self, patch): method set_model_attn1_replace (line 94) | def set_model_attn1_replace(self, patch, block_name, number, transform... method set_model_attn2_replace (line 97) | def set_model_attn2_replace(self, patch, block_name, number, transform... method set_model_attn1_output_patch (line 100) | def set_model_attn1_output_patch(self, patch): method set_model_attn2_output_patch (line 103) | def set_model_attn2_output_patch(self, patch): method set_model_input_block_patch (line 106) | def set_model_input_block_patch(self, patch): method set_model_input_block_patch_after_skip (line 109) | def set_model_input_block_patch_after_skip(self, patch): method set_model_output_block_patch (line 112) | def set_model_output_block_patch(self, patch): method add_object_patch (line 115) | def add_object_patch(self, name, obj): method model_patches_to (line 118) | def model_patches_to(self, device): method model_dtype (line 139) | def model_dtype(self): method add_patches (line 143) | def add_patches(self, patches, strength_patch=1.0, strength_model=1.0): method get_key_patches (line 154) | def get_key_patches(self, filter_prefix=None): method model_state_dict (line 168) | def model_state_dict(self, filter_prefix=None): method patch_model (line 177) | def patch_model(self, device_to=None, patch_weights=True): method calculate_weight (line 215) | def calculate_weight(self, patches, weight, key): method unpatch_model (line 337) | def unpatch_model(self, device_to=None): FILE: ldm_patched/modules/model_sampling.py class EPS (line 6) | class EPS: method calculate_input (line 7) | def calculate_input(self, sigma, noise): method calculate_denoised (line 11) | def calculate_denoised(self, sigma, model_output, model_input): method noise_scaling (line 15) | def noise_scaling(self, sigma, noise, latent_image, max_denoise=False): method inverse_noise_scaling (line 24) | def inverse_noise_scaling(self, sigma, latent): class V_PREDICTION (line 27) | class V_PREDICTION(EPS): method calculate_denoised (line 28) | def calculate_denoised(self, sigma, model_output, model_input): class EDM (line 32) | class EDM(V_PREDICTION): method calculate_denoised (line 33) | def calculate_denoised(self, sigma, model_output, model_input): class ModelSamplingDiscrete (line 38) | class ModelSamplingDiscrete(torch.nn.Module): method __init__ (line 39) | def __init__(self, model_config=None): method _register_schedule (line 54) | def _register_schedule(self, given_betas=None, beta_schedule="linear",... method set_sigmas (line 77) | def set_sigmas(self, sigmas): method set_alphas_cumprod (line 81) | def set_alphas_cumprod(self, alphas_cumprod): method sigma_min (line 85) | def sigma_min(self): method sigma_max (line 89) | def sigma_max(self): method timestep (line 92) | def timestep(self, sigma): method sigma (line 97) | def sigma(self, timestep): method percent_to_sigma (line 105) | def percent_to_sigma(self, percent): class ModelSamplingContinuousEDM (line 114) | class ModelSamplingContinuousEDM(torch.nn.Module): method __init__ (line 115) | def __init__(self, model_config=None): method set_parameters (line 127) | def set_parameters(self, sigma_min, sigma_max, sigma_data): method sigma_min (line 135) | def sigma_min(self): method sigma_max (line 139) | def sigma_max(self): method timestep (line 142) | def timestep(self, sigma): method sigma (line 145) | def sigma(self, timestep): method percent_to_sigma (line 148) | def percent_to_sigma(self, percent): class StableCascadeSampling (line 158) | class StableCascadeSampling(ModelSamplingDiscrete): method __init__ (line 159) | def __init__(self, model_config=None): method set_parameters (line 169) | def set_parameters(self, shift=1.0, cosine_s=8e-3): method sigma (line 183) | def sigma(self, timestep): method timestep (line 195) | def timestep(self, sigma): method percent_to_sigma (line 202) | def percent_to_sigma(self, percent): FILE: ldm_patched/modules/ops.py function cast_bias_weight (line 4) | def cast_bias_weight(s, input): class disable_weight_init (line 13) | class disable_weight_init: class Linear (line 14) | class Linear(torch.nn.Linear): method reset_parameters (line 16) | def reset_parameters(self): method forward_ldm_patched_cast_weights (line 19) | def forward_ldm_patched_cast_weights(self, input): method forward (line 23) | def forward(self, *args, **kwargs): class Conv2d (line 29) | class Conv2d(torch.nn.Conv2d): method reset_parameters (line 31) | def reset_parameters(self): method forward_ldm_patched_cast_weights (line 34) | def forward_ldm_patched_cast_weights(self, input): method forward (line 38) | def forward(self, *args, **kwargs): class Conv3d (line 44) | class Conv3d(torch.nn.Conv3d): method reset_parameters (line 46) | def reset_parameters(self): method forward_ldm_patched_cast_weights (line 49) | def forward_ldm_patched_cast_weights(self, input): method forward (line 53) | def forward(self, *args, **kwargs): class GroupNorm (line 59) | class GroupNorm(torch.nn.GroupNorm): method reset_parameters (line 61) | def reset_parameters(self): method forward_ldm_patched_cast_weights (line 64) | def forward_ldm_patched_cast_weights(self, input): method forward (line 68) | def forward(self, *args, **kwargs): class LayerNorm (line 75) | class LayerNorm(torch.nn.LayerNorm): method reset_parameters (line 77) | def reset_parameters(self): method forward_ldm_patched_cast_weights (line 80) | def forward_ldm_patched_cast_weights(self, input): method forward (line 84) | def forward(self, *args, **kwargs): method conv_nd (line 91) | def conv_nd(s, dims, *args, **kwargs): class manual_cast (line 100) | class manual_cast(disable_weight_init): class Linear (line 101) | class Linear(disable_weight_init.Linear): class Conv2d (line 104) | class Conv2d(disable_weight_init.Conv2d): class Conv3d (line 107) | class Conv3d(disable_weight_init.Conv3d): class GroupNorm (line 110) | class GroupNorm(disable_weight_init.GroupNorm): class LayerNorm (line 113) | class LayerNorm(disable_weight_init.LayerNorm): FILE: ldm_patched/modules/options.py function enable_args_parsing (line 4) | def enable_args_parsing(enable=True): FILE: ldm_patched/modules/sample.py function prepare_noise (line 9) | def prepare_noise(latent_image, seed, noise_inds=None): function prepare_mask (line 28) | def prepare_mask(noise_mask, shape, device): function get_models_from_cond (line 36) | def get_models_from_cond(cond, model_type): function convert_cond (line 43) | def convert_cond(cond): function get_additional_models (line 55) | def get_additional_models(positive, negative, dtype): function cleanup_additional_models (line 70) | def cleanup_additional_models(models): function prepare_sampling (line 76) | def prepare_sampling(model, noise_shape, positive, negative, noise_mask): function sample (line 92) | def sample(model, noise, steps, cfg, sampler_name, scheduler, positive, ... function sample_custom (line 107) | def sample_custom(model, noise, cfg, sampler, sigmas, positive, negative... FILE: ldm_patched/modules/samplers.py function get_area_and_mult (line 8) | def get_area_and_mult(conds, x_in, timestep_in): function cond_equal_size (line 79) | def cond_equal_size(c1, c2): function can_concat_cond (line 89) | def can_concat_cond(c1, c2): function cond_cat (line 109) | def cond_cat(c_list): function calc_cond_uncond_batch (line 129) | def calc_cond_uncond_batch(model, cond, uncond, x_in, timestep, model_op... function sampling_function (line 242) | def sampling_function(model, x, timestep, uncond, cond, cond_scale, mode... class CFGNoisePredictor (line 263) | class CFGNoisePredictor(torch.nn.Module): method __init__ (line 264) | def __init__(self, model): method apply_model (line 267) | def apply_model(self, x, timestep, cond, uncond, cond_scale, model_opt... method forward (line 270) | def forward(self, *args, **kwargs): class KSamplerX0Inpaint (line 273) | class KSamplerX0Inpaint(torch.nn.Module): method __init__ (line 274) | def __init__(self, model): method forward (line 277) | def forward(self, x, sigma, uncond, cond, cond_scale, denoise_mask, mo... function simple_scheduler (line 286) | def simple_scheduler(model, steps): function ddim_scheduler (line 295) | def ddim_scheduler(model, steps): function normal_scheduler (line 307) | def normal_scheduler(model, steps, sgm=False, floor=False): function get_mask_aabb (line 324) | def get_mask_aabb(masks): function resolve_areas_and_cond_masks (line 347) | def resolve_areas_and_cond_masks(conditions, h, w, device): function create_cond_with_same_area_if_none (line 387) | def create_cond_with_same_area_if_none(conds, c): function calculate_start_end_timesteps (line 419) | def calculate_start_end_timesteps(model, conds): function pre_run_control (line 439) | def pre_run_control(model, conds): function apply_empty_x_to_equal_area (line 450) | def apply_empty_x_to_equal_area(conds, uncond, name, uncond_fill_func): function encode_model_conds (line 485) | def encode_model_conds(model_function, conds, noise, device, prompt_type... class Sampler (line 507) | class Sampler: method sample (line 508) | def sample(self): method max_denoise (line 511) | def max_denoise(self, model_wrap, sigmas): class UNIPC (line 516) | class UNIPC(Sampler): method sample (line 517) | def sample(self, model_wrap, sigmas, extra_args, callback, noise, late... class UNIPCBH2 (line 520) | class UNIPCBH2(Sampler): method sample (line 521) | def sample(self, model_wrap, sigmas, extra_args, callback, noise, late... class KSAMPLER (line 528) | class KSAMPLER(Sampler): method __init__ (line 529) | def __init__(self, sampler_function, extra_options={}, inpaint_options... method sample (line 534) | def sample(self, model_wrap, sigmas, extra_args, callback, noise, late... function ksampler (line 561) | def ksampler(sampler_name, extra_options={}, inpaint_options={}): function wrap_model (line 582) | def wrap_model(model): function sample (line 586) | def sample(model, noise, positive, negative, cfg, device, sampler, sigma... function calculate_sigmas_scheduler (line 624) | def calculate_sigmas_scheduler(model, scheduler_name, steps): function sampler_object (line 641) | def sampler_object(name): class KSampler (line 652) | class KSampler: method __init__ (line 656) | def __init__(self, model, steps, device, sampler=None, scheduler=None,... method calculate_sigmas (line 669) | def calculate_sigmas(self, steps): method set_steps (line 683) | def set_steps(self, steps, denoise=None): method sample (line 692) | def sample(self, noise, positive, negative, cfg, latent_image=None, st... FILE: ldm_patched/modules/sd.py function load_model_weights (line 25) | def load_model_weights(model, sd): function load_clip_weights (line 39) | def load_clip_weights(model, sd): function load_lora_for_models (line 55) | def load_lora_for_models(model, clip, lora, strength_model, strength_clip): class CLIP (line 85) | class CLIP: method __init__ (line 86) | def __init__(self, target=None, embedding_directory=None, no_init=False): method clone (line 104) | def clone(self): method add_patches (line 112) | def add_patches(self, patches, strength_patch=1.0, strength_model=1.0): method clip_layer (line 115) | def clip_layer(self, layer_idx): method tokenize (line 118) | def tokenize(self, text, return_word_ids=False): method encode_from_tokens (line 121) | def encode_from_tokens(self, tokens, return_pooled=False): method encode (line 133) | def encode(self, text): method load_sd (line 137) | def load_sd(self, sd): method get_sd (line 140) | def get_sd(self): method load_model (line 143) | def load_model(self): method get_key_patches (line 147) | def get_key_patches(self): class VAE (line 150) | class VAE: method __init__ (line 151) | def __init__(self, sd=None, device=None, config=None, dtype=None): method decode_tiled_ (line 203) | def decode_tiled_(self, samples, tile_x=64, tile_y=64, overlap = 16): method encode_tiled_ (line 217) | def encode_tiled_(self, pixel_samples, tile_x=512, tile_y=512, overlap... method decode (line 230) | def decode(self, samples_in): method decode_tiled (line 249) | def decode_tiled(self, samples, tile_x=64, tile_y=64, overlap = 16): method encode (line 254) | def encode(self, pixel_samples): method encode_tiled (line 273) | def encode_tiled(self, pixel_samples, tile_x=512, tile_y=512, overlap ... method get_sd (line 279) | def get_sd(self): class StyleModel (line 282) | class StyleModel: method __init__ (line 283) | def __init__(self, model, device="cpu"): method get_cond (line 286) | def get_cond(self, input): function load_style_model (line 290) | def load_style_model(ckpt_path): function load_clip (line 301) | def load_clip(ckpt_paths, embedding_directory=None): function load_gligen (line 339) | def load_gligen(ckpt_path): function load_checkpoint (line 346) | def load_checkpoint(config_path=None, ckpt_path=None, output_vae=True, o... function load_checkpoint_guess_config (line 430) | def load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip... function load_unet_state_dict (line 496) | def load_unet_state_dict(sd): #load unet in diffusers format function load_unet (line 531) | def load_unet(unet_path): function save_checkpoint (line 539) | def save_checkpoint(output_path, model, clip=None, vae=None, clip_vision... FILE: ldm_patched/modules/sd1_clip.py function gen_empty_tokens (line 12) | def gen_empty_tokens(special_tokens, length): class ClipTokenWeightEncoder (line 24) | class ClipTokenWeightEncoder: method encode_token_weights (line 25) | def encode_token_weights(self, token_weight_pairs): class SDClipModel (line 61) | class SDClipModel(torch.nn.Module, ClipTokenWeightEncoder): method __init__ (line 68) | def __init__(self, version="openai/clip-vit-large-patch14", device="cp... method freeze (line 100) | def freeze(self): method clip_layer (line 106) | def clip_layer(self, layer_idx): method reset_clip_layer (line 113) | def reset_clip_layer(self): method set_up_textual_embeddings (line 117) | def set_up_textual_embeddings(self, tokens, current_embeds): method forward (line 156) | def forward(self, tokens): method encode (line 189) | def encode(self, tokens): method load_sd (line 192) | def load_sd(self, sd): function parse_parentheses (line 199) | def parse_parentheses(string): function token_weights (line 227) | def token_weights(string, current_weight): function escape_important (line 247) | def escape_important(text): function unescape_important (line 252) | def unescape_important(text): function safe_load_embed_zip (line 257) | def safe_load_embed_zip(embed_path): function expand_directory_list (line 276) | def expand_directory_list(directories): function load_embed (line 284) | def load_embed(embedding_name, embedding_directory, embedding_size, embe... class SDTokenizer (line 356) | class SDTokenizer: method __init__ (line 357) | def __init__(self, tokenizer_path=None, max_length=77, pad_with_end=Tr... method _try_get_embedding (line 383) | def _try_get_embedding(self, embedding_name:str): method tokenize_with_weights (line 397) | def tokenize_with_weights(self, text:str, return_word_ids=False): method untokenize (line 480) | def untokenize(self, token_weight_pair): class SD1Tokenizer (line 484) | class SD1Tokenizer: method __init__ (line 485) | def __init__(self, embedding_directory=None, clip_name="l", tokenizer=... method tokenize_with_weights (line 490) | def tokenize_with_weights(self, text:str, return_word_ids=False): method untokenize (line 495) | def untokenize(self, token_weight_pair): class SD1ClipModel (line 499) | class SD1ClipModel(torch.nn.Module): method __init__ (line 500) | def __init__(self, device="cpu", dtype=None, clip_name="l", clip_model... method clip_layer (line 506) | def clip_layer(self, layer_idx): method reset_clip_layer (line 509) | def reset_clip_layer(self): method encode_token_weights (line 512) | def encode_token_weights(self, token_weight_pairs): method load_sd (line 517) | def load_sd(self, sd): FILE: ldm_patched/modules/sd2_clip.py class SD2ClipHModel (line 5) | class SD2ClipHModel(sd1_clip.SDClipModel): method __init__ (line 6) | def __init__(self, arch="ViT-H-14", device="cpu", max_length=77, freez... class SD2ClipHTokenizer (line 14) | class SD2ClipHTokenizer(sd1_clip.SDTokenizer): method __init__ (line 15) | def __init__(self, tokenizer_path=None, embedding_directory=None): class SD2Tokenizer (line 18) | class SD2Tokenizer(sd1_clip.SD1Tokenizer): method __init__ (line 19) | def __init__(self, embedding_directory=None): class SD2ClipModel (line 22) | class SD2ClipModel(sd1_clip.SD1ClipModel): method __init__ (line 23) | def __init__(self, device="cpu", dtype=None, **kwargs): FILE: ldm_patched/modules/sdxl_clip.py class SDXLClipG (line 5) | class SDXLClipG(sd1_clip.SDClipModel): method __init__ (line 6) | def __init__(self, device="cpu", max_length=77, freeze=True, layer="pe... method load_sd (line 15) | def load_sd(self, sd): class SDXLClipGTokenizer (line 18) | class SDXLClipGTokenizer(sd1_clip.SDTokenizer): method __init__ (line 19) | def __init__(self, tokenizer_path=None, embedding_directory=None): class SDXLTokenizer (line 23) | class SDXLTokenizer: method __init__ (line 24) | def __init__(self, embedding_directory=None): method tokenize_with_weights (line 28) | def tokenize_with_weights(self, text:str, return_word_ids=False): method untokenize (line 34) | def untokenize(self, token_weight_pair): class SDXLClipModel (line 37) | class SDXLClipModel(torch.nn.Module): method __init__ (line 38) | def __init__(self, device="cpu", dtype=None): method clip_layer (line 43) | def clip_layer(self, layer_idx): method reset_clip_layer (line 47) | def reset_clip_layer(self): method encode_token_weights (line 51) | def encode_token_weights(self, token_weight_pairs): method load_sd (line 58) | def load_sd(self, sd): class SDXLRefinerClipModel (line 64) | class SDXLRefinerClipModel(sd1_clip.SD1ClipModel): method __init__ (line 65) | def __init__(self, device="cpu", dtype=None): FILE: ldm_patched/modules/supported_models.py class SD15 (line 14) | class SD15(supported_models_base.BASE): method process_clip_state_dict (line 30) | def process_clip_state_dict(self, state_dict): method process_clip_state_dict_for_saving (line 47) | def process_clip_state_dict_for_saving(self, state_dict): method clip_target (line 51) | def clip_target(self): class SD20 (line 54) | class SD20(supported_models_base.BASE): method model_type (line 65) | def model_type(self, state_dict, prefix=""): method process_clip_state_dict (line 73) | def process_clip_state_dict(self, state_dict): method process_clip_state_dict_for_saving (line 81) | def process_clip_state_dict_for_saving(self, state_dict): method clip_target (line 88) | def clip_target(self): class SD21UnclipL (line 91) | class SD21UnclipL(SD20): class SD21UnclipH (line 104) | class SD21UnclipH(SD20): class SDXLRefiner (line 116) | class SDXLRefiner(supported_models_base.BASE): method get_model (line 128) | def get_model(self, state_dict, prefix="", device=None): method process_clip_state_dict (line 131) | def process_clip_state_dict(self, state_dict): method process_clip_state_dict_for_saving (line 142) | def process_clip_state_dict_for_saving(self, state_dict): method clip_target (line 151) | def clip_target(self): class SDXL (line 154) | class SDXL(supported_models_base.BASE): method model_type (line 166) | def model_type(self, state_dict, prefix=""): method get_model (line 172) | def get_model(self, state_dict, prefix="", device=None): method process_clip_state_dict (line 178) | def process_clip_state_dict(self, state_dict): method process_clip_state_dict_for_saving (line 192) | def process_clip_state_dict_for_saving(self, state_dict): method clip_target (line 207) | def clip_target(self): class SSD1B (line 210) | class SSD1B(SDXL): class Segmind_Vega (line 220) | class Segmind_Vega(SDXL): class SVD_img2vid (line 230) | class SVD_img2vid(supported_models_base.BASE): method get_model (line 248) | def get_model(self, state_dict, prefix="", device=None): method clip_target (line 252) | def clip_target(self): class Stable_Zero123 (line 255) | class Stable_Zero123(supported_models_base.BASE): method get_model (line 274) | def get_model(self, state_dict, prefix="", device=None): method clip_target (line 278) | def clip_target(self): class SD_X4Upscaler (line 281) | class SD_X4Upscaler(SD20): method get_model (line 305) | def get_model(self, state_dict, prefix="", device=None): FILE: ldm_patched/modules/supported_models_base.py class ClipTarget (line 6) | class ClipTarget: method __init__ (line 7) | def __init__(self, tokenizer, clip): class BASE (line 12) | class BASE: method matches (line 28) | def matches(s, unet_config): method model_type (line 34) | def model_type(self, state_dict, prefix=""): method inpaint_model (line 37) | def inpaint_model(self): method __init__ (line 40) | def __init__(self, unet_config): method get_model (line 46) | def get_model(self, state_dict, prefix="", device=None): method process_clip_state_dict (line 55) | def process_clip_state_dict(self, state_dict): method process_unet_state_dict (line 58) | def process_unet_state_dict(self, state_dict): method process_vae_state_dict (line 61) | def process_vae_state_dict(self, state_dict): method process_clip_state_dict_for_saving (line 64) | def process_clip_state_dict_for_saving(self, state_dict): method process_clip_vision_state_dict_for_saving (line 68) | def process_clip_vision_state_dict_for_saving(self, state_dict): method process_unet_state_dict_for_saving (line 74) | def process_unet_state_dict_for_saving(self, state_dict): method process_vae_state_dict_for_saving (line 78) | def process_vae_state_dict_for_saving(self, state_dict): method set_manual_cast (line 82) | def set_manual_cast(self, manual_cast_dtype): FILE: ldm_patched/modules/utils.py function load_torch_file (line 9) | def load_torch_file(ckpt, safe_load=False, device=None): function save_torch_file (line 31) | def save_torch_file(sd, ckpt, metadata=None): function calculate_parameters (line 37) | def calculate_parameters(sd, prefix=""): function state_dict_key_replace (line 44) | def state_dict_key_replace(state_dict, keys_to_replace): function state_dict_prefix_replace (line 50) | def state_dict_prefix_replace(state_dict, replace_prefix, filter_keys=Fa... function transformers_convert (line 63) | def transformers_convert(sd, prefix_from, prefix_to, number): function unet_to_diffusers (line 171) | def unet_to_diffusers(unet_config): function repeat_to_batch_size (line 235) | def repeat_to_batch_size(tensor, batch_size): function resize_to_batch_size (line 242) | def resize_to_batch_size(tensor, batch_size): function convert_sd_to (line 262) | def convert_sd_to(state_dict, dtype): function safetensors_header (line 268) | def safetensors_header(safetensors_path, max_size=100*1024*1024): function set_attr (line 276) | def set_attr(obj, attr, value): function copy_to_param (line 284) | def copy_to_param(obj, attr, value): function get_attr (line 292) | def get_attr(obj, attr): function bislerp (line 298) | def bislerp(samples, width, height): function lanczos (line 374) | def lanczos(samples, width, height): function common_upscale (line 381) | def common_upscale(samples, width, height, upscale_method, crop): function get_tiled_scale_steps (line 404) | def get_tiled_scale_steps(width, height, tile_x, tile_y, overlap): function tiled_scale (line 408) | def tiled_scale(samples, function, tile_x=64, tile_y=64, overlap = 8, up... function set_progress_bar_enabled (line 435) | def set_progress_bar_enabled(enabled): function set_progress_bar_global_hook (line 440) | def set_progress_bar_global_hook(function): class ProgressBar (line 444) | class ProgressBar: method __init__ (line 445) | def __init__(self, total): method update_absolute (line 451) | def update_absolute(self, value, total=None, preview=None): method update (line 460) | def update(self, value): FILE: ldm_patched/pfn/architecture/DAT.py function img2windows (line 18) | def img2windows(img, H_sp, W_sp): function windows2img (line 31) | def windows2img(img_splits_hw, H_sp, W_sp, H, W): class SpatialGate (line 43) | class SpatialGate(nn.Module): method __init__ (line 49) | def __init__(self, dim): method forward (line 56) | def forward(self, x, H, W): class SGFN (line 70) | class SGFN(nn.Module): method __init__ (line 80) | def __init__( method forward (line 97) | def forward(self, x, H, W): class DynamicPosBias (line 114) | class DynamicPosBias(nn.Module): method __init__ (line 123) | def __init__(self, dim, num_heads, residual): method forward (line 145) | def forward(self, biases): class Spatial_Attention (line 156) | class Spatial_Attention(nn.Module): method __init__ (line 171) | def __init__( method im2win (line 228) | def im2win(self, x, H, W): method forward (line 239) | def forward(self, qkv, H, W, mask=None): class Adaptive_Spatial_Attention (line 293) | class Adaptive_Spatial_Attention(nn.Module): method __init__ (line 309) | def __init__( method calculate_mask (line 394) | def calculate_mask(self, H, W): method forward (line 473) | def forward(self, x, H, W): class Adaptive_Channel_Attention (line 578) | class Adaptive_Channel_Attention(nn.Module): method __init__ (line 590) | def __init__( method forward (line 627) | def forward(self, x, H, W): class DATB (line 682) | class DATB(nn.Module): method __init__ (line 683) | def __init__( method forward (line 741) | def forward(self, x, x_size): class ResidualGroup (line 753) | class ResidualGroup(nn.Module): method __init__ (line 773) | def __init__( method forward (line 830) | def forward(self, x, x_size): class Upsample (line 850) | class Upsample(nn.Sequential): method __init__ (line 857) | def __init__(self, scale, num_feat): class UpsampleOneStep (line 873) | class UpsampleOneStep(nn.Sequential): method __init__ (line 883) | def __init__(self, scale, num_feat, num_out_ch, input_resolution=None): method flops (line 891) | def flops(self): class DAT (line 897) | class DAT(nn.Module): method __init__ (line 920) | def __init__(self, state_dict): method _init_weights (line 1140) | def _init_weights(self, m): method forward_features (line 1151) | def forward_features(self, x): method forward (line 1162) | def forward(self, x): FILE: ldm_patched/pfn/architecture/HAT.py function drop_path (line 15) | def drop_path(x, drop_prob: float = 0.0, training: bool = False): class DropPath (line 31) | class DropPath(nn.Module): method __init__ (line 36) | def __init__(self, drop_prob=None): method forward (line 40) | def forward(self, x): class ChannelAttention (line 44) | class ChannelAttention(nn.Module): method __init__ (line 51) | def __init__(self, num_feat, squeeze_factor=16): method forward (line 61) | def forward(self, x): class CAB (line 66) | class CAB(nn.Module): method __init__ (line 67) | def __init__(self, num_feat, compress_ratio=3, squeeze_factor=30): method forward (line 77) | def forward(self, x): class Mlp (line 81) | class Mlp(nn.Module): method __init__ (line 82) | def __init__( method forward (line 98) | def forward(self, x): function window_partition (line 107) | def window_partition(x, window_size): function window_reverse (line 123) | def window_reverse(windows, window_size, h, w): class WindowAttention (line 141) | class WindowAttention(nn.Module): method __init__ (line 154) | def __init__( method forward (line 185) | def forward(self, x, rpi, mask=None): class HAB (line 234) | class HAB(nn.Module): method __init__ (line 252) | def __init__( method forward (line 312) | def forward(self, x, x_size, rpi_sa, attn_mask): class PatchMerging (line 366) | class PatchMerging(nn.Module): method __init__ (line 374) | def __init__(self, input_resolution, dim, norm_layer=nn.LayerNorm): method forward (line 381) | def forward(self, x): class OCAB (line 405) | class OCAB(nn.Module): method __init__ (line 408) | def __init__( method forward (line 457) | def forward(self, x, x_size, rpi): class AttenBlocks (line 539) | class AttenBlocks(nn.Module): method __init__ (line 558) | def __init__( method forward (line 632) | def forward(self, x, x_size, params): class RHAG (line 643) | class RHAG(nn.Module): method __init__ (line 665) | def __init__( method forward (line 736) | def forward(self, x, x_size, params): class PatchEmbed (line 747) | class PatchEmbed(nn.Module): method __init__ (line 757) | def __init__( method forward (line 780) | def forward(self, x): class PatchUnEmbed (line 787) | class PatchUnEmbed(nn.Module): method __init__ (line 797) | def __init__( method forward (line 815) | def forward(self, x, x_size): class Upsample (line 824) | class Upsample(nn.Sequential): method __init__ (line 831) | def __init__(self, scale, num_feat): class HAT (line 847) | class HAT(nn.Module): method __init__ (line 875) | def __init__( method _init_weights (line 1133) | def _init_weights(self, m): method calculate_rpi_sa (line 1142) | def calculate_rpi_sa(self): method calculate_rpi_oca (line 1160) | def calculate_rpi_oca(self): method calculate_mask (line 1191) | def calculate_mask(self, x_size): method no_weight_decay (line 1223) | def no_weight_decay(self): method no_weight_decay_keywords (line 1227) | def no_weight_decay_keywords(self): method check_image_size (line 1230) | def check_image_size(self, x): method forward_features (line 1237) | def forward_features(self, x): method forward (line 1262) | def forward(self, x): FILE: ldm_patched/pfn/architecture/LaMa.py class LearnableSpatialTransformWrapper (line 18) | class LearnableSpatialTransformWrapper(nn.Module): method __init__ (line 19) | def __init__(self, impl, pad_coef=0.5, angle_init_range=80, train_angl... method forward (line 27) | def forward(self, x): method transform (line 39) | def transform(self, x): method inverse_transform (line 49) | def inverse_transform(self, y_padded_rotated, orig_x): class SELayer (line 64) | class SELayer(nn.Module): method __init__ (line 65) | def __init__(self, channel, reduction=16): method forward (line 75) | def forward(self, x): class FourierUnit (line 83) | class FourierUnit(nn.Module): method __init__ (line 84) | def __init__( method forward (line 126) | def forward(self, x): class SpectralTransform (line 224) | class SpectralTransform(nn.Module): method __init__ (line 225) | def __init__( method forward (line 259) | def forward(self, x): class FFC (line 282) | class FFC(nn.Module): method __init__ (line 283) | def __init__( method forward (line 368) | def forward(self, x): class FFC_BN_ACT (line 391) | class FFC_BN_ACT(nn.Module): method __init__ (line 392) | def __init__( method forward (line 437) | def forward(self, x): class FFCResnetBlock (line 444) | class FFCResnetBlock(nn.Module): method __init__ (line 445) | def __init__( method forward (line 488) | def forward(self, x): class ConcatTupleLayer (line 509) | class ConcatTupleLayer(nn.Module): method forward (line 510) | def forward(self, x): class FFCResNetGenerator (line 519) | class FFCResNetGenerator(nn.Module): method __init__ (line 520) | def __init__( method forward (line 662) | def forward(self, image, mask): class LaMa (line 666) | class LaMa(nn.Module): method __init__ (line 667) | def __init__(self, state_dict) -> None: method forward (line 690) | def forward(self, img, mask): FILE: ldm_patched/pfn/architecture/OmniSR/ChannelAttention.py class CA_layer (line 6) | class CA_layer(nn.Module): method __init__ (line 7) | def __init__(self, channel, reduction=16): method forward (line 18) | def forward(self, x): class Simple_CA_layer (line 23) | class Simple_CA_layer(nn.Module): method __init__ (line 24) | def __init__(self, channel): method forward (line 37) | def forward(self, x): class ECA_layer (line 41) | class ECA_layer(nn.Module): method __init__ (line 48) | def __init__(self, channel): method forward (line 61) | def forward(self, x): class ECA_MaxPool_layer (line 77) | class ECA_MaxPool_layer(nn.Module): method __init__ (line 84) | def __init__(self, channel): method forward (line 97) | def forward(self, x): FILE: ldm_patched/pfn/architecture/OmniSR/OSA.py function exists (line 24) | def exists(val): function default (line 28) | def default(val, d): function cast_tuple (line 32) | def cast_tuple(val, length=1): class PreNormResidual (line 39) | class PreNormResidual(nn.Module): method __init__ (line 40) | def __init__(self, dim, fn): method forward (line 45) | def forward(self, x): class Conv_PreNormResidual (line 49) | class Conv_PreNormResidual(nn.Module): method __init__ (line 50) | def __init__(self, dim, fn): method forward (line 55) | def forward(self, x): class FeedForward (line 59) | class FeedForward(nn.Module): method __init__ (line 60) | def __init__(self, dim, mult=2, dropout=0.0): method forward (line 71) | def forward(self, x): class Conv_FeedForward (line 75) | class Conv_FeedForward(nn.Module): method __init__ (line 76) | def __init__(self, dim, mult=2, dropout=0.0): method forward (line 87) | def forward(self, x): class Gated_Conv_FeedForward (line 91) | class Gated_Conv_FeedForward(nn.Module): method __init__ (line 92) | def __init__(self, dim, mult=1, bias=False, dropout=0.0): method forward (line 111) | def forward(self, x): class SqueezeExcitation (line 122) | class SqueezeExcitation(nn.Module): method __init__ (line 123) | def __init__(self, dim, shrinkage_rate=0.25): method forward (line 136) | def forward(self, x): class MBConvResidual (line 140) | class MBConvResidual(nn.Module): method __init__ (line 141) | def __init__(self, fn, dropout=0.0): method forward (line 146) | def forward(self, x): class Dropsample (line 152) | class Dropsample(nn.Module): method __init__ (line 153) | def __init__(self, prob=0): method forward (line 157) | def forward(self, x): function MBConv (line 170) | def MBConv( class Attention (line 197) | class Attention(nn.Module): method __init__ (line 198) | def __init__( method forward (line 240) | def forward(self, x): class Block_Attention (line 292) | class Block_Attention(nn.Module): method __init__ (line 293) | def __init__( method forward (line 327) | def forward(self, x): class Channel_Attention (line 377) | class Channel_Attention(nn.Module): method __init__ (line 378) | def __init__(self, dim, heads, bias=False, dropout=0.0, window_size=7): method forward (line 398) | def forward(self, x): class Channel_Attention_grid (line 437) | class Channel_Attention_grid(nn.Module): method __init__ (line 438) | def __init__(self, dim, heads, bias=False, dropout=0.0, window_size=7): method forward (line 458) | def forward(self, x): class OSA_Block (line 497) | class OSA_Block(nn.Module): method __init__ (line 498) | def __init__( method forward (line 575) | def forward(self, x): FILE: ldm_patched/pfn/architecture/OmniSR/OSAG.py class OSAG (line 20) | class OSAG(nn.Module): method __init__ (line 21) | def __init__( method forward (line 57) | def forward(self, x): FILE: ldm_patched/pfn/architecture/OmniSR/OmniSR.py class OmniSR (line 23) | class OmniSR(nn.Module): method __init__ (line 24) | def __init__( method check_image_size (line 122) | def check_image_size(self, x): method forward (line 131) | def forward(self, x): FILE: ldm_patched/pfn/architecture/OmniSR/esa.py function moment (line 20) | def moment(x, dim=(2, 3), k=2): class ESA (line 27) | class ESA(nn.Module): method __init__ (line 35) | def __init__(self, esa_channels, n_feats, conv=nn.Conv2d): method forward (line 46) | def forward(self, x): class LK_ESA (line 60) | class LK_ESA(nn.Module): method __init__ (line 61) | def __init__( method forward (line 111) | def forward(self, x): class LK_ESA_LN (line 123) | class LK_ESA_LN(nn.Module): method __init__ (line 124) | def __init__( method forward (line 176) | def forward(self, x): class AdaGuidedFilter (line 189) | class AdaGuidedFilter(nn.Module): method __init__ (line 190) | def __init__( method box_filter (line 208) | def box_filter(self, x, r): method forward (line 218) | def forward(self, x): class AdaConvGuidedFilter (line 241) | class AdaConvGuidedFilter(nn.Module): method __init__ (line 242) | def __init__( method forward (line 283) | def forward(self, x): FILE: ldm_patched/pfn/architecture/OmniSR/layernorm.py class LayerNormFunction (line 17) | class LayerNormFunction(torch.autograd.Function): method forward (line 19) | def forward(ctx, x, weight, bias, eps): method backward (line 30) | def backward(ctx, grad_output): class LayerNorm2d (line 48) | class LayerNorm2d(nn.Module): method __init__ (line 49) | def __init__(self, channels, eps=1e-6): method forward (line 55) | def forward(self, x): class GRN (line 59) | class GRN(nn.Module): method __init__ (line 62) | def __init__(self, dim): method forward (line 67) | def forward(self, x): FILE: ldm_patched/pfn/architecture/OmniSR/pixelshuffle.py function pixelshuffle_block (line 16) | def pixelshuffle_block( FILE: ldm_patched/pfn/architecture/RRDB.py class RRDBNet (line 18) | class RRDBNet(nn.Module): method __init__ (line 19) | def __init__( method new_to_old_arch (line 196) | def new_to_old_arch(self, state): method get_scale (line 259) | def get_scale(self, min_part: int = 6) -> int: method get_num_blocks (line 269) | def get_num_blocks(self) -> int: method forward (line 283) | def forward(self, x): FILE: ldm_patched/pfn/architecture/SCUNet.py class WMSA (line 19) | class WMSA(nn.Module): method __init__ (line 22) | def __init__(self, input_dim, output_dim, head_dim, window_size, type): method generate_mask (line 53) | def generate_mask(self, h, w, p, shift): method forward (line 84) | def forward(self, x): method relative_embedding (line 150) | def relative_embedding(self): class Block (line 167) | class Block(nn.Module): method __init__ (line 168) | def __init__( method forward (line 197) | def forward(self, x): class ConvTransBlock (line 203) | class ConvTransBlock(nn.Module): method __init__ (line 204) | def __init__( method forward (line 260) | def forward(self, x): class SCUNet (line 274) | class SCUNet(nn.Module): method __init__ (line 275) | def __init__( method check_image_size (line 424) | def check_image_size(self, x): method forward (line 431) | def forward(self, x0): method _init_weights (line 448) | def _init_weights(self, m): FILE: ldm_patched/pfn/architecture/SPSR.py class Get_gradient_nopadding (line 13) | class Get_gradient_nopadding(nn.Module): method __init__ (line 14) | def __init__(self): method forward (line 24) | def forward(self, x): class SPSRNet (line 38) | class SPSRNet(nn.Module): method __init__ (line 39) | def __init__( method get_scale (line 297) | def get_scale(self, min_part: int = 4) -> int: method get_num_blocks (line 307) | def get_num_blocks(self) -> int: method forward (line 316) | def forward(self, x): FILE: ldm_patched/pfn/architecture/SRVGG.py class SRVGGNetCompact (line 10) | class SRVGGNetCompact(nn.Module): method __init__ (line 23) | def __init__( method get_num_conv (line 83) | def get_num_conv(self) -> int: method get_num_feats (line 86) | def get_num_feats(self) -> int: method get_in_nc (line 89) | def get_in_nc(self) -> int: method get_scale (line 92) | def get_scale(self) -> int: method forward (line 105) | def forward(self, x): FILE: ldm_patched/pfn/architecture/SwiftSRGAN.py class SeperableConv2d (line 7) | class SeperableConv2d(nn.Module): method __init__ (line 8) | def __init__( method forward (line 23) | def forward(self, x): class ConvBlock (line 27) | class ConvBlock(nn.Module): method __init__ (line 28) | def __init__( method forward (line 48) | def forward(self, x): class UpsampleBlock (line 52) | class UpsampleBlock(nn.Module): method __init__ (line 53) | def __init__(self, in_channels, scale_factor): method forward (line 68) | def forward(self, x): class ResidualBlock (line 72) | class ResidualBlock(nn.Module): method __init__ (line 73) | def __init__(self, in_channels): method forward (line 83) | def forward(self, x): class Generator (line 89) | class Generator(nn.Module): method __init__ (line 100) | def __init__( method forward (line 156) | def forward(self, x): FILE: ldm_patched/pfn/architecture/Swin2SR.py class Mlp (line 23) | class Mlp(nn.Module): method __init__ (line 24) | def __init__( method forward (line 40) | def forward(self, x): function window_partition (line 49) | def window_partition(x, window_size): function window_reverse (line 65) | def window_reverse(windows, window_size, H, W): class WindowAttention (line 83) | class WindowAttention(nn.Module): method __init__ (line 96) | def __init__( method forward (line 178) | def forward(self, x, mask=None): method extra_repr (line 235) | def extra_repr(self) -> str: method flops (line 241) | def flops(self, N): class SwinTransformerBlock (line 255) | class SwinTransformerBlock(nn.Module): method __init__ (line 273) | def __init__( method calculate_mask (line 332) | def calculate_mask(self, x_size): method forward (line 363) | def forward(self, x, x_size): method extra_repr (line 416) | def extra_repr(self) -> str: method flops (line 422) | def flops(self): class PatchMerging (line 437) | class PatchMerging(nn.Module): method __init__ (line 445) | def __init__(self, input_resolution, dim, norm_layer=nn.LayerNorm): method forward (line 452) | def forward(self, x): method extra_repr (line 475) | def extra_repr(self) -> str: method flops (line 478) | def flops(self): class BasicLayer (line 485) | class BasicLayer(nn.Module): method __init__ (line 504) | def __init__( method forward (line 558) | def forward(self, x, x_size): method extra_repr (line 568) | def extra_repr(self) -> str: method flops (line 571) | def flops(self): method _init_respostnorm (line 579) | def _init_respostnorm(self): class PatchEmbed (line 587) | class PatchEmbed(nn.Module): method __init__ (line 597) | def __init__( method forward (line 620) | def forward(self, x): method flops (line 630) | def flops(self): class RSTB (line 638) | class RSTB(nn.Module): method __init__ (line 660) | def __init__( method forward (line 728) | def forward(self, x, x_size): method flops (line 736) | def flops(self): class PatchUnEmbed (line 747) | class PatchUnEmbed(nn.Module): method __init__ (line 758) | def __init__( method forward (line 773) | def forward(self, x, x_size): method flops (line 778) | def flops(self): class Upsample (line 783) | class Upsample(nn.Sequential): method __init__ (line 791) | def __init__(self, scale, num_feat): class Upsample_hf (line 807) | class Upsample_hf(nn.Sequential): method __init__ (line 815) | def __init__(self, scale, num_feat): class UpsampleOneStep (line 831) | class UpsampleOneStep(nn.Sequential): method __init__ (line 841) | def __init__(self, scale, num_feat, num_out_ch, input_resolution=None): method flops (line 849) | def flops(self): class Swin2SR (line 855) | class Swin2SR(nn.Module): method __init__ (line 882) | def __init__( method _init_weights (line 1229) | def _init_weights(self, m): method no_weight_decay (line 1239) | def no_weight_decay(self): method no_weight_decay_keywords (line 1243) | def no_weight_decay_keywords(self): method check_image_size (line 1246) | def check_image_size(self, x): method forward_features (line 1253) | def forward_features(self, x): method forward_features_hf (line 1268) | def forward_features_hf(self, x): method forward (line 1283) | def forward(self, x): method flops (line 1368) | def flops(self): FILE: ldm_patched/pfn/architecture/SwinIR.py class Mlp (line 21) | class Mlp(nn.Module): method __init__ (line 22) | def __init__( method forward (line 38) | def forward(self, x): function window_partition (line 47) | def window_partition(x, window_size): function window_reverse (line 64) | def window_reverse(windows, window_size, H, W): class WindowAttention (line 83) | class WindowAttention(nn.Module): method __init__ (line 97) | def __init__( method forward (line 145) | def forward(self, x, mask=None): method extra_repr (line 195) | def extra_repr(self) -> str: method flops (line 198) | def flops(self, N): class SwinTransformerBlock (line 212) | class SwinTransformerBlock(nn.Module): method __init__ (line 231) | def __init__( method calculate_mask (line 290) | def calculate_mask(self, x_size): method forward (line 321) | def forward(self, x, x_size): method extra_repr (line 375) | def extra_repr(self) -> str: method flops (line 381) | def flops(self): class PatchMerging (line 396) | class PatchMerging(nn.Module): method __init__ (line 405) | def __init__(self, input_resolution, dim, norm_layer=nn.LayerNorm): method forward (line 412) | def forward(self, x): method extra_repr (line 435) | def extra_repr(self) -> str: method flops (line 438) | def flops(self): class BasicLayer (line 445) | class BasicLayer(nn.Module): method __init__ (line 465) | def __init__( method forward (line 519) | def forward(self, x, x_size): method extra_repr (line 529) | def extra_repr(self) -> str: method flops (line 532) | def flops(self): class RSTB (line 541) | class RSTB(nn.Module): method __init__ (line 564) | def __init__( method forward (line 634) | def forward(self, x, x_size): method flops (line 642) | def flops(self): class PatchEmbed (line 653) | class PatchEmbed(nn.Module): method __init__ (line 664) | def __init__( method forward (line 687) | def forward(self, x): method flops (line 693) | def flops(self): class PatchUnEmbed (line 701) | class PatchUnEmbed(nn.Module): method __init__ (line 712) | def __init__( method forward (line 730) | def forward(self, x, x_size): method flops (line 735) | def flops(self): class Upsample (line 740) | class Upsample(nn.Sequential): method __init__ (line 748) | def __init__(self, scale, num_feat): class UpsampleOneStep (line 764) | class UpsampleOneStep(nn.Sequential): method __init__ (line 774) | def __init__(self, scale, num_feat, num_out_ch, input_resolution=None): method flops (line 782) | def flops(self): class SwinIR (line 788) | class SwinIR(nn.Module): method __init__ (line 816) | def __init__( method _init_weights (line 1123) | def _init_weights(self, m): method no_weight_decay (line 1133) | def no_weight_decay(self): method no_weight_decay_keywords (line 1137) | def no_weight_decay_keywords(self): method check_image_size (line 1140) | def check_image_size(self, x): method forward_features (line 1147) | def forward_features(self, x): method forward (line 1162) | def forward(self, x): method flops (line 1215) | def flops(self): FILE: ldm_patched/pfn/architecture/block.py function act (line 20) | def act(act_type: str, inplace=True, neg_slope=0.2, n_prelu=1): function norm (line 38) | def norm(norm_type: str, nc: int): function pad (line 52) | def pad(pad_type: str, padding): function get_valid_padding (line 69) | def get_valid_padding(kernel_size, dilation): class ConcatBlock (line 75) | class ConcatBlock(nn.Module): method __init__ (line 77) | def __init__(self, submodule): method forward (line 81) | def forward(self, x): method __repr__ (line 85) | def __repr__(self): class ShortcutBlock (line 92) | class ShortcutBlock(nn.Module): method __init__ (line 94) | def __init__(self, submodule): method forward (line 98) | def forward(self, x): method __repr__ (line 102) | def __repr__(self): class ShortcutBlockSPSR (line 109) | class ShortcutBlockSPSR(nn.Module): method __init__ (line 111) | def __init__(self, submodule): method forward (line 115) | def forward(self, x): method __repr__ (line 118) | def __repr__(self): function sequential (line 125) | def sequential(*args): function conv_block_2c2 (line 145) | def conv_block_2c2( function conv_block (line 157) | def conv_block( class ResNetBlock (line 217) | class ResNetBlock(nn.Module): method __init__ (line 224) | def __init__( method forward (line 281) | def forward(self, x): class RRDB (line 286) | class RRDB(nn.Module): method __init__ (line 292) | def __init__( method forward (line 349) | def forward(self, x): class ResidualDenseBlock_5C (line 356) | class ResidualDenseBlock_5C(nn.Module): method __init__ (line 378) | def __init__( method forward (line 463) | def forward(self, x): function conv1x1 (line 477) | def conv1x1(in_planes, out_planes, stride=1): function pixelshuffle_block (line 486) | def pixelshuffle_block( function upconv_block (line 519) | def upconv_block( FILE: ldm_patched/pfn/architecture/face/arcface_arch.py function conv3x3 (line 4) | def conv3x3(inplanes, outplanes, stride=1): class BasicBlock (line 17) | class BasicBlock(nn.Module): method __init__ (line 29) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 39) | def forward(self, x): class IRBlock (line 58) | class IRBlock(nn.Module): method __init__ (line 71) | def __init__(self, inplanes, planes, stride=1, downsample=None, use_se... method forward (line 85) | def forward(self, x): class Bottleneck (line 106) | class Bottleneck(nn.Module): method __init__ (line 118) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 134) | def forward(self, x): class SEBlock (line 157) | class SEBlock(nn.Module): method __init__ (line 165) | def __init__(self, channel, reduction=16): method forward (line 177) | def forward(self, x): class ResNetArcFace (line 184) | class ResNetArcFace(nn.Module): method __init__ (line 195) | def __init__(self, block, layers, use_se=True): method _make_layer (line 226) | def _make_layer(self, block, planes, num_blocks, stride=1): method forward (line 249) | def forward(self, x): FILE: ldm_patched/pfn/architecture/face/codeformer.py class VectorQuantizer (line 17) | class VectorQuantizer(nn.Module): method __init__ (line 18) | def __init__(self, codebook_size, emb_dim, beta): method forward (line 28) | def forward(self, z): method get_codebook_feat (line 81) | def get_codebook_feat(self, indices, shape): class GumbelQuantizer (line 96) | class GumbelQuantizer(nn.Module): method __init__ (line 97) | def __init__( method forward (line 117) | def forward(self, z): class Downsample (line 137) | class Downsample(nn.Module): method __init__ (line 138) | def __init__(self, in_channels): method forward (line 144) | def forward(self, x): class Upsample (line 151) | class Upsample(nn.Module): method __init__ (line 152) | def __init__(self, in_channels): method forward (line 158) | def forward(self, x): class AttnBlock (line 165) | class AttnBlock(nn.Module): method __init__ (line 166) | def __init__(self, in_channels): method forward (line 184) | def forward(self, x): class Encoder (line 211) | class Encoder(nn.Module): method __init__ (line 212) | def __init__( method forward (line 262) | def forward(self, x): class Generator (line 269) | class Generator(nn.Module): method __init__ (line 270) | def __init__(self, nf, ch_mult, res_blocks, img_size, attn_resolutions... method forward (line 317) | def forward(self, x): class VQAutoEncoder (line 324) | class VQAutoEncoder(nn.Module): method __init__ (line 325) | def __init__( method forward (line 394) | def forward(self, x): function calc_mean_std (line 401) | def calc_mean_std(feat, eps=1e-5): function adaptive_instance_normalization (line 417) | def adaptive_instance_normalization(content_feat, style_feat): class PositionEmbeddingSine (line 434) | class PositionEmbeddingSine(nn.Module): method __init__ (line 440) | def __init__( method forward (line 453) | def forward(self, x, mask=None): function _get_activation_fn (line 481) | def _get_activation_fn(activation): class TransformerSALayer (line 492) | class TransformerSALayer(nn.Module): method __init__ (line 493) | def __init__( method with_pos_embed (line 510) | def with_pos_embed(self, tensor, pos: Optional[Tensor]): method forward (line 513) | def forward( function normalize (line 535) | def normalize(in_channels): function swish (line 542) | def swish(x): class ResBlock (line 546) | class ResBlock(nn.Module): method __init__ (line 547) | def __init__(self, in_channels, out_channels=None): method forward (line 564) | def forward(self, x_in): class Fuse_sft_block (line 578) | class Fuse_sft_block(nn.Module): method __init__ (line 579) | def __init__(self, in_ch, out_ch): method forward (line 595) | def forward(self, enc_feat, dec_feat, w=1): class CodeFormer (line 604) | class CodeFormer(VQAutoEncoder): method __init__ (line 605) | def __init__(self, state_dict): method _init_weights (line 716) | def _init_weights(self, module): method forward (line 725) | def forward(self, x, weight=0.5, **kwargs): FILE: ldm_patched/pfn/architecture/face/fused_act.py class FusedLeakyReLUFunctionBackward (line 12) | class FusedLeakyReLUFunctionBackward(Function): method forward (line 14) | def forward(ctx, grad_output, out, negative_slope, scale): method backward (line 35) | def backward(ctx, gradgrad_input, gradgrad_bias): class FusedLeakyReLUFunction (line 44) | class FusedLeakyReLUFunction(Function): method forward (line 46) | def forward(ctx, input, bias, negative_slope, scale): method backward (line 58) | def backward(ctx, grad_output): class FusedLeakyReLU (line 68) | class FusedLeakyReLU(nn.Module): method __init__ (line 69) | def __init__(self, channel, negative_slope=0.2, scale=2**0.5): method forward (line 76) | def forward(self, input): function fused_leaky_relu (line 80) | def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2**0.5): FILE: ldm_patched/pfn/architecture/face/gfpgan_bilinear_arch.py class StyleGAN2GeneratorBilinearSFT (line 20) | class StyleGAN2GeneratorBilinearSFT(StyleGAN2GeneratorBilinear): method __init__ (line 34) | def __init__( method forward (line 54) | def forward( class GFPGANBilinear (line 152) | class GFPGANBilinear(nn.Module): method __init__ (line 171) | def __init__( method forward (line 340) | def forward(self, x, return_latents=False, return_rgb=True, randomize_... FILE: ldm_patched/pfn/architecture/face/gfpganv1_arch.py class StyleGAN2GeneratorSFT (line 21) | class StyleGAN2GeneratorSFT(StyleGAN2Generator): method __init__ (line 35) | def __init__( method forward (line 57) | def forward( class ConvUpLayer (line 155) | class ConvUpLayer(nn.Module): method __init__ (line 168) | def __init__( method forward (line 206) | def forward(self, x): class ResUpBlock (line 223) | class ResUpBlock(nn.Module): method __init__ (line 230) | def __init__(self, in_channels, out_channels): method forward (line 241) | def forward(self, x): class GFPGANv1 (line 249) | class GFPGANv1(nn.Module): method __init__ (line 268) | def __init__( method forward (line 440) | def forward( class FacialComponentDiscriminator (line 494) | class FacialComponentDiscriminator(nn.Module): method __init__ (line 497) | def __init__(self): method forward (line 547) | def forward(self, x, return_feats=False, **kwargs): FILE: ldm_patched/pfn/architecture/face/gfpganv1_clean_arch.py class StyleGAN2GeneratorCSFT (line 13) | class StyleGAN2GeneratorCSFT(StyleGAN2GeneratorClean): method __init__ (line 25) | def __init__( method forward (line 43) | def forward( class ResBlock (line 141) | class ResBlock(nn.Module): method __init__ (line 149) | def __init__(self, in_channels, out_channels, mode="down"): method forward (line 160) | def forward(self, x): class GFPGANv1Clean (line 176) | class GFPGANv1Clean(nn.Module): method __init__ (line 193) | def __init__( method forward (line 320) | def forward( FILE: ldm_patched/pfn/architecture/face/restoreformer_arch.py class VectorQuantizer (line 11) | class VectorQuantizer(nn.Module): method __init__ (line 23) | def __init__(self, n_e, e_dim, beta): method forward (line 32) | def forward(self, z): method get_codebook_entry (line 96) | def get_codebook_entry(self, indices, shape): function nonlinearity (line 115) | def nonlinearity(x): function Normalize (line 120) | def Normalize(in_channels): class Upsample (line 126) | class Upsample(nn.Module): method __init__ (line 127) | def __init__(self, in_channels, with_conv): method forward (line 135) | def forward(self, x): class Downsample (line 142) | class Downsample(nn.Module): method __init__ (line 143) | def __init__(self, in_channels, with_conv): method forward (line 152) | def forward(self, x): class ResnetBlock (line 162) | class ResnetBlock(nn.Module): method __init__ (line 163) | def __init__( method forward (line 199) | def forward(self, x, temb): class MultiHeadAttnBlock (line 222) | class MultiHeadAttnBlock(nn.Module): method __init__ (line 223) | def __init__(self, in_channels, head_size=1): method forward (line 249) | def forward(self, x, y=None): class MultiHeadEncoder (line 292) | class MultiHeadEncoder(nn.Module): method __init__ (line 293) | def __init__( method forward (line 379) | def forward(self, x): class MultiHeadDecoder (line 417) | class MultiHeadDecoder(nn.Module): method __init__ (line 418) | def __init__( method forward (line 509) | def forward(self, z): class MultiHeadDecoderTransformer (line 544) | class MultiHeadDecoderTransformer(nn.Module): method __init__ (line 545) | def __init__( method forward (line 636) | def forward(self, z, hs): class RestoreFormer (line 674) | class RestoreFormer(nn.Module): method __init__ (line 675) | def __init__( method encode (line 760) | def encode(self, x): method decode (line 766) | def decode(self, quant, hs): method forward (line 772) | def forward(self, input, **kwargs): FILE: ldm_patched/pfn/architecture/face/stylegan2_arch.py class NormStyleCode (line 14) | class NormStyleCode(nn.Module): method forward (line 15) | def forward(self, x): function make_resample_kernel (line 27) | def make_resample_kernel(k): class UpFirDnUpsample (line 44) | class UpFirDnUpsample(nn.Module): method __init__ (line 57) | def __init__(self, resample_kernel, factor=2): method forward (line 65) | def forward(self, x): method __repr__ (line 69) | def __repr__(self): class UpFirDnDownsample (line 73) | class UpFirDnDownsample(nn.Module): method __init__ (line 82) | def __init__(self, resample_kernel, factor=2): method forward (line 90) | def forward(self, x): method __repr__ (line 94) | def __repr__(self): class UpFirDnSmooth (line 98) | class UpFirDnSmooth(nn.Module): method __init__ (line 109) | def __init__( method forward (line 128) | def forward(self, x): method __repr__ (line 132) | def __repr__(self): class EqualLinear (line 139) | class EqualLinear(nn.Module): method __init__ (line 153) | def __init__( method forward (line 180) | def forward(self, x): method __repr__ (line 192) | def __repr__(self): class ModulatedConv2d (line 199) | class ModulatedConv2d(nn.Module): method __init__ (line 219) | def __init__( method forward (line 276) | def forward(self, x, style): method __repr__ (line 324) | def __repr__(self): class StyleConv (line 333) | class StyleConv(nn.Module): method __init__ (line 348) | def __init__( method forward (line 371) | def forward(self, x, style, noise=None): class ToRGB (line 384) | class ToRGB(nn.Module): method __init__ (line 395) | def __init__( method forward (line 413) | def forward(self, x, style, skip=None): class ConstantInput (line 433) | class ConstantInput(nn.Module): method __init__ (line 441) | def __init__(self, num_channel, size): method forward (line 445) | def forward(self, batch): class StyleGAN2Generator (line 450) | class StyleGAN2Generator(nn.Module): method __init__ (line 466) | def __init__( method make_noise (line 572) | def make_noise(self): method get_latent (line 583) | def get_latent(self, x): method mean_latent (line 586) | def mean_latent(self, num_latent): method forward (line 593) | def forward( class ScaledLeakyReLU (line 683) | class ScaledLeakyReLU(nn.Module): method __init__ (line 690) | def __init__(self, negative_slope=0.2): method forward (line 694) | def forward(self, x): class EqualConv2d (line 699) | class EqualConv2d(nn.Module): method __init__ (line 714) | def __init__( method forward (line 740) | def forward(self, x): method __repr__ (line 751) | def __repr__(self): class ConvLayer (line 761) | class ConvLayer(nn.Sequential): method __init__ (line 778) | def __init__( class ResBlock (line 825) | class ResBlock(nn.Module): method __init__ (line 837) | def __init__(self, in_channels, out_channels, resample_kernel=(1, 3, 3... method forward (line 860) | def forward(self, x): FILE: ldm_patched/pfn/architecture/face/stylegan2_bilinear_arch.py class NormStyleCode (line 13) | class NormStyleCode(nn.Module): method forward (line 14) | def forward(self, x): class EqualLinear (line 24) | class EqualLinear(nn.Module): method __init__ (line 37) | def __init__( method forward (line 64) | def forward(self, x): method __repr__ (line 76) | def __repr__(self): class ModulatedConv2d (line 83) | class ModulatedConv2d(nn.Module): method __init__ (line 99) | def __init__( method forward (line 139) | def forward(self, x, style): method __repr__ (line 184) | def __repr__(self): class StyleConv (line 193) | class StyleConv(nn.Module): method __init__ (line 205) | def __init__( method forward (line 228) | def forward(self, x, style, noise=None): class ToRGB (line 241) | class ToRGB(nn.Module): method __init__ (line 249) | def __init__( method forward (line 270) | def forward(self, x, style, skip=None): class ConstantInput (line 293) | class ConstantInput(nn.Module): method __init__ (line 300) | def __init__(self, num_channel, size): method forward (line 304) | def forward(self, batch): class StyleGAN2GeneratorBilinear (line 309) | class StyleGAN2GeneratorBilinear(nn.Module): method __init__ (line 321) | def __init__( method make_noise (line 427) | def make_noise(self): method get_latent (line 438) | def get_latent(self, x): method mean_latent (line 441) | def mean_latent(self, num_latent): method forward (line 448) | def forward( class ScaledLeakyReLU (line 537) | class ScaledLeakyReLU(nn.Module): method __init__ (line 543) | def __init__(self, negative_slope=0.2): method forward (line 547) | def forward(self, x): class EqualConv2d (line 552) | class EqualConv2d(nn.Module): method __init__ (line 566) | def __init__( method forward (line 592) | def forward(self, x): method __repr__ (line 603) | def __repr__(self): class ConvLayer (line 613) | class ConvLayer(nn.Sequential): method __init__ (line 625) | def __init__( class ResBlock (line 674) | class ResBlock(nn.Module): method __init__ (line 681) | def __init__(self, in_channels, out_channels, interpolation_mode="bili... method forward (line 704) | def forward(self, x): FILE: ldm_patched/pfn/architecture/face/stylegan2_clean_arch.py function default_init_weights (line 13) | def default_init_weights(module_list, scale=1, bias_fill=0, **kwargs): class NormStyleCode (line 42) | class NormStyleCode(nn.Module): method forward (line 43) | def forward(self, x): class ModulatedConv2d (line 53) | class ModulatedConv2d(nn.Module): method __init__ (line 66) | def __init__( method forward (line 102) | def forward(self, x, style): method __repr__ (line 138) | def __repr__(self): class StyleConv (line 145) | class StyleConv(nn.Module): method __init__ (line 156) | def __init__( method forward (line 178) | def forward(self, x, style, noise=None): class ToRGB (line 193) | class ToRGB(nn.Module): method __init__ (line 201) | def __init__(self, in_channels, num_style_feat, upsample=True): method forward (line 214) | def forward(self, x, style, skip=None): class ConstantInput (line 234) | class ConstantInput(nn.Module): method __init__ (line 241) | def __init__(self, num_channel, size): method forward (line 245) | def forward(self, batch): class StyleGAN2GeneratorClean (line 250) | class StyleGAN2GeneratorClean(nn.Module): method __init__ (line 260) | def __init__( method make_noise (line 350) | def make_noise(self): method get_latent (line 361) | def get_latent(self, x): method mean_latent (line 364) | def mean_latent(self, num_latent): method forward (line 371) | def forward( FILE: ldm_patched/pfn/architecture/face/upfirdn2d.py class UpFirDn2dBackward (line 14) | class UpFirDn2dBackward(Function): method forward (line 16) | def forward( method backward (line 57) | def backward(ctx, gradgrad_input): class UpFirDn2d (line 83) | class UpFirDn2d(Function): method forward (line 85) | def forward(ctx, input, kernel, up, down, pad): method backward (line 122) | def backward(ctx, grad_output): function upfirdn2d (line 140) | def upfirdn2d(input, kernel, up=1, down=1, pad=(0, 0)): function upfirdn2d_native (line 153) | def upfirdn2d_native( FILE: ldm_patched/pfn/architecture/timm/drop.py function drop_block_2d (line 22) | def drop_block_2d( function drop_block_fast_2d (line 91) | def drop_block_fast_2d( class DropBlock2d (line 141) | class DropBlock2d(nn.Module): method __init__ (line 144) | def __init__( method forward (line 163) | def forward(self, x): function drop_path (line 187) | def drop_path( class DropPath (line 211) | class DropPath(nn.Module): method __init__ (line 214) | def __init__(self, drop_prob: float = 0.0, scale_by_keep: bool = True): method forward (line 219) | def forward(self, x): method extra_repr (line 222) | def extra_repr(self): FILE: ldm_patched/pfn/architecture/timm/helpers.py function _ntuple (line 9) | def _ntuple(n): function make_divisible (line 25) | def make_divisible(v, divisor=8, min_value=None, round_limit=0.9): FILE: ldm_patched/pfn/architecture/timm/weight_init.py function _no_grad_trunc_normal_ (line 8) | def _no_grad_trunc_normal_(tensor, mean, std, a, b): function trunc_normal_ (line 46) | def trunc_normal_( function trunc_normal_tf_ (line 73) | def trunc_normal_tf_( function variance_scaling_ (line 103) | def variance_scaling_(tensor, scale=1.0, mode="fan_in", distribution="no... function lecun_normal_ (line 127) | def lecun_normal_(tensor): FILE: ldm_patched/pfn/model_loading.py class UnsupportedModel (line 20) | class UnsupportedModel(Exception): function load_state_dict (line 24) | def load_state_dict(state_dict) -> PyTorchModel: FILE: ldm_patched/pfn/types.py function is_pytorch_sr_model (line 44) | def is_pytorch_sr_model(model: object): function is_pytorch_face_model (line 52) | def is_pytorch_face_model(model: object): function is_pytorch_inpaint_model (line 60) | def is_pytorch_inpaint_model(model: object): function is_pytorch_model (line 68) | def is_pytorch_model(model: object): FILE: ldm_patched/t2ia/adapter.py function conv_nd (line 7) | def conv_nd(dims, *args, **kwargs): function avg_pool_nd (line 20) | def avg_pool_nd(dims, *args, **kwargs): class Downsample (line 33) | class Downsample(nn.Module): method __init__ (line 42) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 57) | def forward(self, x): class ResnetBlock (line 67) | class ResnetBlock(nn.Module): method __init__ (line 68) | def __init__(self, in_c, out_c, down, ksize=3, sk=False, use_conv=True): method forward (line 88) | def forward(self, x): class Adapter (line 103) | class Adapter(nn.Module): method __init__ (line 104) | def __init__(self, channels=[320, 640, 1280, 1280], nums_rb=3, cin=64,... method forward (line 134) | def forward(self, x): class LayerNorm (line 159) | class LayerNorm(nn.LayerNorm): method forward (line 162) | def forward(self, x: torch.Tensor): class QuickGELU (line 168) | class QuickGELU(nn.Module): method forward (line 170) | def forward(self, x: torch.Tensor): class ResidualAttentionBlock (line 174) | class ResidualAttentionBlock(nn.Module): method __init__ (line 176) | def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor ... method attention (line 187) | def attention(self, x: torch.Tensor): method forward (line 191) | def forward(self, x: torch.Tensor): class StyleAdapter (line 197) | class StyleAdapter(nn.Module): method __init__ (line 199) | def __init__(self, width=1024, context_dim=768, num_head=8, n_layes=3,... method forward (line 210) | def forward(self, x): class ResnetBlock_light (line 226) | class ResnetBlock_light(nn.Module): method __init__ (line 227) | def __init__(self, in_c): method forward (line 233) | def forward(self, x): class extractor (line 241) | class extractor(nn.Module): method __init__ (line 242) | def __init__(self, in_c, inter_c, out_c, nums_rb, down=False): method forward (line 254) | def forward(self, x): class Adapter_light (line 264) | class Adapter_light(nn.Module): method __init__ (line 265) | def __init__(self, channels=[320, 640, 1280, 1280], nums_rb=3, cin=64): method forward (line 282) | def forward(self, x): FILE: ldm_patched/taesd/taesd.py function conv (line 12) | def conv(n_in, n_out, **kwargs): class Clamp (line 15) | class Clamp(nn.Module): method forward (line 16) | def forward(self, x): class Block (line 19) | class Block(nn.Module): method __init__ (line 20) | def __init__(self, n_in, n_out): method forward (line 25) | def forward(self, x): function Encoder (line 28) | def Encoder(): function Decoder (line 37) | def Decoder(): class TAESD (line 46) | class TAESD(nn.Module): method __init__ (line 50) | def __init__(self, encoder_path=None, decoder_path=None): method scale_latents (line 62) | def scale_latents(x): method unscale_latents (line 67) | def unscale_latents(x): method decode (line 71) | def decode(self, x): method encode (line 76) | def encode(self, x): FILE: ldm_patched/unipc/uni_pc.py class NoiseScheduleVP (line 10) | class NoiseScheduleVP: method __init__ (line 11) | def __init__( method marginal_log_mean_coeff (line 129) | def marginal_log_mean_coeff(self, t): method marginal_alpha (line 142) | def marginal_alpha(self, t): method marginal_std (line 148) | def marginal_std(self, t): method marginal_lambda (line 154) | def marginal_lambda(self, t): method inverse_lambda (line 162) | def inverse_lambda(self, lamb): function model_wrapper (line 181) | def model_wrapper( class UniPC (line 352) | class UniPC: method __init__ (line 353) | def __init__( method dynamic_thresholding_fn (line 379) | def dynamic_thresholding_fn(self, x0, t=None): method noise_prediction_fn (line 390) | def noise_prediction_fn(self, x, t): method data_prediction_fn (line 399) | def data_prediction_fn(self, x, t): method model_fn (line 416) | def model_fn(self, x, t): method get_time_steps (line 425) | def get_time_steps(self, skip_type, t_T, t_0, N, device): method get_orders_and_timesteps_for_singlestep_solver (line 442) | def get_orders_and_timesteps_for_singlestep_solver(self, steps, order,... method denoise_to_zero_fn (line 473) | def denoise_to_zero_fn(self, x, s): method multistep_uni_pc_update (line 479) | def multistep_uni_pc_update(self, x, model_prev_list, t_prev_list, t, ... method multistep_uni_pc_vary_update (line 488) | def multistep_uni_pc_vary_update(self, x, model_prev_list, t_prev_list... method multistep_uni_pc_bh_update (line 591) | def multistep_uni_pc_bh_update(self, x, model_prev_list, t_prev_list, ... method sample (line 712) | def sample(self, x, timesteps, t_start=None, t_end=None, order=3, skip... function interpolate_fn (line 781) | def interpolate_fn(x, xp, yp): function expand_dims (line 823) | def expand_dims(v, dims): class SigmaConvert (line 836) | class SigmaConvert: method marginal_log_mean_coeff (line 838) | def marginal_log_mean_coeff(self, sigma): method marginal_alpha (line 841) | def marginal_alpha(self, t): method marginal_std (line 844) | def marginal_std(self, t): method marginal_lambda (line 847) | def marginal_lambda(self, t): function predict_eps_sigma (line 855) | def predict_eps_sigma(model, input, sigma_in, **kwargs): function sample_unipc (line 861) | def sample_unipc(model, noise, image, sigmas, max_denoise, extra_args=No... FILE: ldm_patched/utils/latent_visualization.py class LatentPreviewer (line 12) | class LatentPreviewer: method decode_latent_to_preview (line 13) | def decode_latent_to_preview(self, x0): method decode_latent_to_preview_image (line 16) | def decode_latent_to_preview_image(self, preview_format, x0): class TAESDPreviewerImpl (line 20) | class TAESDPreviewerImpl(LatentPreviewer): method __init__ (line 21) | def __init__(self, taesd): method decode_latent_to_preview (line 24) | def decode_latent_to_preview(self, x0): class Latent2RGBPreviewer (line 34) | class Latent2RGBPreviewer(LatentPreviewer): method __init__ (line 35) | def __init__(self, latent_rgb_factors): method decode_latent_to_preview (line 38) | def decode_latent_to_preview(self, x0): function get_previewer (line 49) | def get_previewer(device, latent_format): function prepare_callback (line 80) | def prepare_callback(model, steps, x0_output_dict=None): FILE: ldm_patched/utils/path_utils.py function set_output_directory (line 49) | def set_output_directory(output_dir): function set_temp_directory (line 53) | def set_temp_directory(temp_dir): function set_input_directory (line 57) | def set_input_directory(input_dir): function get_output_directory (line 61) | def get_output_directory(): function get_temp_directory (line 65) | def get_temp_directory(): function get_input_directory (line 69) | def get_input_directory(): function get_directory_by_type (line 75) | def get_directory_by_type(type_name): function annotated_filepath (line 87) | def annotated_filepath(name): function get_annotated_filepath (line 103) | def get_annotated_filepath(name, default_dir=None): function exists_annotated_filepath (line 115) | def exists_annotated_filepath(name): function add_model_folder_path (line 125) | def add_model_folder_path(folder_name, full_folder_path): function get_folder_paths (line 132) | def get_folder_paths(folder_name): function recursive_search (line 135) | def recursive_search(directory, excluded_dir_names=None): function filter_files_extensions (line 166) | def filter_files_extensions(files, extensions): function get_full_path (line 171) | def get_full_path(folder_name, filename): function get_filename_list_ (line 184) | def get_filename_list_(folder_name): function cached_filename_list_ (line 196) | def cached_filename_list_(folder_name): function get_filename_list (line 217) | def get_filename_list(folder_name): function get_save_image_path (line 225) | def get_save_image_path(filename_prefix, output_dir, image_width=0, imag... FILE: modules/anisotropic.py function _compute_zero_padding (line 10) | def _compute_zero_padding(kernel_size: tuple[int, int] | int) -> tuple[i... function _unpack_2d_ks (line 15) | def _unpack_2d_ks(kernel_size: tuple[int, int] | int) -> tuple[int, int]: function gaussian (line 27) | def gaussian( function get_gaussian_kernel1d (line 43) | def get_gaussian_kernel1d( function get_gaussian_kernel2d (line 55) | def get_gaussian_kernel2d( function _bilateral_blur (line 75) | def _bilateral_blur( function bilateral_blur (line 118) | def bilateral_blur( function adaptive_anisotropic_filter (line 129) | def adaptive_anisotropic_filter(x, g=None): function joint_bilateral_blur (line 144) | def joint_bilateral_blur( class _BilateralBlur (line 156) | class _BilateralBlur(torch.nn.Module): method __init__ (line 157) | def __init__( method __repr__ (line 172) | def __repr__(self) -> str: class BilateralBlur (line 183) | class BilateralBlur(_BilateralBlur): method forward (line 184) | def forward(self, input: Tensor) -> Tensor: class JointBilateralBlur (line 190) | class JointBilateralBlur(_BilateralBlur): method forward (line 191) | def forward(self, input: Tensor, guidance: Tensor) -> Tensor: FILE: modules/async_worker.py class AsyncTask (line 10) | class AsyncTask: method __init__ (line 11) | def __init__(self, args): class EarlyReturnException (line 164) | class EarlyReturnException(BaseException): function worker (line 168) | def worker(): FILE: modules/auth.py function auth_list_to_dict (line 8) | def auth_list_to_dict(auth_list): function load_auth_data (line 19) | def load_auth_data(filename=None): function check_auth (line 37) | def check_auth(user, password): FILE: modules/config.py function get_config_path (line 16) | def get_config_path(key, default_value): function try_load_deprecated_user_path_config (line 52) | def try_load_deprecated_user_path_config(): function get_presets (line 101) | def get_presets(): function update_presets (line 110) | def update_presets(): function try_get_preset_content (line 114) | def try_get_preset_content(preset): function get_path_output (line 134) | def get_path_output() -> str: function get_dir_or_set_default (line 146) | def get_dir_or_set_default(key, default_value, as_array=False, make_dire... function get_config_item_or_set_default (line 207) | def get_config_item_or_set_default(key, default_value, validator, disabl... function init_temp_path (line 236) | def init_temp_path(path: str | None, default_path: str) -> str: function add_ratio (line 767) | def add_ratio(x): function get_model_filenames (line 800) | def get_model_filenames(folder_paths, extensions=None, name_filter=None): function update_files (line 813) | def update_files(): function downloading_inpaint_models (line 823) | def downloading_inpaint_models(v): function downloading_sdxl_lcm_lora (line 861) | def downloading_sdxl_lcm_lora(): function downloading_sdxl_lightning_lora (line 870) | def downloading_sdxl_lightning_lora(): function downloading_sdxl_hyper_sd_lora (line 879) | def downloading_sdxl_hyper_sd_lora(): function downloading_controlnet_canny (line 888) | def downloading_controlnet_canny(): function downloading_controlnet_cpds (line 897) | def downloading_controlnet_cpds(): function downloading_ip_adapters (line 906) | def downloading_ip_adapters(v): function downloading_upscale_model (line 944) | def downloading_upscale_model(): function downloading_safety_checker_model (line 952) | def downloading_safety_checker_model(): function download_sam_model (line 961) | def download_sam_model(sam_model: str) -> str: function downloading_sam_vit_b (line 973) | def downloading_sam_vit_b(): function downloading_sam_vit_l (line 982) | def downloading_sam_vit_l(): function downloading_sam_vit_h (line 991) | def downloading_sam_vit_h(): FILE: modules/core.py class StableDiffusionModel (line 37) | class StableDiffusionModel: method __init__ (line 38) | def __init__(self, unet=None, vae=None, clip=None, clip_vision=None, f... method refresh_loras (line 62) | def refresh_loras(self, loras): function apply_freeu (line 127) | def apply_freeu(model, b1, b2, s1, s2): function load_controlnet (line 133) | def load_controlnet(ckpt_filename): function apply_controlnet (line 139) | def apply_controlnet(positive, negative, control_net, image, strength, s... function load_model (line 146) | def load_model(ckpt_filename, vae_filename=None): function generate_empty_latent (line 154) | def generate_empty_latent(width=1024, height=1024, batch_size=1): function decode_vae (line 160) | def decode_vae(vae, latent_image, tiled=False): function encode_vae (line 169) | def encode_vae(vae, pixels, tiled=False): function encode_vae_inpaint (line 178) | def encode_vae_inpaint(vae, pixels, mask): class VAEApprox (line 196) | class VAEApprox(torch.nn.Module): method __init__ (line 197) | def __init__(self): method forward (line 209) | def forward(self, x): function get_previewer (line 224) | def get_previewer(model): function ksampler (line 265) | def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg... function pytorch_to_numpy (line 330) | def pytorch_to_numpy(x): function numpy_to_pytorch (line 336) | def numpy_to_pytorch(x): FILE: modules/default_pipeline.py function refresh_controlnets (line 33) | def refresh_controlnets(model_paths): function assert_model_integrity (line 48) | def assert_model_integrity(): function refresh_base_model (line 62) | def refresh_base_model(name, vae_name=None): function refresh_refiner_model (line 82) | def refresh_refiner_model(name): function synthesize_refiner_model (line 113) | def synthesize_refiner_model(): function refresh_loras (line 133) | def refresh_loras(loras, base_model_additional_loras=None): function clip_encode_single (line 147) | def clip_encode_single(clip, text, verbose=False): function clone_cond (line 163) | def clone_cond(conds): function clip_encode (line 182) | def clip_encode(texts, pool_top_k=1): function set_clip_skip (line 206) | def set_clip_skip(clip_skip: int): function clear_all_caches (line 217) | def clear_all_caches(): function prepare_text_encoder (line 223) | def prepare_text_encoder(async_call=True): function refresh_everything (line 234) | def refresh_everything(refiner_model_name, base_model_name, loras, function vae_parse (line 280) | def vae_parse(latent): function calculate_sigmas_all (line 290) | def calculate_sigmas_all(sampler, model, scheduler, steps): function calculate_sigmas (line 307) | def calculate_sigmas(sampler, model, scheduler, steps, denoise): function get_candidate_vae (line 319) | def get_candidate_vae(steps, switch, denoise=1.0, refiner_swap_method='j... function process_diffusion (line 336) | def process_diffusion(positive_cond, negative_cond, steps, switch, width... FILE: modules/extra_utils.py function makedirs_with_log (line 5) | def makedirs_with_log(path): function get_files_from_folder (line 12) | def get_files_from_folder(folder_path, extensions=None, name_filter=None): function try_eval_env_var (line 31) | def try_eval_env_var(value: str, expected_type=None): FILE: modules/flags.py class MetadataScheme (line 110) | class MetadataScheme(Enum): class OutputFormat (line 121) | class OutputFormat(Enum): method list (line 127) | def list(cls) -> list: class PerformanceLoRA (line 131) | class PerformanceLoRA(Enum): class Steps (line 139) | class Steps(IntEnum): method keys (line 147) | def keys(cls) -> list: class StepsUOV (line 151) | class StepsUOV(IntEnum): class Performance (line 159) | class Performance(Enum): method list (line 167) | def list(cls) -> list: method values (line 171) | def values(cls) -> list: method by_steps (line 175) | def by_steps(cls, steps: int | str): method has_restricted_features (line 179) | def has_restricted_features(cls, x) -> bool: method steps (line 184) | def steps(self) -> int | None: method steps_uov (line 187) | def steps_uov(self) -> int | None: method lora_filename (line 190) | def lora_filename(self) -> str | None: FILE: modules/gradio_hijack.py class Image (line 39) | class Image( method __init__ (line 59) | def __init__( method get_config (line 178) | def get_config(self): method update (line 199) | def update( method _format_image (line 235) | def _format_image( method preprocess (line 259) | def preprocess( method postprocess (line 314) | def postprocess( method set_interpret_parameters (line 334) | def set_interpret_parameters(self, segments: int = 16): method _segment_by_slic (line 343) | def _segment_by_slic(self, x): method tokenize (line 376) | def tokenize(self, x): method get_masked_inputs (line 402) | def get_masked_inputs(self, tokens, binary_mask_matrix): method get_interpretation_scores (line 411) | def get_interpretation_scores( method style (line 432) | def style(self, *, height: int | None = None, width: int | None = None... method check_streamable (line 443) | def check_streamable(self): method as_example (line 447) | def as_example(self, input_data: str | None) -> str: function blk_ini (line 463) | def blk_ini(self, *args, **kwargs): function patched_wait_for (line 477) | def patched_wait_for(fut, timeout): FILE: modules/hash_cache.py function sha256_from_cache (line 13) | def sha256_from_cache(filepath): function load_cache_from_file (line 25) | def load_cache_from_file(): function save_cache_to_file (line 42) | def save_cache_to_file(filename=None, hash_value=None): function init_cache (line 61) | def init_cache(model_filenames, paths_checkpoints, lora_filenames, paths... function rebuild_cache (line 72) | def rebuild_cache(lora_filenames, model_filenames, paths_checkpoints, pa... FILE: modules/html.py function make_progress_html (line 12) | def make_progress_html(number, text): FILE: modules/inpaint_worker.py class InpaintHead (line 13) | class InpaintHead(torch.nn.Module): method __init__ (line 14) | def __init__(self, *args, **kwargs): method __call__ (line 18) | def __call__(self, x): function box_blur (line 26) | def box_blur(x, k): function max_filter_opencv (line 32) | def max_filter_opencv(x, ksize=3): function morphological_open (line 38) | def morphological_open(x): function up255 (line 53) | def up255(x, t=0): function imsave (line 59) | def imsave(x, path): function regulate_abcd (line 64) | def regulate_abcd(x, a, b, c, d): function compute_initial_abcd (line 85) | def compute_initial_abcd(x): function solve_abcd (line 104) | def solve_abcd(x, a, b, c, d, k): function fooocus_fill (line 136) | def fooocus_fill(image, mask): class InpaintWorker (line 150) | class InpaintWorker: method __init__ (line 151) | def __init__(self, image, mask, use_fill=True, k=0.618): method load_latent (line 188) | def load_latent(self, latent_fill, latent_mask, latent_swap=None): method patch (line 194) | def patch(self, inpaint_head_model_path, inpaint_latent, inpaint_laten... method swap (line 219) | def swap(self): method unswap (line 233) | def unswap(self): method color_correction (line 247) | def color_correction(self, img): method post_process (line 254) | def post_process(self, img): method visualize_mask_processing (line 262) | def visualize_mask_processing(self): FILE: modules/launch_util.py function is_installed (line 26) | def is_installed(package): function run (line 35) | def run(command, desc=None, errdesc=None, custom_env=None, live: bool = ... function run_pip (line 67) | def run_pip(command, desc=None, live=default_command_live): function requirements_met (line 78) | def requirements_met(requirements_file): function delete_folder_content (line 103) | def delete_folder_content(folder, prefix=None): FILE: modules/localization.py function localization_js (line 9) | def localization_js(filename): function dump_english_config (line 31) | def dump_english_config(components): FILE: modules/lora.py function match_lora (line 1) | def match_lora(lora, to_load): FILE: modules/meta_parser.py function load_parameter_button_click (line 22) | def load_parameter_button_click(raw_metadata: dict | str, is_generating:... function get_str (line 75) | def get_str(key: str, fallback: str | None, source_dict: dict, results: ... function get_list (line 86) | def get_list(key: str, fallback: str | None, source_dict: dict, results:... function get_number (line 96) | def get_number(key: str, fallback: str | None, source_dict: dict, result... function get_image_number (line 106) | def get_image_number(key: str, fallback: str | None, source_dict: dict, ... function get_steps (line 117) | def get_steps(key: str, fallback: str | None, source_dict: dict, results... function get_resolution (line 133) | def get_resolution(key: str, fallback: str | None, source_dict: dict, re... function get_seed (line 152) | def get_seed(key: str, fallback: str | None, source_dict: dict, results:... function get_inpaint_engine_version (line 164) | def get_inpaint_engine_version(key: str, fallback: str | None, source_di... function get_inpaint_method (line 180) | def get_inpaint_method(key: str, fallback: str | None, source_dict: dict... function get_adm_guidance (line 194) | def get_adm_guidance(key: str, fallback: str | None, source_dict: dict, ... function get_freeu (line 207) | def get_freeu(key: str, fallback: str | None, source_dict: dict, results... function get_lora (line 224) | def get_lora(key: str, fallback: str | None, source_dict: dict, results:... function parse_meta_from_preset (line 249) | def parse_meta_from_preset(preset_content): class MetadataParser (line 279) | class MetadataParser(ABC): method __init__ (line 280) | def __init__(self): method get_scheme (line 294) | def get_scheme(self) -> MetadataScheme: method to_json (line 298) | def to_json(self, metadata: dict | str) -> dict: method to_string (line 302) | def to_string(self, metadata: dict) -> str: method set_data (line 305) | def set_data(self, raw_prompt, full_prompt, raw_negative_prompt, full_... class A1111MetadataParser (line 331) | class A1111MetadataParser(MetadataParser): method get_scheme (line 332) | def get_scheme(self) -> MetadataScheme: method to_json (line 365) | def to_json(self, metadata: str) -> dict: method to_string (line 459) | def to_string(self, metadata: dict) -> str: method add_extension_to_filename (line 527) | def add_extension_to_filename(data, filenames, key): class FooocusMetadataParser (line 535) | class FooocusMetadataParser(MetadataParser): method get_scheme (line 536) | def get_scheme(self) -> MetadataScheme: method to_json (line 539) | def to_json(self, metadata: dict) -> dict: method to_string (line 554) | def to_string(self, metadata: list) -> str: method replace_value_with_filename (line 584) | def replace_value_with_filename(key, value, filenames): function get_metadata_parser (line 597) | def get_metadata_parser(metadata_scheme: MetadataScheme) -> MetadataParser: function read_info_from_image (line 607) | def read_info_from_image(file) -> tuple[str | None, MetadataScheme | None]: function get_exif (line 641) | def get_exif(metadata: str | None, metadata_scheme: str): FILE: modules/model_loader.py function load_file_from_url (line 6) | def load_file_from_url( FILE: modules/ops.py function use_patched_ops (line 6) | def use_patched_ops(operations): FILE: modules/patch.py class PatchSettings (line 31) | class PatchSettings: method __init__ (line 32) | def __init__(self, function calculate_weight_patched (line 52) | def calculate_weight_patched(self, patches, weight, key): class BrownianTreeNoiseSamplerPatched (line 186) | class BrownianTreeNoiseSamplerPatched: method global_init (line 191) | def global_init(x, sigma_min, sigma_max, seed=None, transform=lambda x... method __init__ (line 200) | def __init__(self, *args, **kwargs): method __call__ (line 204) | def __call__(sigma, sigma_next): function compute_cfg (line 212) | def compute_cfg(uncond, cond, cfg_scale, t): function patched_sampling_function (line 226) | def patched_sampling_function(model, x, timestep, uncond, cond, cond_sca... function round_to_64 (line 256) | def round_to_64(x): function sdxl_encode_adm_patched (line 265) | def sdxl_encode_adm_patched(self, **kwargs): function patched_KSamplerX0Inpaint_forward (line 297) | def patched_KSamplerX0Inpaint_forward(self, x, sigma, uncond, cond, cond... function timed_adm (line 330) | def timed_adm(y, timesteps): function patched_cldm_forward (line 339) | def patched_cldm_forward(self, x, hint, timesteps, context, y=None, **kw... function patched_unet_forward (line 376) | def patched_unet_forward(self, x, timesteps=None, context=None, y=None, ... function patched_load_models_gpu (line 445) | def patched_load_models_gpu(*args, **kwargs): function build_loaded (line 454) | def build_loaded(module, loader_name): function patch_all (line 488) | def patch_all(): FILE: modules/patch_clip.py function patched_encode_token_weights (line 25) | def patched_encode_token_weights(self, token_weight_pairs): function patched_SDClipModel__init__ (line 65) | def patched_SDClipModel__init__(self, max_length=77, freeze=True, layer=... function patched_SDClipModel_forward (line 109) | def patched_SDClipModel_forward(self, tokens): function patched_ClipVisionModel__init__ (line 149) | def patched_ClipVisionModel__init__(self, json_config): function patched_ClipVisionModel_encode_image (line 172) | def patched_ClipVisionModel_encode_image(self, image): function patch_all_clip (line 189) | def patch_all_clip(): FILE: modules/patch_precision.py function patched_timestep_embedding (line 15) | def patched_timestep_embedding(timesteps, dim, max_period=10000, repeat_... function patched_register_schedule (line 32) | def patched_register_schedule(self, given_betas=None, beta_schedule="lin... function patch_all_precision (line 59) | def patch_all_precision(): FILE: modules/private_logger.py function get_current_html_path (line 16) | def get_current_html_path(output_format=None): function log (line 24) | def log(img, metadata, metadata_parser: MetadataParser | None = None, ou... FILE: modules/sample_hijack.py function clip_separate_inner (line 23) | def clip_separate_inner(c, p, target_model=None, target_clip=None): function clip_separate (line 54) | def clip_separate(cond, target_model=None, target_clip=None): function clip_separate_after_preparation (line 68) | def clip_separate_after_preparation(cond, target_model=None, target_clip... function sample_hacked (line 89) | def sample_hacked(model, noise, positive, negative, cfg, device, sampler... function calculate_sigmas_scheduler_hacked (line 164) | def calculate_sigmas_scheduler_hacked(model, scheduler_name, steps): FILE: modules/sdxl_styles.py function normalize_key (line 13) | def normalize_key(k): function get_random_style (line 56) | def get_random_style(rng: Random) -> str: function apply_style (line 60) | def apply_style(style, positive): function get_words (line 65) | def get_words(arrays, total_mult, index): function apply_arrays (line 77) | def apply_arrays(text, index): FILE: modules/style_sorter.py function try_load_sorted_styles (line 10) | def try_load_sorted_styles(style_names, default_selected): function sort_styles (line 36) | def sort_styles(selected): function localization_key (line 50) | def localization_key(x): function search_styles (line 54) | def search_styles(selected, query): FILE: modules/ui_gradio_extensions.py function webpath (line 16) | def webpath(fn): function javascript_html (line 25) | def javascript_html(): function css_html (line 50) | def css_html(): function reload_javascript (line 56) | def reload_javascript(): FILE: modules/upscaler.py function perform_upscale (line 13) | def perform_upscale(img): FILE: modules/util.py function erode_or_dilate (line 31) | def erode_or_dilate(x, k): function resample_image (line 40) | def resample_image(im, width, height): function resize_image (line 46) | def resize_image(im, width, height, resize_mode=1): function get_shape_ceil (line 104) | def get_shape_ceil(h, w): function get_image_shape_ceil (line 108) | def get_image_shape_ceil(im): function set_image_shape_ceil (line 113) | def set_image_shape_ceil(im, shape_ceil): function HWC3 (line 133) | def HWC3(x): function remove_empty_str (line 152) | def remove_empty_str(items, default=None): function join_prompts (line 159) | def join_prompts(*args, **kwargs): function generate_temp_filename (line 168) | def generate_temp_filename(folder='./outputs/', extension='png'): function sha256 (line 178) | def sha256(filename, use_addnet_hash=False, length=HASH_SHA256_LENGTH): function addnet_hash_safetensors (line 188) | def addnet_hash_safetensors(b): function calculate_sha256 (line 205) | def calculate_sha256(filename) -> str: function quote (line 216) | def quote(text): function unquote (line 223) | def unquote(text): function unwrap_style_text_from_prompt (line 233) | def unwrap_style_text_from_prompt(style_text, prompt): function extract_original_prompts (line 278) | def extract_original_prompts(style, prompt, negative_prompt): function extract_styles_from_prompt (line 302) | def extract_styles_from_prompt(prompt, negative_prompt): class PromptStyle (line 349) | class PromptStyle(NamedTuple): function is_json (line 355) | def is_json(data: str) -> bool: function get_filname_by_stem (line 364) | def get_filname_by_stem(lora_name, filenames: List[str]) -> str | None: function get_file_from_folder_list (line 372) | def get_file_from_folder_list(name, folders): function get_enabled_loras (line 384) | def get_enabled_loras(loras: list, remove_none=True) -> list: function parse_lora_references_from_prompt (line 388) | def parse_lora_references_from_prompt(prompt: str, loras: List[Tuple[Any... function remove_performance_lora (line 440) | def remove_performance_lora(filenames: list, performance: Performance | ... function cleanup_prompt (line 456) | def cleanup_prompt(prompt): function apply_wildcards (line 468) | def apply_wildcards(wildcard_text, rng, i, read_wildcards_in_order) -> str: function get_image_size_info (line 495) | def get_image_size_info(image: np.ndarray, aspect_ratios: list) -> str: FILE: tests/test_extra_utils.py class TestUtils (line 9) | class TestUtils(unittest.TestCase): method test_try_eval_env_var (line 10) | def test_try_eval_env_var(self): FILE: tests/test_utils.py class TestUtils (line 8) | class TestUtils(unittest.TestCase): method test_can_parse_tokens_with_lora (line 9) | def test_can_parse_tokens_with_lora(self): method test_can_parse_tokens_and_strip_performance_lora (line 86) | def test_can_parse_tokens_and_strip_performance_lora(self): FILE: webui.py function get_task (line 27) | def get_task(*args): function generate_clicked (line 33) | def generate_clicked(task: worker.AsyncTask): function sort_enhance_images (line 96) | def sort_enhance_images(images, task): function inpaint_mode_change (line 115) | def inpaint_mode_change(mode, inpaint_engine_version): function stop_clicked (line 186) | def stop_clicked(currentTask): function skip_clicked (line 193) | def skip_clicked(currentTask): function ip_advance_checked (line 248) | def ip_advance_checked(x): function generate_mask (line 301) | def generate_mask(image, mask_model, cloth_category, dino_prompt_text, s... function trigger_show_image_properties (line 349) | def trigger_show_image_properties(image): function trigger_metadata_preview (line 368) | def trigger_metadata_preview(file): function random_checked (line 594) | def random_checked(r): function refresh_seed (line 597) | def refresh_seed(r, seed_string): function update_history_link (line 612) | def update_history_link(): function dev_mode_checked (line 865) | def dev_mode_checked(r): function refresh_files_clicked (line 871) | def refresh_files_clicked(): function preset_selection_change (line 901) | def preset_selection_change(preset, is_generating, inpaint_mode): function inpaint_engine_state_change (line 922) | def inpaint_engine_state_change(inpaint_engine_version, *args): function parse_meta (line 1010) | def parse_meta(raw_prompt_txt, is_generating): function trigger_metadata_import (line 1027) | def trigger_metadata_import(file, state_is_generating): function trigger_describe (line 1064) | def trigger_describe(modes, img, apply_styles): function trigger_auto_describe (line 1096) | def trigger_auto_describe(mode, img, prompt, apply_styles): function dump_default_english_config (line 1113) | def dump_default_english_config():