mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-09-21 03:01:27 -03:00
84146b62fd
Other Models management is opt-in and its folders come from folder_paths.get_folder_paths(). In plugin mode ComfyUI registers vae, upscale_models, text_encoders, clip_vision and controlnet out of the box, so enabling the feature works immediately. Standalone only knows the keys present in settings.json.folder_paths, and that file is edited by hand - there is no UI for those keys - so a standalone user who followed the announcement banner reached "Enable Other Models" and then an empty page. Gate the announcement on the capability instead of on how the process was started: - Config.get_other_models_availability() probes every canonical other key (legacy clip collapses into text_encoders where the host exposes map_legacy) and reports which sub_types resolve to a folder that exists on disk. It deliberately ignores enable_other_models: the question is "could this work here at all?". An empty folder counts, because CivitAI downloads can target it. - /api/lm/settings exposes it as the derived, non-persisted other_models_paths_available flag; a probe failure yields null and the banner fails open. - BannerService only registers the announcement when the flag is not false. `=== false` (not falsy) keeps a cached/older payload working, and nothing is written to dismissed_banners, so the banner can return once folders exist. - The Other page grows an "enabled but nothing to scan" empty state driven by config.other_roots, showing the settings.json snippet for standalone and a pointer to ComfyUI model paths otherwise, plus an Open Settings action. It also covers the corner where only a non-default sub_type has a folder. Translate the six other.noPaths.* keys into all nine locales and record the new "folder key" / "on disk" terminology in the i18n guidelines. Backend tests and pytest tests/i18n could not run in this environment (no pytest/platformdirs); the probe was exercised against a stubbed folder_paths. Frontend: 120 files / 1101 JS tests passed.
73 lines
1.9 KiB
Plaintext
73 lines
1.9 KiB
Plaintext
# serializer version: 1
|
|
# name: TestModelLibraryHandlerSnapshots.test_check_model_exists_empty_response
|
|
dict({
|
|
'downloadedVersionIds': list([
|
|
]),
|
|
'modelType': None,
|
|
'success': True,
|
|
'versions': list([
|
|
]),
|
|
})
|
|
# ---
|
|
# name: TestNodeRegistryHandlerSnapshots.test_register_nodes_error_response
|
|
dict({
|
|
'message': '0 nodes registered successfully',
|
|
'success': True,
|
|
})
|
|
# ---
|
|
# name: TestNodeRegistryHandlerSnapshots.test_register_nodes_success_response
|
|
dict({
|
|
'message': '1 nodes registered successfully',
|
|
'success': True,
|
|
})
|
|
# ---
|
|
# name: TestSettingsHandlerSnapshots.test_get_settings_response_format
|
|
dict({
|
|
'messages': list([
|
|
]),
|
|
'settings': dict({
|
|
'civitai_api_key_set': True,
|
|
'language': 'en',
|
|
'llm_api_key_set': False,
|
|
'other_models_paths_available': False,
|
|
'theme': 'dark',
|
|
}),
|
|
'success': True,
|
|
})
|
|
# ---
|
|
# name: TestSettingsHandlerSnapshots.test_update_settings_success_response
|
|
dict({
|
|
'success': True,
|
|
})
|
|
# ---
|
|
# name: TestUtilityFunctionSnapshots.test_calculate_recipe_fingerprint_various_inputs
|
|
list([
|
|
'',
|
|
'abc123:1.0',
|
|
'abc123:1.0|def456:0.75',
|
|
'abc123:0.5|def456:1.0',
|
|
'abc123:0.8',
|
|
'12345:1.0',
|
|
'',
|
|
'',
|
|
'',
|
|
])
|
|
# ---
|
|
# name: TestUtilityFunctionSnapshots.test_sanitize_folder_name_various_inputs
|
|
dict({
|
|
'': '',
|
|
' spaces ': 'spaces',
|
|
'___underscores___': 'underscores',
|
|
'folder with spaces': 'folder with spaces',
|
|
'folder"with"quotes': 'folder_with_quotes',
|
|
'folder*with*asterisks': 'folder_with_asterisks',
|
|
'folder.with.dots': 'folder.with.dots',
|
|
'folder/with/slashes': 'folder_with_slashes',
|
|
'folder<with>brackets': 'folder_with_brackets',
|
|
'folder?with?questions': 'folder_with_questions',
|
|
'folder\\with\\backslashes': 'folder_with_backslashes',
|
|
'folder|with|pipes': 'folder_with_pipes',
|
|
'normal_folder': 'normal_folder',
|
|
})
|
|
# ---
|