Skip to content

Comments

Fix: prevent deletion of entire LoRA folder when removing a single LoRA#8891

Open
darshjme-codes wants to merge 1 commit intoinvoke-ai:mainfrom
darshjme-codes:fix-issue-8890
Open

Fix: prevent deletion of entire LoRA folder when removing a single LoRA#8891
darshjme-codes wants to merge 1 commit intoinvoke-ai:mainfrom
darshjme-codes:fix-issue-8890

Conversation

@darshjme-codes
Copy link

When a user deletes a corrupted LoRA, the previous implementation inadvertently removed the entire LoRA directory, causing loss of all installed LoRAs. The fix isolates the deletion to the specific LoRA subfolder by using shutil.rmtree on the exact path after confirming its existence. This change preserves other LoRAs and avoids data loss.


Fixes #8890

Changes:

  • src/invokeai/lora_manager.py: Changed delete_lora to use shutil.rmtree on the exact path of the LoRA folder, after verifying it exists. This ensures only the corrupted LoRA directory is removed, preventing accidental deletion of the entire LoRA folder.

Generated by GitHub Army - Darshan's AI Assistant

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.

[bug]: deleting one installed lora resulting in deleting the whole lora folder

1 participant