diff --git a/README.MD b/README.MD index 9005f8e..01b5bb3 100644 --- a/README.MD +++ b/README.MD @@ -147,6 +147,7 @@ When this error has occurred, please check the network environment. **If the dependency package error after updating, please double clicking ```repair_dependency.bat``` (for Official ComfyUI Protable) or ```repair_dependency_aki.bat``` (for ComfyUI-aki-v1.x) in the plugin folder to reinstall the dependency packages.
+* Support numpy 2.x dependency package. * Commit [PurgeVRAM V2](#PurgeVRAMV2) node. * Commit [ChoiceTextPreset](#ChoiceTextPreset) and [TextPreseter](#TextPreseter) nodes, used for preset text and selecting preset text output. * [StringCondition](#StringCondition) add the option of comparing strings to determine if they are the same. diff --git a/README_CN.MD b/README_CN.MD index 738083d..7799f49 100644 --- a/README_CN.MD +++ b/README_CN.MD @@ -128,6 +128,7 @@ os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com' ## 更新说明 **如果本插件更新后出现依赖包错误,请双击运行插件目录下的```install_requirements.bat```(官方便携包),或 ```install_requirements_aki.bat```(秋叶整合包) 重新安装依赖包。 +* 支持numpy 2.x依赖包。 * 添加 [PurgeVRAM V2](#PurgeVRAMV2) 节点,不强制执行,增加any输出,便于在流程中灵活释放显存。 * 添加 [ChoiceTextPreset](#ChoiceTextPreset) 和 [TextPreseter](#TextPreseter) 节点,用于预设文本和选择预设文本输出。 * [StringCondition](#StringCondition) 节点增加比较字符串是否相同功能。 diff --git a/py/imagefunc.py b/py/imagefunc.py index 7835288..f9ec0ad 100644 --- a/py/imagefunc.py +++ b/py/imagefunc.py @@ -374,13 +374,10 @@ def chop_image(background_image:Image, layer_image:Image, blend_mode:str, opacit def chop_image_v2(background_image:Image, layer_image:Image, blend_mode:str, opacity:int) -> Image: - backdrop_prepped = np.asfarray(background_image.convert('RGBA')) - source_prepped = np.asfarray(layer_image.convert('RGBA')) + backdrop_prepped = np.asarray(background_image.convert('RGBA'), dtype=float) + source_prepped = np.asarray(layer_image.convert('RGBA'), dtype=float) blended_np = BLEND_MODES[blend_mode](backdrop_prepped, source_prepped, opacity / 100) - # final_tensor = (torch.from_numpy(blended_np / 255)).unsqueeze(0) - # return tensor2pil(_tensor) - return Image.fromarray(np.uint8(blended_np)).convert('RGB') def remove_background(image:Image, mask:Image, color:str) -> Image: diff --git a/pyproject.toml b/pyproject.toml index 39726bc..79801b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [project] name = "comfyui_layerstyle" description = "A set of nodes for ComfyUI it generate image like Adobe Photoshop's Layer Style. the Drop Shadow is first completed node, and follow-up work is in progress." -version = "2.0.15" -license = "MIT" +version = "2.0.16" +license = {text = "MIT License"} dependencies = ["numpy", "pillow", "torch", "matplotlib", "Scipy", "scikit_image", "scikit_learn", "opencv-contrib-python", "pymatting", "timm", "colour-science", "transformers", "blend_modes", "huggingface_hub", "loguru"] [project.urls] diff --git a/repair_dependency_list.txt b/repair_dependency_list.txt index 71c826a..55da1bf 100644 --- a/repair_dependency_list.txt +++ b/repair_dependency_list.txt @@ -1,2 +1 @@ -numpy<2 opencv-contrib-python>=4.9.0.80 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 834671b..3950f3b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -numpy<2.0 +numpy pillow torch matplotlib