commit 3e6c9650f9f99e7c8b34350662c58f5bceee3e87 Author: MoBi Date: Wed Dec 13 21:00:11 2023 +0000 init diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bee8a64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f26d7a4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 modusCell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1f730b6 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Save image with generation metadata on ComfyUI + +Simple node for sharing latent image size between nodes. + + +## How to install? + +- Using CLI, go to the ComfyUI folder +- `cd custom_nodes` +- `git clone https://github.com/modusCell/ComfyUI-dimension-node-modusCell.git` +- Start/restart ComfyUI diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..9d51591 --- /dev/null +++ b/__init__.py @@ -0,0 +1,3 @@ +from .nodes import NODE_CLASS_MAPPINGS + +__all__ = ['NODE_CLASS_MAPPINGS'] diff --git a/nodes.py b/nodes.py new file mode 100644 index 0000000..1247624 --- /dev/null +++ b/nodes.py @@ -0,0 +1,32 @@ +class DimensionProvider: + def __init__(self): + pass + + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "dimension": (["512 x 512", "512 x 768", "768 x 512", "1024 x 1024", "1152 x 896", "896 x 1152", "1216 x 832", "832 x 1216", "1344 x 768", "768 x 1344", "1536 x 640", "640 x 1536"],), + }, + } + + RETURN_TYPES = ("INT", "INT") + RETURN_NAMES = ("width", "height") + FUNCTION = "prodvide_dimensions" + OUTPUT_NODE = True + CATEGORY = "DimensionProvider" + + def prodvide_dimensions(self, dimension): + dims = ["512x512", "512x768", "768x512", "1024x1024", "1152x896", "896x1152", "1216x832", "832x1216", "1344x768", "768x1344", "1536x640", "640x1536"] + index = dims.index(dimension.replace(" ", "")) + img_dims = dimension.split("x") + return (int(img_dims[0]), int(img_dims[1])) + + +NODE_CLASS_MAPPINGS = { + "DimensionProvider modusCell": DimensionProvider, +} + +NODE_DISPLAY_NAME_MAPPINGS = { + "DimensionProvider": "Width and Height Node" +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29