Centralize MIME type initialization into utils/mime_types.py

Move mimetypes.init() and all custom type registrations from server.py
and metadata_extract.py into a single init_mime_types() function called
once at startup in main.py.

Amp-Thread-ID: https://ampcode.com/threads/T-019cbb2a-513a-7458-9962-b4100e4f124d
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Luke Mino-Altherr
2026-03-04 15:31:08 -08:00
parent ba30d76d36
commit 788a98f294
4 changed files with 39 additions and 31 deletions

View File

@@ -10,6 +10,7 @@ from app.logger import setup_logger
from app.assets.seeder import asset_seeder
import itertools
import utils.extra_config
from utils.mime_types import init_mime_types
import logging
import sys
from comfy_execution.progress import get_progress_state
@@ -162,6 +163,7 @@ def execute_prestartup_script():
logging.info("")
apply_custom_paths()
init_mime_types()
if args.enable_manager:
comfyui_manager.prestartup()