lllyasviel / lllyasviel/stable-diffusion-webui-forge

lora加载错误

Open
#2,957 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### 问题描述
当提示词中包含 **不存在的 LoRA(如 `` 或 ``)时,整个 LoRA 系统崩溃,导致:
1. 所有 LoRA 失效(画风回归底模)
2. 控制台抛出 `AttributeError` 错误
3. 触发虚假的 VRAM 不足警告

### 重现步骤
1. 在提示词中添加任意不存在 LoRA:``
2. 添加一个有效 LoRA(如 ``)
3. 生成图像 → 有效 LoRA 未被加载

### 错误日志
```python
# 关键错误片段
AttributeError: 'NoneType' object has no attribute 'filename'
File "extensions-builtin\sd_forge_lora\networks.py", line 63
net.mtime = os.path.getmtime(network_on_disk.filename)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with extensions-builtin\sd_forge_lora\networks.py at line 63 and reproduce the failure using an invalid LoRA followed by a valid one. Check the handling of the NoneType value and confirm completion by ensuring invalid LoRAs no longer raise AttributeError, valid LoRAs still load, and the false VRAM warning is absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.