mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-26 23:48:52 -03:00
feat: add configurable mature blur threshold setting
Add new setting 'mature_blur_level' with options PG13/R/X/XXX to control which NSFW rating level triggers blur filtering when NSFW blur is enabled. - Backend: update preview selection logic to respect threshold - Frontend: update UI components to use configurable threshold - Settings: add validation and normalization for mature_blur_level - Tests: add coverage for new threshold behavior - Translations: add keys for all supported languages Fixes #867
This commit is contained in:
@@ -265,6 +265,32 @@ def test_delete_setting(manager):
|
||||
assert manager.get("example") is None
|
||||
|
||||
|
||||
def test_missing_mature_blur_level_defaults_to_r(tmp_path, monkeypatch):
|
||||
manager = _create_manager_with_settings(
|
||||
tmp_path,
|
||||
monkeypatch,
|
||||
{
|
||||
"blur_mature_content": True,
|
||||
"folder_paths": {},
|
||||
},
|
||||
)
|
||||
|
||||
assert manager.get("mature_blur_level") == "R"
|
||||
|
||||
|
||||
def test_invalid_mature_blur_level_is_normalized_to_r(tmp_path, monkeypatch):
|
||||
manager = _create_manager_with_settings(
|
||||
tmp_path,
|
||||
monkeypatch,
|
||||
{
|
||||
"mature_blur_level": "unsafe",
|
||||
"folder_paths": {},
|
||||
},
|
||||
)
|
||||
|
||||
assert manager.get("mature_blur_level") == "R"
|
||||
|
||||
|
||||
def test_model_name_display_setting_notifies_scanners(tmp_path, monkeypatch):
|
||||
initial = {
|
||||
"libraries": {"default": {"folder_paths": {}, "default_lora_root": "", "default_checkpoint_root": "", "default_embedding_root": ""}},
|
||||
|
||||
Reference in New Issue
Block a user