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

Don't die when a LoRA is a broken symlink #11123

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

akx
Copy link
Collaborator

@akx akx commented Jun 9, 2023

Description

  • a simple description of what you're trying to accomplish: when a LoRA is a broken symlink, it can be enumerated fine, but attempting to read it (for hashing) will crash.
  • which issues it fixes, if any: Fixes [Bug]: FileNotFoundError on broken symlinks #11098

Screenshots/videos:

*** Failed to load LoRA moop from stable-diffusion-webui/models/Lora/moop.safetensors
    Traceback (most recent call last):
      File "stable-diffusion-webui/extensions-builtin/Lora/lora.py", line 452, in list_available_loras
        entry = LoraOnDisk(name, filename)
      File "stable-diffusion-webui/extensions-builtin/Lora/lora.py", line 101, in __init__
        hashes.sha256_from_cache(self.filename, "lora/" + self.name, use_addnet_hash=self.is_safetensors) or
      File "stable-diffusion-webui/modules/hashes.py", line 51, in sha256_from_cache
        ondisk_mtime = os.path.getmtime(filename)
      File "lib/python3.10/genericpath.py", line 55, in getmtime
        return os.stat(filename).st_mtime
    FileNotFoundError: [Errno 2] No such file or directory: 'stable-diffusion-webui/models/Lora/moop.safetensors'

Checklist:

@AUTOMATIC1111 AUTOMATIC1111 merged commit b8d7506 into AUTOMATIC1111:dev Jun 9, 2023
@akx akx deleted the dont-die-on-bad-symlink-lora branch June 27, 2023 09:11
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