mirror of
https://git.datalinker.icu/kijai/ComfyUI-CogVideoXWrapper.git
synced 2025-12-08 20:34:23 +08:00
Allow loading the "Rewards" LoRAs into 1.5 as well (for what it's worth)
This commit is contained in:
parent
573150de28
commit
e187cfe22f
@ -414,12 +414,15 @@ def merge_lora(transformer, lora_path, multiplier, device='cpu', dtype=torch.flo
|
|||||||
alpha = 1.0
|
alpha = 1.0
|
||||||
|
|
||||||
curr_layer.weight.data = curr_layer.weight.data.to(device)
|
curr_layer.weight.data = curr_layer.weight.data.to(device)
|
||||||
if len(weight_up.shape) == 4:
|
try:
|
||||||
curr_layer.weight.data += multiplier * alpha * torch.mm(weight_up.squeeze(3).squeeze(2),
|
if len(weight_up.shape) == 4:
|
||||||
weight_down.squeeze(3).squeeze(2)).unsqueeze(
|
curr_layer.weight.data += multiplier * alpha * torch.mm(weight_up.squeeze(3).squeeze(2),
|
||||||
2).unsqueeze(3)
|
weight_down.squeeze(3).squeeze(2)).unsqueeze(
|
||||||
else:
|
2).unsqueeze(3)
|
||||||
curr_layer.weight.data += multiplier * alpha * torch.mm(weight_up, weight_down)
|
else:
|
||||||
|
curr_layer.weight.data += multiplier * alpha * torch.mm(weight_up, weight_down)
|
||||||
|
except:
|
||||||
|
print(f"Could not apply LoRA weight in layer {layer}")
|
||||||
|
|
||||||
return transformer
|
return transformer
|
||||||
|
|
||||||
|
|||||||
@ -589,7 +589,7 @@ class CogVideoXModelLoader:
|
|||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {
|
return {
|
||||||
"required": {
|
"required": {
|
||||||
"model": (folder_paths.get_filename_list("diffusion_models"), {"tooltip": "The name of the checkpoint (model) to load.",}),
|
"model": (folder_paths.get_filename_list("diffusion_models"), {"tooltip": "These models are loaded from the 'ComfyUI/models/diffusion_models' -folder",}),
|
||||||
|
|
||||||
"base_precision": (["fp16", "fp32", "bf16"], {"default": "bf16"}),
|
"base_precision": (["fp16", "fp32", "bf16"], {"default": "bf16"}),
|
||||||
"quantization": (['disabled', 'fp8_e4m3fn', 'fp8_e4m3fn_fast', 'torchao_fp8dq', "torchao_fp8dqrow", "torchao_int8dq", "torchao_fp6"], {"default": 'disabled', "tooltip": "optional quantization method"}),
|
"quantization": (['disabled', 'fp8_e4m3fn', 'fp8_e4m3fn_fast', 'torchao_fp8dq', "torchao_fp8dqrow", "torchao_int8dq", "torchao_fp6"], {"default": 'disabled', "tooltip": "optional quantization method"}),
|
||||||
@ -821,7 +821,7 @@ class CogVideoXVAELoader:
|
|||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {
|
return {
|
||||||
"required": {
|
"required": {
|
||||||
"model_name": (folder_paths.get_filename_list("vae"), {"tooltip": "The name of the checkpoint (vae) to load."}),
|
"model_name": (folder_paths.get_filename_list("vae"), {"tooltip": "These models are loaded from 'ComfyUI/models/vae'"}),
|
||||||
},
|
},
|
||||||
"optional": {
|
"optional": {
|
||||||
"precision": (["fp16", "fp32", "bf16"],
|
"precision": (["fp16", "fp32", "bf16"],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user