mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-09 20:39:25 -03:00
feat(ui): merge user tags into auto-tag badges and refresh on tag edit (#918)
- Layer 2 fallback: user tags overlapping with auto-tag categories (HIGH/LOW/I2V/T2V/TI2V/Lightning/Turbo) are merged into auto_tags, providing manual override when filename-based detection fails. Matching is case-insensitive so "high"/"High"/"HIGH" all work. - Refresh on tag edit: save_metadata and add_tags handlers now return recalculated auto_tags in the response; the frontend passes them to VirtualScroller.updateSingleItem so badges update immediately without requiring a page reload. - 8 new test cases for Layer 2 fallback and case-insensitive matching.
This commit is contained in:
@@ -255,7 +255,7 @@ def test_tag_update_service_adds_unique_tags(tmp_path: Path) -> None:
|
||||
cache_updates.append(metadata)
|
||||
return True
|
||||
|
||||
tags = asyncio.run(
|
||||
tags, auto_tags = asyncio.run(
|
||||
service.add_tags(
|
||||
file_path=str(tmp_path / "model.safetensors"),
|
||||
new_tags=["new", "existing"],
|
||||
@@ -265,5 +265,6 @@ def test_tag_update_service_adds_unique_tags(tmp_path: Path) -> None:
|
||||
)
|
||||
|
||||
assert tags == ["existing", "new"]
|
||||
assert auto_tags == []
|
||||
assert manager.saved
|
||||
assert cache_updates
|
||||
|
||||
Reference in New Issue
Block a user