Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/HVision-NKU/K-LoRA
/ functions
Functions
42 in github.com/HVision-NKU/K-LoRA
⨍
Functions
42
◇
Types & classes
4
↓ 14 callers
Function
copy_and_assign_klora_weights
( prefix, attn_module, sub_module_names, lora_weights_content, lora_weights_style, alp
utils.py:351
↓ 12 callers
Function
initialize_klora_layer
( alpha, beta, sum_timesteps, average_ratio, state_dict_1_a, state_dict_1_b, state
utils.py:129
↓ 7 callers
Function
tokenize_prompt
(tokenizer, prompt)
train_dreambooth_lora_sdxl.py:871
↓ 6 callers
Function
get_lora_weights
Args: lora_name_or_path (str): huggingface repo id or folder path of lora weights subfolder (Optional[str], optional): sub folder
utils.py:14
↓ 4 callers
Function
text_encoder_lora_state_dict
(text_encoder)
train_dreambooth_lora_sdxl.py:71
↓ 3 callers
Function
compute_text_embeddings
(prompt, text_encoders, tokenizers)
train_dreambooth_lora_sdxl.py:1400
↓ 3 callers
Function
get_ratio_between_content_and_style
(lora_weights_content, lora_weights_style)
utils.py:157
↓ 2 callers
Function
compute_time_ids
()
train_dreambooth_lora_sdxl.py:1383
↓ 2 callers
Function
encode_prompt
(text_encoders, tokenizers, prompt, text_input_ids_list=None)
train_dreambooth_lora_sdxl.py:884
↓ 2 callers
Function
import_model_class_from_model_name_or_path
( pretrained_model_name_or_path: str, revision: str, subfolder: str = "text_encoder" )
train_dreambooth_lora_sdxl.py:169
↓ 2 callers
Function
insert_sd_klora_to_unet
( unet, lora_weights_content_path, lora_weights_style_path, alpha, beta, sum_timesteps, pattern )
utils.py:212
↓ 2 callers
Function
merge_community_flux_lora_weights
Args: tensors (torch.Tensor): state dict of lora weights key (str): target attn layer's key prefix (str, optional): prefi
utils.py:93
↓ 2 callers
Function
merge_lora_weights
Args: tensors (torch.Tensor): state dict of lora weights key (str): target attn layer's key prefix (str, optional): prefi
utils.py:51
↓ 2 callers
Function
merge_sd_lora_weights
Args: tensors (torch.Tensor): state dict of lora weights key (str): target attn layer's key prefix (str, optional): prefi
utils.py:71
↓ 2 callers
Function
parse_args
()
inference_gradio.py:9
↓ 2 callers
Function
rename_safetensors_layer_name
(tensor)
utils.py:708
↓ 1 callers
Method
__init__
( self, in_features: int, out_features: int, weight_1_a: torch.Tensor,
klora.py:9
↓ 1 callers
Function
collate_fn
(examples, with_prior_preservation=False)
train_dreambooth_lora_sdxl.py:837
↓ 1 callers
Method
get_klora_weight
(self, timestep)
klora.py:43
↓ 1 callers
Function
insert_community_flux_lora_to_unet
( unet, lora_weights_content_path, lora_weights_style_path, alpha, beta, diffuse_step,
utils.py:420
↓ 1 callers
Function
main
(args)
train_dreambooth_lora_sdxl.py:912
↓ 1 callers
Function
parse_args
(input_args=None)
train_dreambooth_lora_sdxl.py:189
↓ 1 callers
Function
parse_args
()
inference_sd.py:8
↓ 1 callers
Function
parse_args
()
inference_flux.py:70
↓ 1 callers
Function
rename_key
(key)
utils.py:709
↓ 1 callers
Function
run
()
inference_sd.py:68
↓ 1 callers
Function
run
()
inference_flux.py:140
↓ 1 callers
Function
save_model_card
( repo_id: str, images=None, base_model=str, train_text_encoder=False, instance_prompt=str
train_dreambooth_lora_sdxl.py:103
↓ 1 callers
Function
text_encoder_attn_modules
(text_encoder)
train_dreambooth_lora_sdxl.py:74
Method
__getitem__
(self, index)
train_dreambooth_lora_sdxl.py:804
Method
__getitem__
(self, index)
train_dreambooth_lora_sdxl.py:864
Method
__init__
( self, in_features: int, out_features: int, device: Optional[Union[torch.devi
klora.py:94
Method
__init__
( self, instance_data_root, instance_prompt, class_prompt, class_data_
train_dreambooth_lora_sdxl.py:689
Method
__init__
(self, prompt, num_samples)
train_dreambooth_lora_sdxl.py:857
Method
__len__
(self)
train_dreambooth_lora_sdxl.py:801
Method
__len__
(self)
train_dreambooth_lora_sdxl.py:861
Method
forward
(self, hidden_states: torch.Tensor)
klora.py:75
Method
forward
(self, hidden_states: torch.Tensor)
klora.py:110
Function
insert_community_sd_lora_to_unet
( unet, lora_weights_content_path, lora_weights_style_path, alpha, beta, sum_timesteps )
utils.py:281
Function
load_model_hook
(models, input_dir)
train_dreambooth_lora_sdxl.py:1206
Function
run
(prompt: str)
inference_gradio.py:58
Function
save_model_hook
(models, weights, output_dir)
train_dreambooth_lora_sdxl.py:1170