Version 2.0.1, remove some unused code and imports

This commit is contained in:
Acly
2025-02-02 20:17:51 +01:00
parent d7b18203a4
commit facd65995a
5 changed files with 22 additions and 16 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
from . import api, nodes, tile, region, nsfw, translation, krita
from . import api as api, nodes, tile, region, nsfw, translation, krita
NODE_CLASS_MAPPINGS = {
"ETN_LoadImageBase64": nodes.LoadImageBase64,
+4 -7
View File
@@ -7,7 +7,7 @@ import traceback
import re
import logging
from comfy import model_detection, supported_models
from comfy import model_detection
import comfy.utils
import folder_paths
import server
@@ -179,7 +179,6 @@ def has_invalid_filename(filename: str):
_server: server.PromptServer | None = getattr(server.PromptServer, "instance", None)
if _server is not None:
_workflow_exchange = WorkflowExchange(_server)
@_server.routes.get("/api/etn/model_info/{folder_name}")
@@ -193,10 +192,6 @@ if _server is not None:
async def api_model_info(request):
return inspect_models("checkpoints")
@_server.routes.get("/etn/model_info")
async def api_model_info(request):
return inspect_models("checkpoints")
@_server.routes.get("/api/etn/languages")
async def languages(request):
try:
@@ -231,7 +226,9 @@ if _server is not None:
folder = Path(folder_paths.folder_names_and_paths[folder_name][0][0])
total_size = int(request.headers.get("Content-Length", "0"))
logging.info(f"Uploading {filename} ({total_size/(1024**2):.1f} MB) to {folder} folder")
logging.info(
f"Uploading {filename} ({total_size / (1024**2):.1f} MB) to {folder} folder"
)
with open(folder / filename, "wb") as f:
async for chunk, _ in request.content.iter_chunks():
+8 -6
View File
@@ -85,9 +85,11 @@ class SendImageWebSocket:
[format, image, None],
server.client_id,
)
results.append(
{"source": "websocket", "content-type": f"image/{format.lower()}", "type": "output"}
)
results.append({
"source": "websocket",
"content-type": f"image/{format.lower()}",
"type": "output",
})
return {"ui": {"images": results}}
@@ -166,9 +168,9 @@ class ApplyMaskToImage:
assert mask.ndim == 3, f"Mask should have shape [B, H, W]. {mask.shape}"
assert out.ndim == 4, f"Image should have shape [B, C, H, W]. {out.shape}"
assert (
out.shape[-2:] == mask.shape[-2:]
), f"Image size {out.shape[-2:]} must match mask size {mask.shape[-2:]}"
assert out.shape[-2:] == mask.shape[-2:], (
f"Image size {out.shape[-2:]} must match mask size {mask.shape[-2:]}"
)
is_mask_batch = mask.shape[0] == out.shape[0]
# Apply each mask in the batch to its corresponding image's alpha channel
+9 -1
View File
@@ -1,12 +1,20 @@
[project]
name = "comfyui-tooling-nodes"
description = "Provides nodes and server API extensions geared towards using ComfyUI as a backend for external tools."
version = "2.0.0"
version = "2.0.1"
license = { file = "LICENSE" }
[project.urls]
Repository = "https://github.com/Acly/comfyui-tooling-nodes"
[tool.ruff]
target-version = "py311"
line-length = 100
preview = true
[tool.ruff.lint]
ignore = ["E741"]
[tool.black]
line-length = 100
preview = true
-1
View File
@@ -115,7 +115,6 @@ class ListRegionMasks:
class AttentionMask:
@classmethod
def INPUT_TYPES(s):
return {