mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-07-13 20:21:16 -03:00
fix(preview): hide license icons for models without CivitAI metadata
This commit is contained in:
@@ -1313,9 +1313,20 @@ class ModelQueryHandler:
|
|||||||
}
|
}
|
||||||
if include_license_flags:
|
if include_license_flags:
|
||||||
model_data = await self._service.get_model_info_by_name(model_name)
|
model_data = await self._service.get_model_info_by_name(model_name)
|
||||||
license_flags = (model_data or {}).get("license_flags")
|
# Only return license_flags when real CivitAI model license
|
||||||
if license_flags is not None:
|
# data exists. This mirrors ModelModal's guard
|
||||||
response_payload["license_flags"] = int(license_flags)
|
# (modelData?.civitai?.model) so the preview tooltip never
|
||||||
|
# shows misleading license icons for HF or other models
|
||||||
|
# without actual license metadata.
|
||||||
|
civitai_data = (model_data or {}).get("civitai") or {}
|
||||||
|
has_license_data = (
|
||||||
|
isinstance(civitai_data, dict)
|
||||||
|
and isinstance(civitai_data.get("model"), dict)
|
||||||
|
)
|
||||||
|
if has_license_data:
|
||||||
|
license_flags = (model_data or {}).get("license_flags")
|
||||||
|
if license_flags is not None:
|
||||||
|
response_payload["license_flags"] = int(license_flags)
|
||||||
# Include the user's license icon style preference so the
|
# Include the user's license icon style preference so the
|
||||||
# ComfyUI tooltip can pick the right set without a separate
|
# ComfyUI tooltip can pick the right set without a separate
|
||||||
# API call.
|
# API call.
|
||||||
|
|||||||
Reference in New Issue
Block a user