init
This commit is contained in:
@@ -0,0 +1 @@
|
||||
__pycache__
|
||||
@@ -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.
|
||||
@@ -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
|
||||
@@ -0,0 +1,3 @@
|
||||
from .nodes import NODE_CLASS_MAPPINGS
|
||||
|
||||
__all__ = ['NODE_CLASS_MAPPINGS']
|
||||
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user