Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed cr load lora loaded_lora deletion #140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Surdjak
Copy link

@Surdjak Surdjak commented Mar 17, 2024

Deleting self.loaded_lora effectively remove the member from the class.
Not an issue in most cases as the following lines will reattribute it with the new loaded LoRA.
But if self.load_lora wasn't None, different from lora_path and lora_path is an invalid path, then the deletion happen but no new value is attributed to self.load_lora as comfy.utils.load_torch_file() fails and crash.
Then at the next execution, since self.loaded_lora does not exists, the check for self.load_lora is not None crash.
What it means in practice is that loading a valid lora, then trying to load an incorrect one will lock the node in a invalid state until the node is reinitialized (deleted/recreated) or if the UI is restarted.
The solution is to replace the deletion with an attribution to None.

Deleting self.loaded_lora effectively remove the member from the class.
Not an issue in most cases as the following lines will reattribute it with the new loaded LoRA.
But if self.load_lora wasn't None, different from lora_path and lora_path is an invalid path, then the deletion happen but no new value is attributed to self.load_lora as comfy.utils.load_torch_file() failes. 
Then at the next execution, since self.loaded_lora does not exists, the check for self.load_lora is not None crash.
The solution is to replace the deletion with an attribution to None.
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.

None yet

1 participant