Skip to content

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

Merged
AUTOMATIC1111 merged 1 commit into
AUTOMATIC1111:devfrom
akx:dont-die-on-bad-symlink-lora
Jun 9, 2023
Merged

Don't die when a LoRA is a broken symlink#11123
AUTOMATIC1111 merged 1 commit into
AUTOMATIC1111:devfrom
akx:dont-die-on-bad-symlink-lora

Conversation

@akx

@akx akx commented Jun 9, 2023

Copy link
Copy Markdown
Collaborator

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:

@akx akx requested a review from AUTOMATIC1111 as a code owner June 9, 2023 10:28
@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