We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d39440b commit e4726ccCopy full SHA for e4726cc
modules/sd_models.py
@@ -49,11 +49,12 @@ class CheckpointInfo:
49
def __init__(self, filename):
50
self.filename = filename
51
abspath = os.path.abspath(filename)
52
+ abs_ckpt_dir = os.path.abspath(shared.cmd_opts.ckpt_dir) if shared.cmd_opts.ckpt_dir is not None else None
53
54
self.is_safetensors = os.path.splitext(filename)[1].lower() == ".safetensors"
55
- if shared.cmd_opts.ckpt_dir is not None and abspath.startswith(shared.cmd_opts.ckpt_dir):
56
- name = abspath.replace(shared.cmd_opts.ckpt_dir, '')
+ if abs_ckpt_dir and abspath.startswith(abs_ckpt_dir):
57
+ name = abspath.replace(abs_ckpt_dir, '')
58
elif abspath.startswith(model_path):
59
name = abspath.replace(model_path, '')
60
else:
0 commit comments