initial
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
__Please attach a workflow file to make it easier for others to reproduce the error!__
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Version:**
|
||||
- ComfyUI Version
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
cover/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
db.sqlite3-journal
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
.pybuilder/
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# IPython
|
||||
profile_default/
|
||||
ipython_config.py
|
||||
|
||||
# pyenv
|
||||
# For a library or package, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# .python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# poetry
|
||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||
# commonly ignored for libraries.
|
||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||
#poetry.lock
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||
__pypackages__/
|
||||
|
||||
# Celery stuff
|
||||
celerybeat-schedule
|
||||
celerybeat.pid
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
# pytype static type analyzer
|
||||
.pytype/
|
||||
|
||||
# Cython debug symbols
|
||||
cython_debug/
|
||||
|
||||
# PyCharm
|
||||
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
|
||||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
*.pyc
|
||||
|
||||
.idea
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Crystian
|
||||
|
||||
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,511 @@
|
||||
# ComfyUI-Crystools [](https://hits.seeyoufarm.com) [](https://paypal.me/crystian77)
|
||||
|
||||
**_A powerful set of tools for your belt when you work with ComfyUI_**
|
||||
|
||||
You can see the metadata and compare between two images, compare between two JSONs, show any value to console/display, pipes, and more!
|
||||
This provides a better nodes to load images, previews, etc, and see "hidden" data, but without load a new workflow.
|
||||
|
||||

|
||||
|
||||
# Table of contents
|
||||
|
||||
- [Metadata](#metadata)
|
||||
- [Debugger](#debugger)
|
||||
- [Image](#image)
|
||||
- [Pipe](#pipe)
|
||||
- [Utils](#utils)
|
||||
- [Primitives](#primitives)
|
||||
- [List](#list)
|
||||
- [Switch](#switch)
|
||||
- Others: [About](#about), [To do](#to-do), [Changelog](#changelog), [Installation](#installation), [Use](#use)
|
||||
|
||||
---
|
||||
|
||||
## Metadata
|
||||
|
||||
### Node: Metadata extractor
|
||||
|
||||
This node is used to extract the metadata from the image and handle it as a JSON as source for other nodes.
|
||||
You can see **all information**, even metadata from others sources (like photoshop, see sample).
|
||||
|
||||
The input comes from the [load image with metadata](#node-load-image-with-metadata) or [preview from image](#node-preview-from-image) nodes (an others in the future).
|
||||
|
||||

|
||||
|
||||
**Sample:** [metadata-extractor.json](./samples/metadata-extractor.json)
|
||||
|
||||
><details>
|
||||
> <summary>Other metadata sample (photoshop)</summary>
|
||||
>
|
||||
> With metadata from Photoshop
|
||||

|
||||
></details>
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - input:
|
||||
> - metadata_raw: The metadata raw from the image or preview node
|
||||
> - Output:
|
||||
> - prompt: The prompt used to produce the image.
|
||||
> - workflow: The workflow used to produce the image (all information about nodes, values, etc).
|
||||
> - file info: The file info of the image/metadata (resolution, size, etc) as human readable.
|
||||
> - raw to JSON: The entire metadata raw but formatted/readable.
|
||||
> - raw to property: The entire metadata raw as "properties" format.
|
||||
> - raw to csv: The entire metadata raw as "csv" format.
|
||||
></details>
|
||||
|
||||
<br />
|
||||
|
||||
### Node: Metadata comparator
|
||||
|
||||
This node is so useful to compare two metadata and see the differences (**the main reason why I created this extension!**)
|
||||
|
||||
You can compare 3 inputs: "Prompt", "Workflow" and "Fileinfo"
|
||||
|
||||
There are tree potential "outputs": `values_changed`, `dictionary_item_added`, `dictionary_item_removed` (in this order of priority).
|
||||
|
||||

|
||||
|
||||
**Sample:** [metadata-comparator.json](./samples/metadata-comparator.json)
|
||||
|
||||
**Notes:**
|
||||
- I use [DeepDiff](https://pypi.org/project/deepdiff) for that, for more info check the link.
|
||||
- If you want to compare two JSONs, you can use the [JSON comparator](#node-JSON-comparator) node.
|
||||
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - options:
|
||||
> - what: What to compare, you can choose between "Prompt", "Workflow" and "Fileinfo"
|
||||
> - input:
|
||||
> - metadata_raw_old: The metadata raw to start compare
|
||||
> - metadata_raw_new: The metadata raw to compare
|
||||
> - Output:
|
||||
> - diff: This is the same output you can see in the display of the node, you can use it on others nodes.
|
||||
></details>
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
|
||||
## Debugger
|
||||
|
||||
### Node: Show Metadata
|
||||
|
||||
With this node, you will be able to see the JSON produced from your entire prompt and workflow so that you can really know all the values (and more) of your prompt quickly without the need to open the file (PNG or JSON).
|
||||
|
||||

|
||||
|
||||
**Sample:** [debugger-metadata.json](./samples/debugger-metadata.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - Options:
|
||||
> - Active: Enable/disable the node
|
||||
> - Parsed: Show the parsed JSON or plain text
|
||||
> - What: Show the prompt or workflow (prompt are values to produce the image, and workflow is the entire workflow of ComfyUI)
|
||||
></details>
|
||||
|
||||
<br />
|
||||
|
||||
### Node: Show any
|
||||
|
||||
You can see on the console or display any text or data from the nodes. Connect it to what you want to inspect, and you will see it.
|
||||
|
||||

|
||||
|
||||
**Sample:** [debugger-any.json](./samples/debugger-any.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - Input:
|
||||
> - any_value: Any value to show, can be a string, number, etc.
|
||||
> - Options:
|
||||
> - Console: Enable/disable write to console
|
||||
> - Display: Enable/disable write on this node
|
||||
> - Prefix: Prefix to console
|
||||
></details>
|
||||
|
||||
<br />
|
||||
|
||||
### Node: Show any to JSON
|
||||
|
||||
As same the previous one, but it formatted the value to JSON (only display).
|
||||
|
||||

|
||||
|
||||
**Sample:** [debugger-json.json](./samples/debugger-json.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - Input:
|
||||
> - any_value: Any value to try to convert to JSON
|
||||
> - Output:
|
||||
> - string: The same string is shown on display
|
||||
></details>
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
|
||||
## Image
|
||||
|
||||
### Node: Load image with metadata
|
||||
This node is the same as the default one, but it adds three features: Prompt, Metadata, and supports **subfolders** of the "input" folder.
|
||||
|
||||

|
||||
|
||||
**Sample:** [image-load.json](./samples/image-load.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - Input:
|
||||
> - image: Read the images from the input folder (and subfolder) (you can drop the image here, or even paste an image from clipboard)
|
||||
> - Output:
|
||||
> - Image/Mask: The same as the default node
|
||||
> - Prompt: The prompt used to produce the image (not the workflow)
|
||||
> - Metadata RAW: The metadata raw of the image (full workflow) as string
|
||||
></details>
|
||||
|
||||
**Note:** The subfolders support inspired on: [comfyui-imagesubfolders](https://github.com/catscandrive/comfyui-imagesubfolders)
|
||||
|
||||
<br />
|
||||
|
||||
### Node: Save image with extra metadata
|
||||
This node is the same as the default one, but it adds two features: Save the workflow or not in the png, and you can add any piece of metadata (as JSON).
|
||||
|
||||
This save custom data on the image, so you can share it with others, and they can see the workflow and metadata (see [preview from metadata](#node-preview-from-metadata)), even your custom data.
|
||||
|
||||
It can be any type of information supports text and JSON.
|
||||
|
||||

|
||||
|
||||
**Sample:** [image-save.json](./samples/image-save.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - options:
|
||||
> - with_workflow: If you want to save into the image the workflow (special to share the workflow with others)
|
||||
> - Input:
|
||||
> - image: The image to save (same as the default node)
|
||||
> - Output:
|
||||
> - Metadata RAW: The metadata raw of the image (full workflow) as string
|
||||
></details>
|
||||
|
||||
**Note:** The data is saved as special "exif" (as ComfyUI do) in the png file, you can read it with [Load image with metadata](#node-load-image-with-metadata).
|
||||
|
||||
<br />
|
||||
|
||||
### Node: Preview from image
|
||||
|
||||
This node is used to preview the image with the **current prompt** and additional features.
|
||||
|
||||

|
||||
|
||||
**Feature:** It supports cache (shows as "CACHED") (not permanent yet!), so you can disconnect the node and still see the image and data, so you can use it to compare with others!
|
||||
|
||||

|
||||
|
||||
As you can see the seed, steps, and cfg were changed
|
||||
|
||||
**Sample:** [image-preview-image.json](./samples/image-preview-image.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - Input:
|
||||
> - image: Any kind of image link
|
||||
> - Output:
|
||||
> - Metadata RAW: The metadata raw of the image and full workflow.
|
||||
> - You can use it to **compare with others** (see [metadata comparator](#node-metadata-comparator))
|
||||
> - The file info like filename, resolution, datetime and size with **the current prompt, not the original one!** (see important note)
|
||||
></details>
|
||||
|
||||
> **Important:**
|
||||
> - If you want to read the metadata of the image, you need to use the [load image with metadata](#node-load-image-with-metadata) and use the output "metadata RAW" not image link.
|
||||
> - To do a preview it is necessary save it first on temporal folder, and the data shown is from the temporal image, **not the original one** even **the prompt!**
|
||||
|
||||
<br />
|
||||
|
||||
### Node: Preview from metadata
|
||||
|
||||
This node is used to preview the image from the metadata and shows additional data (all around this one).
|
||||
It supports same features as [preview from image](#node-preview-from-image) (cache, metadata raw, etc.). But the important difference is you see **real data from the image** (not the temporal one either current prompt).
|
||||
|
||||

|
||||
|
||||
**Sample:** [image-preview-metadata.json](./samples/image-preview-metadata.json)
|
||||
|
||||
<br />
|
||||
|
||||
### Node: Show resolution
|
||||
|
||||
This node is used to show the resolution of an image.
|
||||
|
||||
> Can be used with any image link.
|
||||
|
||||

|
||||
|
||||
**Sample:** [image-resolution.json](./samples/image-resolution.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - Input:
|
||||
> - image: Any kind of image link
|
||||
> - Output:
|
||||
> - Width: The width of the image
|
||||
> - Height: The height of the image
|
||||
></details>
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
|
||||
## Pipe
|
||||
|
||||
### Nodes: Pipe to/edit any, Pipe from any
|
||||
|
||||
This powerful set of nodes is used to better organize your pipes.
|
||||
|
||||
The "Pipe to/edit any" node is used to encapsulate multiple links into a single one. It includes support for editing, easily adding the modified content back to the same pipe number.
|
||||
|
||||
The "Pipe from any" node is used to extract the content of a pipe.
|
||||
|
||||
Typical example:
|
||||
|
||||

|
||||
|
||||
With pipes:
|
||||
|
||||

|
||||
|
||||
**Sample:** [pipe-1.json](./samples/pipe-1.json)
|
||||
|
||||
Editing pipes:
|
||||
|
||||

|
||||
|
||||
**Sample:** [pipe-2.json](./samples/pipe-2.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - Input:
|
||||
> - CPipeAny: This is the type of this pipe you can use it to edit (see the sample)
|
||||
> - any_*: 6 possible inputs to use
|
||||
> - Output:
|
||||
> - CPipeAny: You can continue the pipe with this output, you can use it to bifurcate the pipe (see the sample)
|
||||
></details>
|
||||
|
||||
>**Important:**
|
||||
> - Please note that it supports "any," meaning it does not validate (not yet!) the correspondence of input nodes with the output ones. When creating the link, it is recommended to link consciously number by number.
|
||||
> - "RecursionError", It's crucial to note that the flow of links **must be in the same direction**, and they cannot be mixed with other flows that use the result of this one. Otherwise, this may lead to recursion and block the server (you need to restart it!)
|
||||
|
||||
|
||||
><details>
|
||||
> <summary><i>Bad example with "RecursionError: maximum recursion depth exceeded"</i></summary>
|
||||
>
|
||||
> If you see on your console something like this, you need to check your pipes. That is bad sample of pipes, you can't mix the flows.
|
||||

|
||||
></details>
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
|
||||
## Utils
|
||||
|
||||
Some useful nodes to use in your workflow.
|
||||
|
||||
### Node: JSON comparator
|
||||
|
||||
This node is so useful to compare two JSONs and see the differences.
|
||||
|
||||

|
||||
|
||||
**Sample:** [utils-json-comparator.json](./samples/utils-json-comparator.json)
|
||||
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - input:
|
||||
> - json_old: The first json to start compare
|
||||
> - json_new: The json to compare
|
||||
> - Output:
|
||||
> - diff: A new JSON with the differences
|
||||
></details>
|
||||
|
||||
|
||||
**Notes:**
|
||||
As you can see, it is the same as the [metadata comparator](#node-metadata-comparator) but with JSONs.
|
||||
The other is intentionally simple to compare two images metadata, this is more generic.
|
||||
The main difference is that you can compare any JSON, not only metadata.
|
||||
|
||||
<br />
|
||||
|
||||
### Node: Stats system
|
||||
|
||||
This node is used to show the stats of the system (RAM, VRAM and Space).
|
||||
It **should** connect as a pipe.
|
||||
|
||||

|
||||
|
||||
**Sample:** [utils-stats.json](./samples/utils-stats.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - input:
|
||||
> - latent: The latent to use to measure the stats
|
||||
> - Output:
|
||||
> - latent: Return the same latent to continue the pipe
|
||||
></details>
|
||||
|
||||
**Notes:** The original is in [WAS](https://github.com/WASasquatch/was-node-suite-comfyui), I only show it on the display.
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
|
||||
## Primitives
|
||||
|
||||
### Nodes: Primitive boolean, Primitive integer, Primitive float, Primitive string, Primitive string multiline
|
||||
|
||||
A set of nodes with primitive values to use in your prompts.
|
||||
|
||||

|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
|
||||
## List
|
||||
A set of nodes with list of values (any or strings/texts) for any propose (news nodes to use it coming soon!).
|
||||
|
||||
> **Important:** You can use with others nodes like "Show any" to see the values of the list
|
||||
|
||||
### Node: List of strings
|
||||
|
||||
**Feature:** You can concatenate them.
|
||||
|
||||

|
||||
|
||||
**Sample:** [list-strings.json](./samples/list-strings.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - Input:
|
||||
> - string_*: 8 possible inputs to use
|
||||
> - delimiter: Use to concatenate the values on output
|
||||
> - Output:
|
||||
> - concatenated: A string with all values concatenated
|
||||
> - list_string: The list of strings (only with values)
|
||||
></details>
|
||||
|
||||
<br />
|
||||
|
||||
### Node: List of any
|
||||
|
||||
You can concatenate any value (it will try to convert to string and show the value), so util to see several values at the same time.
|
||||
|
||||

|
||||
|
||||
**Sample:** [list-any.json](./samples/list-any.json)
|
||||
|
||||
><details>
|
||||
> <summary><i>Parameters</i></summary>
|
||||
>
|
||||
> - Input:
|
||||
> - any_*: 8 possible inputs to use
|
||||
> - Output:
|
||||
> - list_any: The list of any elements (only with values)
|
||||
></details>
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
|
||||
## Switch
|
||||
A set of nodes to switch between flows.
|
||||
|
||||
All switches are boolean, you can switch between flows by simply changing the value of the switch.
|
||||
You have predefined switches (string, latent, image, conditioning) but you can use "Switch any" for any value/type.
|
||||
|
||||

|
||||
|
||||
**Sample:** [switch.json](./samples/switch.json)
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
|
||||
## About
|
||||
|
||||
**Notes from the author:**
|
||||
- This is my first project in python ¯\\_(ツ)_/¯ (PR are welcome!)
|
||||
- I'm software engineer but in other languages (web technologies)
|
||||
- My instagram is: https://www.instagram.com/crystian.ia I'll publish my works on it, consider follow me for news! :)
|
||||
- I'm not a native english speaker, so sorry for my english :P
|
||||
|
||||
---
|
||||
|
||||
## To do
|
||||
- [✅] Review the priority of list of nodes
|
||||
- [❌] Add support for others image formats (jpg, gif, etc.) - nope, I don't need it, it's complicated
|
||||
- [ ] Several unit tests
|
||||
- [ ] Add permanent cache for preview/metadata image (to survive to F5! or restart the server)
|
||||
|
||||
---
|
||||
|
||||
## Changelog
|
||||
|
||||
### 1.1.0 (29/12/2023)
|
||||
- Node added: "Save image with extra metadata"
|
||||
- Support to **read** Jpeg metadata added (not save)
|
||||
|
||||
### 1.0.0 (26/12/2023)
|
||||
- First release
|
||||
|
||||
---
|
||||
|
||||
## Installation
|
||||
|
||||
### Install from GitHub
|
||||
1. Install [ComfyUi](https://github.com/comfyanonymous/ComfyUI).
|
||||
2. Clone this repo into `custom_modules`:
|
||||
```
|
||||
cd ComfyUI/custom_nodes
|
||||
git clone https://github.com/crystian/ComfyUI-Crystools.git
|
||||
cd ComfyUI-Crystools
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
3. Start up ComfyUI.
|
||||
|
||||
### Install from manager
|
||||
|
||||
Search for `crystools` in the [manager](https://github.com/ltdrdata/ComfyUI-Manager.git) and install it.
|
||||
|
||||
---
|
||||
|
||||
## Use
|
||||
|
||||
You can use it as any other node, just using the menu in the category `crystools` or double click on the canvas (I recommended to use the "oo" to fast filter), all nodes were posfixing with `[Crystools]`.
|
||||
|
||||

|
||||

|
||||
|
||||
If for some reason you need to see the logs, you can define the environment variable `CRYSTOOLS_LOGLEVEL` and set the [value](https://docs.python.org/es/3/howto/logging.html).
|
||||
|
||||
---
|
||||
|
||||
Made with ❤️ by Crystian.
|
||||
@@ -0,0 +1,3 @@
|
||||
WEB_DIRECTORY = "web"
|
||||
NODE_CLASS_MAPPINGS = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {}
|
||||
@@ -0,0 +1,105 @@
|
||||
import { app } from '../../../scripts/app.js';
|
||||
|
||||
const idProjectNameText = 'Crystools.projectName';
|
||||
const idProjectNameShow = 'Crystools.projectNameShow';
|
||||
const defaultProjectName = 'Project name12';
|
||||
const defaultProjectNameShow = true;
|
||||
const prefix = '[Crystools] ';
|
||||
const classCrystoolsMenu = 'crystools-menu';
|
||||
|
||||
// references of htmls elements
|
||||
let projectNameInputRef = null;
|
||||
|
||||
const showProjectName = (value) => {
|
||||
const ctools = document.getElementById(classCrystoolsMenu);
|
||||
|
||||
// validation because this run before setup
|
||||
if (ctools) {
|
||||
ctools.style.display = value ? 'block' : 'none';
|
||||
}
|
||||
};
|
||||
|
||||
const updateProjectName = (value) => {
|
||||
const ctools = document.getElementById(classCrystoolsMenu);
|
||||
|
||||
// validation because this run before setup
|
||||
if (ctools && projectNameInputRef) {
|
||||
projectNameInputRef.value = value;
|
||||
}
|
||||
};
|
||||
|
||||
app.ui.settings.addSetting({
|
||||
id: idProjectNameText,
|
||||
name: prefix + 'Project name',
|
||||
type: 'text',
|
||||
defaultValue: app.ui.settings.getSettingValue(idProjectNameText, defaultProjectName),
|
||||
onChange: updateProjectName,
|
||||
});
|
||||
|
||||
app.ui.settings.addSetting({
|
||||
id: idProjectNameShow,
|
||||
name: prefix + 'Show project name in menu',
|
||||
type: 'boolean',
|
||||
defaultValue: defaultProjectNameShow,
|
||||
onChange: showProjectName,
|
||||
});
|
||||
|
||||
|
||||
app.registerExtension({
|
||||
name: idProjectNameShow,
|
||||
async setup() {
|
||||
const queueBtn = document.getElementById('queue-button');
|
||||
|
||||
const ctools = document.createElement('div');
|
||||
ctools.setAttribute('id', classCrystoolsMenu);
|
||||
ctools.classList.add(classCrystoolsMenu);
|
||||
ctools.classList.add('comfy-menu-btns');
|
||||
ctools.style.width = '100%';
|
||||
queueBtn.insertAdjacentElement('afterend', ctools);
|
||||
|
||||
showProjectName(app.ui.settings.getSettingValue(idProjectNameShow, defaultProjectNameShow));
|
||||
|
||||
const projectNameInput = document.createElement('input');
|
||||
projectNameInput.style.margin = '4px 4px';
|
||||
projectNameInput.style.width = '100%';
|
||||
projectNameInputRef = projectNameInput;
|
||||
ctools.append(projectNameInput);
|
||||
|
||||
projectNameInput.addEventListener('blur', (event) => {
|
||||
saveProjectName(event.target.value);
|
||||
});
|
||||
|
||||
projectNameInput.addEventListener('keyup', (event) => {
|
||||
saveProjectName(event.target.value);
|
||||
});
|
||||
|
||||
const saveProjectName = (name) => {
|
||||
app.ui.settings.setSettingValue(idProjectNameText, name);
|
||||
updateProjectName(name);
|
||||
};
|
||||
|
||||
const loadProjectName = () => {
|
||||
projectNameInput.value = app.ui.settings.getSettingValue(idProjectNameText, defaultProjectName);
|
||||
};
|
||||
|
||||
const newSaveButton = () => {
|
||||
const saveButton = document.getElementById('comfy-save-button')
|
||||
console.log('saveButton', saveButton);
|
||||
|
||||
saveButton.addEventListener('click', (event) => {
|
||||
// const name = projectNameInput.value;
|
||||
// saveProjectName(name);
|
||||
console.log('entrou no save');
|
||||
event.preventDefault();
|
||||
// event.stopPropagation();
|
||||
event.stopImmediatePropagation();
|
||||
event.cancelBubble = true;
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
newSaveButton();
|
||||
loadProjectName();
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user