mirror of
https://github.com/idrirap/ComfyUI-Lora-Auto-Trigger-Words.git
synced 2026-03-21 21:22:12 -03:00
fix: wrong value in clamping. feat: added an optional lora name append if empty result + updated readme
This commit is contained in:
13
utils.py
13
utils.py
@@ -205,9 +205,20 @@ def parse_selector(selector, tags_list):
|
||||
if end < 0:
|
||||
end = len(tags_list) + end
|
||||
# clamp start and end values within list boundaries
|
||||
start, end = min(start, len(tags_list)-1), min(end, len(tags_list)-1)
|
||||
start, end = min(start, len(tags_list)), min(end, len(tags_list))
|
||||
start, end = max(start, 0), max(end, 0)
|
||||
# merge all
|
||||
for i in range(start, end):
|
||||
output[i] = tags_list[i]
|
||||
return ", ".join(list(output.values()))
|
||||
|
||||
def append_lora_name_if_empty(tags_list, lora_path, enabled):
|
||||
if not enabled or len(tags_list) > 0:
|
||||
return tags_list
|
||||
print("AAA : " + lora_path)
|
||||
filename = os.path.splitext(lora_path)[0]
|
||||
filename = os.path.basename(filename)
|
||||
print("BBB : " + filename)
|
||||
|
||||
tags_list.append(filename)
|
||||
return tags_list
|
||||
Reference in New Issue
Block a user