Comfy-Org / Comfy-Org/ComfyUI

RAM is loaded too much(>33gb) while using LoRA with flux dev. When Lora is not used - RAM loaded only for 2gb.

Open
#7,176 4 comments 3 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

Hi, after explicit debugging I found a source in here:
https://github.com/comfyanonymous/ComfyUI/blob/b779349b55e79aff81a98b752f5cb486c71812db/comfy/model_patcher.py#L669

It works differently when I am using LoRA and when I am not. It moves to cuda by running x[2].to(device_to) 0gb when I am using LoRA, and moves a lot(around 22gb) when I am not using LoRA.

Please let me know how to fix it.

Connected issue: https://github.com/comfyanonymous/ComfyUI/issues/4343

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.