Skip to content

refactor: optimize the logic for name conversion and the processing of the LoRA model#955

Merged
leejet merged 1 commit into
masterfrom
refactor_lora
Nov 9, 2025
Merged

refactor: optimize the logic for name conversion and the processing of the LoRA model#955
leejet merged 1 commit into
masterfrom
refactor_lora

Conversation

@leejet

@leejet leejet commented Nov 9, 2025

Copy link
Copy Markdown
Owner

Tested LoRA models

# SD1.x
# https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5/tree/main?show_file_info=v1-5-pruned-emaonly.safetensors

# unet|lora_down+lora_up+alpha|hf
# https://huggingface.co/latent-consistency/lcm-lora-sdv1-5/tree/main?show_file_info=pytorch_lora_weights.safetensors
.\bin\Release\sd.exe -m ..\..\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors --lora-model-dir ..\..\stable-diffusion-webui\models\Lora\ -p "a lovely cat<lora:lcm-lora-sdv1-5:1>" -v --cfg-scale 1 --steps 4

# unet+te|lora_down+lora_up+alpha|hf
# https://huggingface.co/soinov/My_models/tree/main/Lora/Effects?show_file_info=Lora%2FEffects%2Fmarblesh.safetensors
.\bin\Release\sd.exe -m ..\..\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors --lora-model-dir ..\..\stable-diffusion-webui\models\Lora\ -p "a lovely cat<lora:marblesh:1>" -v

# unet+te|lora_down+lora_up+alpha|hf
.\bin\Release\sd.exe -m ..\..\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors --lora-model-dir ..\..\stable-diffusion-webui\models\Lora\ -p "a lovely cat<lora:VolleyballUniform_v20LyCORIS:1>" -v

# uent+te|loha(hada_w1_a+hada_w1_b+hada_w2_a+hada_w2_b+alpha)|hf
# https://huggingface.co/Tymy/cepotopoto/tree/0410fc780e7b15408ab589c65baf1b4fa88b1fb6?show_file_info=%5BLoHa%5D+Longan%E7%AB%9C%E7%9C%BC+Style+%28With+multires+noise+version%29.safetensors
.\bin\Release\sd.exe -m ..\..\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors --lora-model-dir ..\..\stable-diffusion-webui\models\Lora\ -p "a lovely cat<lora:[LoHa] Longan Style (With multires noise version):1>" -v

# uent+te|lokr(lokr_w1+lokr_w2+alpha)|hf
# https://huggingface.co/CyberHarem/surtr_arknights_lokr/tree/main/4250?not-for-all-audiences=true&show_file_info=4250%2Fsurtr_arknights.safetensors
.\bin\Release\sd.exe -m ..\..\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors --lora-model-dir ..\..\stable-diffusion-webui\models\Lora\ -p "a lovely cat<lora:surtr_arknights:1>" -v



# SDXL
# https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/tree/main?show_file_info=sd_xl_base_1.0.safetensors

# unet|lora_down+lora_up+alpha|hf
# https://huggingface.co/latent-consistency/lcm-lora-sdxl/tree/main?show_file_info=pytorch_lora_weights.safetensors
.\bin\Release\sd.exe -m ..\..\stable-diffusion-webui\models\Stable-diffusion\sd_xl_base_1.0.safetensors --vae ..\..\stable-diffusion-webui\models\VAE\sdxl_vae-fp16-fix.safetensors --lora-model-dir ..\..\stable-diffusion-webui\models\Lora\ -p "a lovely cat<lora:lcm-lora-xl:1>" -v   -H 1024 -W 1024 --cfg-scale 1 --steps 4


# unet+te1+te2|lora_down+lora_up+alpha|hf
# https://huggingface.co/Alptekinege/loras/tree/02b20c7efa88eafb5c7f3efaad1a5337762aba99?show_file_info=MJ52_v2.0.safetensors
.\bin\Release\sd.exe -m ..\..\stable-diffusion-webui\models\Stable-diffusion\sd_xl_base_1.0.safetensors --vae ..\..\stable-diffusion-webui\models\VAE\sdxl_vae-fp16-fix.safetensors --lora-model-dir ..\..\stable-diffusion-webui\models\Lora\ -p "a lovely cat<lora:MJ52_v2.0:1>" -v -H 1024 -W 1024 --diffusion-fa


# FLUX
# https://huggingface.co/black-forest-labs/FLUX.1-dev/tree/main?show_file_info=flux1-dev.safetensors

# diffusion_model|lora_down+lora_up|orig
# https://huggingface.co/XLabs-AI/flux-lora-collection/tree/main?show_file_info=anime_lora_comfy_converted.safetensors
.\bin\Release\sd.exe --diffusion-model  ..\models\flux1-dev-q8_0.gguf --vae ..\..\ComfyUI\models\vae\ae.sft --clip_l ..\..\ComfyUI\models\clip\clip_l.safetensors --t5xxl ..\..\ComfyUI\models\clip\t5xxl_fp16.safetensors  -p "a lovely cat holding a sign says 'flux.cpp'<lora:anime_lora_comfy_converted:1>" --cfg-scale 1.0 --sampling-method euler -v --lora-model-dir ../models --offload-to-cpu

# diffusion_model|lora_A+lora_B|hf
# https://huggingface.co/saquiboye/omini-kontext-character/tree/main?show_file_info=character_5000.safetensors
.\bin\Release\sd.exe --diffusion-model  ..\models\flux1-kontext-dev-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\ae.sft --clip_l ..\..\ComfyUI\models\clip\clip_l.safetensors --t5xxl ..\..\ComfyUI\models\clip\t5xxl_fp16.safetensors  -W 1024 -H 512 -p "Add the character to the scene  <lora:character_5000:1>" -r balloon.png -r boy.png --cfg-scale 1 --sampling-method euler --color --lora-model-dir ..\..\ComfyUI\models\loras --diffusion-fa -v --offload-to-cpu

#diffusion_model|lora_A+lora_B|hf
# https://huggingface.co/eduaaart/anadearmas-flux/tree/main?show_file_info=ana_de_armas_flux_lora_v1_000002000.safetensors
.\bin\Release\sd.exe --diffusion-model  ..\models\flux1-dev-q8_0.gguf --vae ..\..\ComfyUI\models\vae\ae.sft --clip_l ..\..\ComfyUI\models\clip\clip_l.safetensors --t5xxl ..\..\ComfyUI\models\clip\t5xxl_fp16.safetensors  -p "a lovely cat holding a sign says 'flux.cpp'<lora:ana_de_armas_flux_lora_v1_000002000:1>" --cfg-scale 1.0 --sampling-method euler -v --lora-model-dir ..\..\ComfyUI\models\loras --offload-to-cpu

#diffusion_model|lokr(lokr_w1+lokr_w2+alpha)|hf
# https://huggingface.co/toxicwind/minimalclass-lokr-flux/tree/main?show_file_info=pytorch_lora_weights.safetensors
.\bin\Release\sd.exe --diffusion-model  ..\models\flux1-dev-q8_0.gguf --vae ..\..\ComfyUI\models\vae\ae.sft --clip_l ..\..\ComfyUI\models\clip\clip_l.safetensors --t5xxl ..\..\ComfyUI\models\clip\t5xxl_fp16.safetensors  -p "a lovely cat holding a sign says 'flux.cpp'<lora:minimalclass-lokr-flux:1>" --cfg-scale 1.0 --sampling-method euler -v --lora-model-dir ..\..\stable-diffusion-webui\models\Lora\  --offload-to-cpu

# Wan2.1 14B

# diffusion_model|lora_down+lora_up+diff+diff_b|original
# https://huggingface.co/vrgamedevgirl84/Wan14BT2VFusioniX/tree/main/FusionX_LoRa?show_file_info=FusionX_LoRa%2FWan2.1_T2V_14B_FusionX_LoRA.safetensors
.\bin\Release\sd.exe -M vid_gen --diffusion-model  ..\..\ComfyUI\models\diffusion_models\wan2.1-t2v-14b-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf  -p "a lovely cat<lora:Wan2.1_T2V_14B_FusionX_LoRA:1>" --cfg-scale 1.0 --steps 8 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu  --lora-model-dir ..\..\ComfyUI\models\loras


# Wan2.2 14B

# diffusion_model|lora_down+lora_up+alpha|original
# https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/tree/main/split_files/loras?show_file_info=split_files%2Floras%2Fwan2.2_t2v_lightx2v_4steps_lora_v1.1_low_noise.safetensors
.\bin\Release\sd.exe -M vid_gen --diffusion-model  ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model  ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf  -p "a lovely cat<lora:wan2.2_t2v_lightx2v_4steps_lora_v1.1_low_noise:1><lora:|high_noise|wan2.2_t2v_lightx2v_4steps_lora_v1.1_high_noise:1>" --cfg-scale 3.5 --sampling-method euler --steps 4 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 4 -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --lora-model-dir ..\..\ComfyUI\models\loras


# Qwen Image

# https://huggingface.co/dx8152/Qwen-Edit-2509-Multiple-angles/tree/main?show_file_info=%E9%95%9C%E5%A4%B4%E8%BD%AC%E6%8D%A2.safetensors
# dit|lora_A.default+lora_B.default|hf
.\bin\Release\sd.exe --diffusion-model  ..\..\ComfyUI\models\diffusion_models\Qwen-Image-Edit-2509-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\qwen_image_vae.safetensors  --qwen2vl ..\..\ComfyUI\models\text_encoders\Qwen2.5-VL-7B-Instruct-Q8_0.gguf --qwen2vl_vision ..\..\ComfyUI\models\text_encoders\Qwen2.5-VL-7B-Instruct.mmproj-Q8_0.gguf --cfg-scale 2.5 --sampling-method euler -v --offload-to-cpu --diffusion-fa --flow-shift 3 -r ..\assets\flux\flux1-dev-q8_0.png -p "Rotate the camera 45 degrees to the right.<lora:qwen_image/multiple_angles:1>"  --lora-model-dir ..\..\ComfyUI\models\loras


# https://huggingface.co/lovis93/next-scene-qwen-image-lora-2509/tree/main?show_file_info=next-scene_lora-v2-3000.safetensors
# dit|lora_A+lora_B|hf
.\bin\Release\sd.exe --diffusion-model  ..\..\ComfyUI\models\diffusion_models\Qwen-Image-Edit-2509-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\qwen_image_vae.safetensors  --qwen2vl ..\..\ComfyUI\models\text_encoders\Qwen2.5-VL-7B-Instruct-Q8_0.gguf --qwen2vl_vision ..\..\ComfyUI\models\text_encoders\Qwen2.5-VL-7B-Instruct.mmproj-Q8_0.gguf --cfg-scale 2.5 --sampling-method euler -v --offload-to-cpu --diffusion-fa --flow-shift 3 -r ..\assets\flux\flux1-dev-q8_0.png -p "Next Scene: The camera pushes in from behind the cat, showing cat gripping the rail as the storm rages and lightning illuminates his weathered face. realistic cinematic style<lora:qwen_image/next-scene_lora-v2-3000:1>"  --lora-model-dir ..\..\ComfyUI\models\loras

@Green-Sky

Green-Sky commented Nov 9, 2025

Copy link
Copy Markdown
Contributor

This lora does not use dots in the target weight names and seems to work now. 🚀
eg lora_unet_mid_block_attentions_0_transformer_blocks_0_attn1_to_k.alpha
https://huggingface.co/tianweiy/DMD2/blob/main/dmd2_sdxl_4step_lora_fp16.safetensors
(I am not sure it is this pr, but I tried it a week ago and it did not work.)

@leejet

leejet commented Nov 9, 2025

Copy link
Copy Markdown
Owner Author

This PR improves compatibility with many LoRA models.

@leejet leejet merged commit 694f0d9 into master Nov 9, 2025
9 checks passed
@leejet leejet deleted the refactor_lora branch November 16, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants