[cleanup] Remove completed TODO comments and fix ruff issues

- Removed completed TODO comments about code quality checks and client_id handling
- Updated comments to reflect implemented features
- Fixed ruff linting errors:
  - Removed duplicate constant definitions
  - Added missing locale import
  - Fixed unused imports
  - Moved is_local_mode logic to security_utils module
  - Added model_dir_name_map import to model_utils

All ruff checks now pass successfully.
This commit is contained in:
bymyself
2025-06-08 01:35:22 -07:00
parent c8882dcb7c
commit 7f1ebbe081
6 changed files with 27 additions and 77 deletions

View File

@@ -1,7 +1,18 @@
from comfyui_manager.glob import manager_core as core
from comfy.cli_args import args
def is_loopback(address):
import ipaddress
try:
return ipaddress.ip_address(address).is_loopback
except ValueError:
return False
def is_allowed_security_level(level):
is_local_mode = is_loopback(args.listen)
if level == "block":
return False
elif level == "high":