From 9ef5bca4b157e7991e1a6cf8538576afec5b5782 Mon Sep 17 00:00:00 2001 From: StableLlama Date: Thu, 26 Mar 2026 22:22:29 +0100 Subject: [PATCH] Enhance launch configurations for pytest and update alpha channel image creation in PathSaveImageRGBA to remove a warning --- .vscode/launch.json | 45 +++++++++++++++++++++++++++ src/basic_data_handling/path_nodes.py | 4 +-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index b50b37a..27c9a00 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,6 +9,51 @@ "type": "debugpy", "request": "launch", "program": "${file}" + }, + { + "name": "Python: pytest all tests", + "type": "python", + "request": "launch", + "module": "pytest", + "args": ["tests"], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal" + }, + { + "name": "Python: pytest test_data_list_nodes.py", + "type": "python", + "request": "launch", + "module": "pytest", + "args": ["tests/test_data_list_nodes.py"], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal" + }, + { + "name": "Python: pytest tests.test_data_list_nodes.test_create_from_int", + "type": "python", + "request": "launch", + "module": "pytest", + "args": ["-k", "test_create_from_int", "tests/test_data_list_nodes.py"], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal" + }, + { + "name": "Python: pytest tests.test_data_list_nodes.test_shuffle", + "type": "python", + "request": "launch", + "module": "pytest", + "args": ["-k", "test_shuffle", "tests/test_data_list_nodes.py"], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal" + }, + { + "name": "Python: pytest tests.test_list_nodes.test_shuffle", + "type": "python", + "request": "launch", + "module": "pytest", + "args": ["-k", "test_shuffle", "tests/test_list_nodes.py"], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal" } ] } \ No newline at end of file diff --git a/src/basic_data_handling/path_nodes.py b/src/basic_data_handling/path_nodes.py index ea6dbad..14926d8 100644 --- a/src/basic_data_handling/path_nodes.py +++ b/src/basic_data_handling/path_nodes.py @@ -1141,8 +1141,8 @@ class PathSaveImageRGBA(ComfyNodeABC): # Create PIL image (RGB) pil_img = Image.fromarray(img_np) - # Create alpha channel image - alpha_img = Image.fromarray(alpha_np, mode='L') + # Create alpha channel image (avoid deprecated 'mode' kwarg in Pillow 13+) + alpha_img = Image.fromarray(alpha_np).convert("L") # Convert to RGBA and add alpha channel pil_img_rgba = pil_img.convert("RGBA")