Add route and matting integration tests; update coverage config and CI

This commit is contained in:
Dariusz L
2026-08-15 00:09:08 +02:00
parent 4e660353b9
commit e40395c91a
11 changed files with 345 additions and 21 deletions
+1 -1
View File
@@ -355,8 +355,8 @@ def register_matting_routes():
__all__ = [
"check_matting_model",
"get_matting_settings",
"get_matting_progress",
"get_matting_settings",
"matting",
"register_matting_routes",
"save_matting_settings",
+2 -2
View File
@@ -8,9 +8,9 @@ from ..catalog import (
_BIREFNET_DEFAULT_LOCAL_FILENAME,
_BIREFNET_FILENAME,
_BIREFNET_MODEL_CATALOG,
_BIREFNET_REMOTE_PREFIX,
_BIREFNET_REPOSITORY,
_BIREFNET_REQUIRED_KEYS,
_BIREFNET_REMOTE_PREFIX,
)
from ..paths import (
_get_birefnet_base_paths,
@@ -238,8 +238,8 @@ __all__ = [
"_find_existing_birefnet_default_checkpoint",
"_find_existing_birefnet_remote_checkpoint",
"_find_local_birefnet_model",
"_get_comfy_birefnet_loader",
"_get_birefnet_remote_model",
"_get_comfy_birefnet_loader",
"_is_native_birefnet_checkpoint",
"_iter_birefnet_checkpoint_paths",
]
+1 -1
View File
@@ -307,7 +307,7 @@ __all__ = [
"_find_local_rmbg_model",
"_get_rmbg_model_loader",
"_get_rmbg_model_status_message",
"_get_rmbg_transformers_status",
"_get_rmbg_remote_model",
"_get_rmbg_transformers_status",
"_is_rmbg_model_directory",
]
+7 -2
View File
@@ -9,8 +9,13 @@ from .backends.birefnet import (
_iter_birefnet_checkpoint_paths,
)
from .backends.rmbg import _find_existing_rmbg_model
from .catalog import _BIREFNET_MODEL_CATALOG, _BIREFNET_PROJECT_URL, _BIREFNET_REMOTE_PREFIX
from .catalog import _RMBG_MODEL_CATALOG, _RMBG_REMOTE_PREFIX
from .catalog import (
_BIREFNET_MODEL_CATALOG,
_BIREFNET_PROJECT_URL,
_BIREFNET_REMOTE_PREFIX,
_RMBG_MODEL_CATALOG,
_RMBG_REMOTE_PREFIX,
)
from .paths import _get_birefnet_base_paths, _get_managed_birefnet_paths, _get_rmbg_model_roots
+1 -2
View File
@@ -4,8 +4,7 @@ import os
import folder_paths
from .catalog import _BIREFNET_DEFAULT_LOCAL_FILENAME, _BIREFNET_MODEL_CATALOG
from .catalog import _RMBG_MODEL_CATALOG
from .catalog import _BIREFNET_DEFAULT_LOCAL_FILENAME, _BIREFNET_MODEL_CATALOG, _RMBG_MODEL_CATALOG
def _get_birefnet_base_paths():
+8 -6
View File
@@ -3,7 +3,6 @@
import threading
import time
_MIN_PROGRESS_INTERVAL = 0.1
_MIN_PROGRESS_DELTA = 0.5
_PROGRESS_STATE_TTL = 120.0
@@ -134,10 +133,13 @@ class MattingProgressAdapter:
)
now = time.monotonic()
if not force and progress < 100.0:
if now - self.last_report_time < _MIN_PROGRESS_INTERVAL:
if abs(progress - self.last_reported) < _MIN_PROGRESS_DELTA:
return
if (
not force
and progress < 100.0
and now - self.last_report_time < _MIN_PROGRESS_INTERVAL
and abs(progress - self.last_reported) < _MIN_PROGRESS_DELTA
):
return
self.last_reported = progress
self.last_report_time = now
@@ -231,9 +233,9 @@ def call_huggingface_download(download_function, download_kwargs, model_label, n
__all__ = [
"MattingProgressAdapter",
"call_huggingface_download",
"create_huggingface_tqdm_class",
"get_matting_status",
"MattingProgressAdapter",
"send_matting_status",
]
-1
View File
@@ -9,7 +9,6 @@ import threading
from pathlib import Path
from typing import Any, Mapping
SETTINGS_FILE = Path(__file__).resolve().parents[2] / "layerforge_settings.json"
DEFAULT_SETTINGS = {
"model_path": "",
+1 -1
View File
@@ -7,8 +7,8 @@ from aiohttp import web
from PIL import Image
from server import PromptServer
from .matting.api import register_matting_routes
from .image_serialization import file_to_data_url, pil_to_data_url
from .matting.api import register_matting_routes
from .node import log