MCPcopy Create free account

hub / github.com/Kwai-Kolors/Kolors / functions

Functions381 in github.com/Kwai-Kolors/Kolors

↓ 12 callersFunctionget_activation
(name)
controlnet/annotator/midas/midas/vit.py:159
↓ 11 callersMethod__init__
(self, config: ChatGLMConfig, device=None)
kolors/models/modeling_chatglm.py:472
↓ 11 callersMethoddecode
(self, t: List[int])
kolors/models/tokenization_chatglm.py:58
↓ 11 callersMethodget_command
(self, token)
kolors/models/tokenization_chatglm.py:112
↓ 10 callersMethodencode
(self, s: str, bos: bool = False, eos: bool = False)
kolors/models/tokenization_chatglm.py:49
↓ 8 callersFunctionHWC3
(x)
controlnet/annotator/util.py:10
↓ 6 callersMethodconstrain_to_multiple_of
(self, x, min_val=0, max_val=None)
controlnet/annotator/midas/midas/transforms.py:94
↓ 6 callersMethodenable_model_cpu_offload
r""" Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared to `enable_sequenti
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256.py:200
↓ 6 callersMethodload
Load model from file. Args: path (str): file path
controlnet/annotator/midas/midas/base_model.py:5
↓ 5 callersFunction_make_scratch
(in_shape, out_shape, groups=1, expand=False)
controlnet/annotator/midas/midas/blocks.py:49
↓ 5 callersFunctionresize_image
(input_image, resolution, short = False, interpolation=None)
controlnet/annotator/util.py:29
↓ 5 callersFunctionzero_module
(module)
kolors/models/controlnet.py:884
↓ 4 callersMethod__init__
Init. Args: scale_factor (float): scaling mode (str): interpolation mode
controlnet/annotator/midas/midas/blocks.py:124
↓ 4 callersFunction_config_to_kwargs
(args)
kolors/models/modeling_chatglm.py:457
↓ 4 callersFunction_make_fusion_block
(features, use_bn)
controlnet/annotator/midas/midas/dpt_depth.py:15
↓ 4 callersFunction_make_vit_b16_backbone
( model, features=[96, 192, 384, 768], size=[384, 384], hooks=[2, 5, 8, 11], vit_features=
controlnet/annotator/midas/midas/vit.py:183
↓ 4 callersFunctioncompute_text_embeddings
(prompt)
dreambooth/train_dreambooth_lora.py:1007
↓ 3 callersMethod__init__
(self, start_index=1)
controlnet/annotator/midas/midas/vit.py:10
↓ 3 callersFunction_make_encoder
(backbone, features, use_pretrained, groups=1, expand=False, exportable=True, hooks=None, use_vit_only=False,
controlnet/annotator/midas/midas/blocks.py:11
↓ 3 callersMethodbuild_chat_input
(self, query, history=None, role="user")
kolors/models/tokenization_chatglm.py:201
↓ 3 callersFunctionreshape_tensor
(x, heads)
kolors/models/ipa_faceid_plus/ipa_faceid_plus.py:5
↓ 3 callersFunctionunwrap_model
(model)
dreambooth/train_dreambooth_lora.py:901
↓ 2 callersMethod__init__
(self, cross_attention_dim=768, id_embeddings_dim=512, clip_embeddings_dim=1280, num_tokens=4)
kolors/models/ipa_faceid_plus/ipa_faceid_plus.py:107
↓ 2 callersMethod_encode_vae_image
(self, image: torch.Tensor, generator: torch.Generator)
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_inpainting.py:883
↓ 2 callersFunction_get_3rd_point
To calculate the affine matrix, three pairs of points are required. This function is used to get the 3rd point, given 2D points a & b. The 3r
controlnet/annotator/dwpose/onnxpose.py:182
↓ 2 callersFunctionapply_rotary_pos_emb
(x: torch.Tensor, rope_cache: torch.Tensor)
kolors/models/modeling_chatglm.py:166
↓ 2 callersMethodbuild_single_message
(self, role, metadata, message)
kolors/models/tokenization_chatglm.py:194
↓ 2 callersMethodcheck_image
(self, image, prompt, prompt_embeds)
kolors/pipelines/pipeline_controlnet_xl_kolors_img2img.py:643
↓ 2 callersFunctionget_readout_oper
(vit_features, features, use_readout, start_index=1)
controlnet/annotator/midas/midas/vit.py:166
↓ 2 callersFunctionmask_pil_to_torch
(mask, height, width)
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_inpainting.py:119
↓ 2 callersMethodprepare_control_image
( self, image, width, height, batch_size, num_images_per_promp
kolors/pipelines/pipeline_controlnet_xl_kolors_img2img.py:681
↓ 2 callersMethodprocess_response
(self, output, history)
kolors/models/modeling_chatglm.py:1004
↓ 2 callersFunctionretrieve_latents
( encoder_output: torch.Tensor, generator: Optional[torch.Generator] = None, sample_mode: str = "sample" )
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_inpainting.py:254
↓ 2 callersFunctionretrieve_latents
( encoder_output: torch.Tensor, generator: Optional[torch.Generator] = None, sample_mode: str = "sample" )
kolors/pipelines/pipeline_controlnet_xl_kolors_img2img.py:69
↓ 2 callersMethodset_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
kolors/models/controlnet.py:558
↓ 2 callersMethodset_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
kolors/models/unet_2d_condition.py:729
↓ 2 callersMethodvocab_size
(self)
kolors/models/tokenization_chatglm.py:139
↓ 1 callersFunctionFeedForward
(dim, mult=4)
kolors/models/ipa_faceid_plus/ipa_faceid_plus.py:15
↓ 1 callersMethod__init__
( self, head, features=256, backbone="vitb_rn50_384", readout="project
controlnet/annotator/midas/midas/dpt_depth.py:27
↓ 1 callersMethod__init__
( self, in_channels: int = 4, conditioning_channels: int = 3, flip_sin_to_cos:
kolors/models/controlnet.py:195
↓ 1 callersMethod__init__
(self, model_path: str)
kolors/models/tokenization_chatglm.py:12
↓ 1 callersMethod__init__
( self, hidden_size=None, cross_attention_dim=None, )
kolors/models/ipa_faceid_plus/attention_processor.py:10
↓ 1 callersMethod_check_config
( self, down_block_types: Tuple[str], up_block_types: Tuple[str], only_cross_a
kolors/models/unet_2d_condition.py:495
↓ 1 callersMethod_convert_id_to_token
Converts an index (integer) in a token (str) using the vocab.
kolors/models/tokenization_chatglm.py:155
↓ 1 callersFunction_fix_aspect_ratio
Extend the scale to match the given aspect ratio. Args: scale (np.ndarray): The image scale (w, h) in shape (2, ) aspect_ratio (f
controlnet/annotator/dwpose/onnxpose.py:149
↓ 1 callersMethod_get_add_time_ids
(self, original_size, crops_coords_top_left, target_size, dtype)
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_ipadapter_FaceID.py:536
↓ 1 callersMethod_get_add_time_ids
( self, original_size, crops_coords_top_left, target_size, aesthetic_s
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_inpainting.py:997
↓ 1 callersMethod_get_add_time_ids
(self, original_size, crops_coords_top_left, target_size, dtype)
kolors/pipelines/pipeline_controlnet_xl_kolors_img2img.py:813
↓ 1 callersMethod_get_add_time_ids
(self, original_size, crops_coords_top_left, target_size, dtype)
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256.py:518
↓ 1 callersMethod_get_add_time_ids
(self, original_size, crops_coords_top_left, target_size, dtype)
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_ipadapter.py:606
↓ 1 callersMethod_get_layer
(self, layer_number)
kolors/models/modeling_chatglm.py:610
↓ 1 callersFunction_make_efficientnet_backbone
(effnet)
controlnet/annotator/midas/midas/blocks.py:88
↓ 1 callersFunction_make_pretrained_efficientnet_lite3
(use_pretrained, exportable=False)
controlnet/annotator/midas/midas/blocks.py:78
↓ 1 callersFunction_make_pretrained_resnext101_wsl
(use_pretrained)
controlnet/annotator/midas/midas/blocks.py:114
↓ 1 callersFunction_make_pretrained_vitb16_384
(pretrained, use_readout="ignore", hooks=None)
controlnet/annotator/midas/midas/vit.py:310
↓ 1 callersFunction_make_pretrained_vitb_rn50_384
( pretrained, use_readout="ignore", hooks=None, use_vit_only=False )
controlnet/annotator/midas/midas/vit.py:478
↓ 1 callersFunction_make_pretrained_vitl16_384
(pretrained, use_readout="ignore", hooks=None)
controlnet/annotator/midas/midas/vit.py:297
↓ 1 callersFunction_make_resnet_backbone
(resnet)
controlnet/annotator/midas/midas/blocks.py:101
↓ 1 callersFunction_make_vit_b_rn50_backbone
( model, features=[256, 512, 768, 768], size=[384, 384], hooks=[0, 1, 8, 11], vit_features
controlnet/annotator/midas/midas/vit.py:343
↓ 1 callersFunction_rotate_point
Rotate a point by an angle. Args: pt (np.ndarray): 2D point coordinates (x, y) in shape (2, ) angle_rad (float): rotation angle i
controlnet/annotator/dwpose/onnxpose.py:167
↓ 1 callersMethod_set_add_embedding
( self, addition_embed_type: str, addition_embed_type_num_heads: int, addition
kolors/models/unet_2d_condition.py:652
↓ 1 callersMethod_set_class_embedding
( self, class_embed_type: Optional[str], act_fn: str, num_class_embeds: Option
kolors/models/unet_2d_condition.py:615
↓ 1 callersMethod_set_encoder_hid_proj
( self, encoder_hid_dim_type: Optional[str], cross_attention_dim: Union[int, Tuple[int
kolors/models/unet_2d_condition.py:575
↓ 1 callersMethod_set_pos_net_if_use_gligen
(self, attention_type: str, cross_attention_dim: int)
kolors/models/unet_2d_condition.py:692
↓ 1 callersMethod_set_time_proj
( self, time_embedding_type: str, block_out_channels: int, flip_sin_to_cos: bo
kolors/models/unet_2d_condition.py:547
↓ 1 callersMethod_update_model_kwargs_for_generation
( self, outputs: ModelOutput, model_kwargs: Dict[str, Any], is
kolors/models/modeling_chatglm.py:868
↓ 1 callersFunctionbbox_xyxy2cs
Transform the bbox format from (x,y,w,h) into (center, scale) Args: bbox (ndarray): Bounding box(es) in shape (4,) or (n, 4), formatted
controlnet/annotator/dwpose/onnxpose.py:115
↓ 1 callersMethodcheck_inputs
( self, prompt, height, width, callback_steps, negative_prompt
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_ipadapter_FaceID.py:459
↓ 1 callersMethodcheck_inputs
( self, prompt, prompt_2, image, mask_image, height, w
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_inpainting.py:713
↓ 1 callersMethodcheck_inputs
( self, prompt, image, strength, num_inference_steps, callback
kolors/pipelines/pipeline_controlnet_xl_kolors_img2img.py:455
↓ 1 callersMethodcheck_inputs
( self, prompt, height, width, callback_steps, negative_prompt
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256.py:441
↓ 1 callersMethodcheck_inputs
( self, prompt, height, width, callback_steps, negative_prompt
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_ipadapter.py:529
↓ 1 callersFunctioncollate_fn
(examples, with_prior_preservation=False)
dreambooth/train_dreambooth_lora.py:617
↓ 1 callersMethodconvert_id_to_token
Converts an index (integer) in a token (str) using the vocab.
kolors/models/tokenization_chatglm.py:82
↓ 1 callersMethodconvert_token_to_id
Converts a token (str) in an id using the vocab.
kolors/models/tokenization_chatglm.py:76
↓ 1 callersFunctiondecode
Modulate simcc distribution with Gaussian. Args: simcc_x (np.ndarray[K, Wx]): model predicted simcc in x. simcc_y (np.ndarray[K,
controlnet/annotator/dwpose/onnxpose.py:333
↓ 1 callersMethoddecode_tokens
(self, tokens: List[str])
kolors/models/tokenization_chatglm.py:72
↓ 1 callersFunctiondemo_postprocess
(outputs, img_size, p6=False)
controlnet/annotator/dwpose/onnxdet.py:58
↓ 1 callersFunctiondraw_pose
(pose, H, W)
controlnet/annotator/dwpose/__init__.py:15
↓ 1 callersMethodencode_image
(self, image, device, num_images_per_prompt, output_hidden_states=None)
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_inpainting.py:449
↓ 1 callersMethodencode_image
(self, image, device, num_images_per_prompt, output_hidden_states=None)
kolors/pipelines/pipeline_controlnet_xl_kolors_img2img.py:367
↓ 1 callersMethodencode_image
(self, image, device, num_images_per_prompt, output_hidden_states=None)
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_ipadapter.py:440
↓ 1 callersFunctionencode_prompt
(text_encoder, input_ids, attention_mask, text_encoder_use_attention_mask=None)
dreambooth/train_dreambooth_lora.py:689
↓ 1 callersMethodencode_prompt
r""" Encodes the prompt into text encoder hidden states. Args: prompt (`str` or `List[str]`, *optional*):
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_ipadapter_FaceID.py:267
↓ 1 callersMethodencode_prompt
r""" Encodes the prompt into text encoder hidden states. Args: prompt (`str` or `List[str]`, *optional*):
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_inpainting.py:525
↓ 1 callersMethodencode_prompt
r""" Encodes the prompt into text encoder hidden states. Args: prompt (`str` or `List[str]`, *optional*):
kolors/pipelines/pipeline_controlnet_xl_kolors_img2img.py:191
↓ 1 callersMethodencode_prompt
r""" Encodes the prompt into text encoder hidden states. Args: prompt (`str` or `List[str]`, *optional*):
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256.py:249
↓ 1 callersMethodencode_prompt
r""" Encodes the prompt into text encoder hidden states. Args: prompt (`str` or `List[str]`, *optional*):
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_ipadapter.py:264
↓ 1 callersFunctionface_bbox_to_square
(bbox)
ipadapter_FaceID/sample_ipadapter_faceid_plus.py:40
↓ 1 callersMethodforward
(self, x)
controlnet/annotator/midas/midas/dpt_depth.py:67
↓ 1 callersMethodforward_impl
Enhanced Transformer with Rotary Position Embedding. Derived from: https://github.com/labmlai/annotated_deep_learning_paper_implementations/b
kolors/models/modeling_chatglm.py:134
↓ 1 callersFunctionforward_vit
(pretrained, x)
controlnet/annotator/midas/midas/vit.py:56
↓ 1 callersMethodget_aug_embed
( self, emb: torch.Tensor, encoder_hidden_states: torch.Tensor, added_cond_kwargs: Dict[str, Any]
kolors/models/unet_2d_condition.py:957
↓ 1 callersMethodget_class_embed
(self, sample: torch.Tensor, class_labels: Optional[torch.Tensor])
kolors/models/unet_2d_condition.py:941
↓ 1 callersMethodget_clip_feat
(self, face_crop_image, device)
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_ipadapter_FaceID.py:617
↓ 1 callersMethodget_faceinfo_one_img
(self, image_path)
ipadapter_FaceID/sample_ipadapter_faceid_plus.py:30
↓ 1 callersMethodget_fused_face_embedds
(self, face_insightface_embeds, face_crop_image, num_images_per_prompt, device)
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_ipadapter_FaceID.py:628
↓ 1 callersMethodget_guidance_scale_embedding
See https://github.com/google-research/vdm/blob/dc27b98a554f65cdc654b800da5aa1846545d41b/model_vdm.py#L298 Args: w (`tor
kolors/pipelines/pipeline_stable_diffusion_xl_chatglm_256_inpainting.py:1069
↓ 1 callersMethodget_masks
(self, input_ids, past_key_values, padding_mask=None)
kolors/models/modeling_chatglm.py:682
↓ 1 callersFunctionget_pipe
(ckpt_dir)
dreambooth/train_dreambooth_lora.py:455
next →1–100 of 381, ranked by callers