From 8989bf43ff625020cf04bd1346c1840b4d499829 Mon Sep 17 00:00:00 2001 From: Marvin Weigand Date: Mon, 15 Jul 2024 15:19:43 +0200 Subject: [PATCH] Add pyproject.toml and requirements.txt for ColorImageDetection package --- .github/workflows/publish_action.yml | 20 ++++++++++++++++++++ pyproject.toml | 26 ++++++++++++++++++++++++++ requirements.txt | 3 +++ 3 files changed, 49 insertions(+) create mode 100644 .github/workflows/publish_action.yml create mode 100644 pyproject.toml create mode 100644 requirements.txt diff --git a/.github/workflows/publish_action.yml b/.github/workflows/publish_action.yml new file mode 100644 index 0000000..e3c5c78 --- /dev/null +++ b/.github/workflows/publish_action.yml @@ -0,0 +1,20 @@ +name: Publish to Comfy registry +on: + workflow_dispatch: + push: + branches: + - main + paths: + - "pyproject.toml" + +jobs: + publish-node: + name: Publish Custom Node to registry + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Publish Custom Node + uses: Comfy-Org/publish-node-action@main + with: + personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} ## Add your own personal access token to your Github Repository secrets and reference it here. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ef7a5f9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +# pyproject.toml +[project] +name = "ColorImageDetection" # Unique identifier for your node. Immutable after creation. +description = """ +A Python package for detecting whether images are colored or black and white using two different color spaces: RGB and LAB. +The package includes two classes: +- `ColorDetection`: Analyzes images in the RGB color space, calculating mean deviation from pixel color mean to determine color presence. +- `LABColorDetection`: Analyzes images in the LAB color space, assessing color presence by analyzing differences between the A and B channels. + +Features: +- Detects colored vs. black and white images. +- Supports analysis of image tensors. +- Adjustable thresholds for color detection. +- Uses a percentage of highest deviations for more robust detection. +- Efficient processing with PyTorch and OpenCV integration. +""" +version = "1.0.0" # Custom Node version. Must be semantically versioned. +dependencies = [] # Filled in from requirements.txt + +[project.urls] +Repository = "https://github.com/..." + +[tool.comfy] +PublisherId = "drunreal" # TODO (fill in Publisher ID from Comfy Registry Website). +DisplayName = "Color Image Detection" # Display name for the Custom Node. Can be changed later. +Icon = "https://www.mws.biz/wp-content/uploads/2021/02/cropped-MWSoftwareFavicon-1-180x180.png" # SVG, PNG, JPG or GIF (MAX. 800x400px) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..51f8e7a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +numpy +torch +opencv-python \ No newline at end of file