icon (screw) added

This commit is contained in:
Crystian
2024-01-07 14:36:59 +01:00
parent e94c87ee9d
commit 1a51ca4ada
7 changed files with 73 additions and 69 deletions
+4 -3
View File
@@ -1,6 +1,6 @@
# ComfyUI-Crystools [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fcrystian%2FComfyUI-Crystools&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com) [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/crystian77)
**_A powerful set of tools for your belt when you work with ComfyUI_**
**_🪛 A powerful set of tools for your belt when you work with ComfyUI 🪛_**
You can see the progress bar & time elapsed also you can see metadata and compare between two images, compare between two JSONs, show any value to console/display, pipes, and more!
This provides better nodes to load images, previews, etc, and see "hidden" data, but without loading a new workflow.
@@ -483,14 +483,15 @@ You have predefined switches (string, latent, image, conditioning) but you can u
---
## To do
- [✅] Review the priority of the list of nodes
- [❌] Add support for other 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
### Crystools-save: 1.1.0 (07/01/2024)
- Labeling updated according to the new version of Crystools (this project)
### 1.2.0 (05/01/2024)
- progress bar added
+1 -1
View File
@@ -12,7 +12,7 @@ class TEXTS(Enum):
class CATEGORY(Enum):
TESTING = "_for_testing"
MAIN = "crystools"
MAIN = "crystools 🪛"
PRIMITIVE = "/Primitive"
DEBUGGER = "/Debugger"
LIST = "/List"
+5 -5
View File
@@ -12,7 +12,7 @@ from ..core import logger
class CMonitor:
monitorThread = None
frequency = 0
rate = 0
nvidia = False
pynvmlLoaded = False
cudaAvailable = False
@@ -25,8 +25,8 @@ class CMonitor:
switchRAM = False
switchVRAM = False
def __init__(self, frequency=10, switchCPU=False, switchGPU=False, switchHDD=False, switchRAM=False, switchVRAM=False):
self.frequency = frequency
def __init__(self, rate=5, switchCPU=False, switchGPU=False, switchHDD=False, switchRAM=False, switchVRAM=False):
self.rate = rate
self.switchCPU = switchCPU
self.switchGPU = switchGPU
self.switchHDD = switchHDD
@@ -131,9 +131,9 @@ class CMonitor:
await s.send_json('crystools.monitor', data)
def monitorLoop(self):
while self.frequency > 0:
while self.rate > 0:
asyncio.run(self.send_message(self.buildMonitorData()))
time.sleep(self.frequency)
time.sleep(self.rate)
def startMonitor(self):
if self.monitorThread is not None:
+55 -54
View File
@@ -1,66 +1,67 @@
from enum import Enum
postfix = ' 🪛'
# IMPORTANT DON'T CHANGE THE "NAME" AND "TYPE" OF THE ENUMS, IT WILL BREAK THE COMPATIBILITY!
# IMPORTANT DON'T CHANGE THE 'NAME' AND 'TYPE' OF THE ENUMS, IT WILL BREAK THE COMPATIBILITY!
# remember: NAME is for search, DESC is for contextual
class CLASSES(Enum):
CBOOLEAN_NAME = "Primitive boolean [Crystools]"
CBOOLEAN_DESC = "Primitive boolean [Crystools]"
CTEXT_NAME = "Primitive string [Crystools]"
CTEXT_DESC = "Primitive string [Crystools]"
CTEXTML_NAME = "Primitive string multiline [Crystools]"
CTEXTML_DESC = "Primitive string multiline [Crystools]"
CINTEGER_NAME = "Primitive integer [Crystools]"
CINTEGER_DESC = "Primitive integer [Crystools]"
CFLOAT_NAME = "Primitive float [Crystools]"
CFLOAT_DESC = "Primitive float [Crystools]"
CBOOLEAN_NAME = 'Primitive boolean [Crystools]'
CBOOLEAN_DESC = 'Primitive boolean' + postfix
CTEXT_NAME = 'Primitive string [Crystools]'
CTEXT_DESC = 'Primitive string' + postfix
CTEXTML_NAME = 'Primitive string multiline [Crystools]'
CTEXTML_DESC = 'Primitive string multiline' + postfix
CINTEGER_NAME = 'Primitive integer [Crystools]'
CINTEGER_DESC = 'Primitive integer' + postfix
CFLOAT_NAME = 'Primitive float [Crystools]'
CFLOAT_DESC = 'Primitive float' + postfix
CDEBUGGER_CONSOLE_ANY_NAME = "Show any [Crystools]"
CDEBUGGER_ANY_DESC = "Show any value to console/display [Crystools]"
CDEBUGGER_CONSOLE_ANY_TO_JSON_NAME = "Show any to JSON [Crystools]"
CDEBUGGER_CONSOLE_ANY_TO_JSON_DESC = "Show any to JSON [Crystools]"
CDEBUGGER_CONSOLE_ANY_NAME = 'Show any [Crystools]'
CDEBUGGER_ANY_DESC = 'Show any value to console/display' + postfix
CDEBUGGER_CONSOLE_ANY_TO_JSON_NAME = 'Show any to JSON [Crystools]'
CDEBUGGER_CONSOLE_ANY_TO_JSON_DESC = 'Show any to JSON' + postfix
CLIST_ANY_TYPE = "ListAny"
CLIST_ANY_NAME = "List of any [Crystools]"
CLIST_ANY_DESC = "List of any [Crystools]"
CLIST_STRING_TYPE = "ListString"
CLIST_STRING_NAME = "List of strings [Crystools]"
CLIST_STRING_DESC = "List of strings [Crystools]"
CLIST_ANY_TYPE = 'ListAny'
CLIST_ANY_NAME = 'List of any [Crystools]'
CLIST_ANY_DESC = 'List of any' + postfix
CLIST_STRING_TYPE = 'ListString'
CLIST_STRING_NAME = 'List of strings [Crystools]'
CLIST_STRING_DESC = 'List of strings' + postfix
CSWITCH_ANY_NAME = "Switch any [Crystools]"
CSWITCH_ANY_DESC = "Switch any [Crystools]"
CSWITCH_STRING_NAME = "Switch string [Crystools]"
CSWITCH_STRING_DESC = "Switch string [Crystools]"
CSWITCH_CONDITIONING_NAME = "Switch conditioning [Crystools]"
CSWITCH_CONDITIONING_DESC = "Switch conditioning [Crystools]"
CSWITCH_IMAGE_NAME = "Switch image [Crystools]"
CSWITCH_IMAGE_DESC = "Switch image [Crystools]"
CSWITCH_LATENT_NAME = "Switch latent [Crystools]"
CSWITCH_LATENT_DESC = "Switch latent [Crystools]"
CSWITCH_ANY_NAME = 'Switch any [Crystools]'
CSWITCH_ANY_DESC = 'Switch any' + postfix
CSWITCH_STRING_NAME = 'Switch string [Crystools]'
CSWITCH_STRING_DESC = 'Switch string' + postfix
CSWITCH_CONDITIONING_NAME = 'Switch conditioning [Crystools]'
CSWITCH_CONDITIONING_DESC = 'Switch conditioning' + postfix
CSWITCH_IMAGE_NAME = 'Switch image [Crystools]'
CSWITCH_IMAGE_DESC = 'Switch image' + postfix
CSWITCH_LATENT_NAME = 'Switch latent [Crystools]'
CSWITCH_LATENT_DESC = 'Switch latent' + postfix
CPIPE_ANY_TYPE = "CPipeAny"
CPIPE_TO_ANY_NAME = "Pipe to/edit any [Crystools]"
CPIPE_TO_ANY_DESC = "Pipe to/edit any [Crystools]"
CPIPE_FROM_ANY_NAME = "Pipe from any [Crystools]"
CPIPE_FROM_ANY_DESC = "Pipe from any [Crystools]"
CPIPE_ANY_TYPE = 'CPipeAny'
CPIPE_TO_ANY_NAME = 'Pipe to/edit any [Crystools]'
CPIPE_TO_ANY_DESC = 'Pipe to/edit any' + postfix
CPIPE_FROM_ANY_NAME = 'Pipe from any [Crystools]'
CPIPE_FROM_ANY_DESC = 'Pipe from any' + postfix
CIMAGE_LOAD_METADATA_NAME = "Load image with metadata [Crystools]"
CIMAGE_LOAD_METADATA_DESC = "Load image with metadata [Crystools]"
CIMAGE_GET_RESOLUTION_NAME = "Get resolution [Crystools]"
CIMAGE_GET_RESOLUTION_DESC = "Get resolution [Crystools]"
CIMAGE_PREVIEW_IMAGE_NAME = "Preview from image [Crystools]"
CIMAGE_PREVIEW_IMAGE_DESC = "Preview from image [Crystools]"
CIMAGE_PREVIEW_METADATA_NAME = "Preview from metadata [Crystools]"
CIMAGE_PREVIEW_METADATA_DESC = "Preview from metadata [Crystools]"
CIMAGE_SAVE_METADATA_NAME = "Save image with extra metadata [Crystools]"
CIMAGE_SAVE_METADATA_DESC = "Save image with extra metadata [Crystools]"
CIMAGE_LOAD_METADATA_NAME = 'Load image with metadata [Crystools]'
CIMAGE_LOAD_METADATA_DESC = 'Load image with metadata' + postfix
CIMAGE_GET_RESOLUTION_NAME = 'Get resolution [Crystools]'
CIMAGE_GET_RESOLUTION_DESC = 'Get resolution' + postfix
CIMAGE_PREVIEW_IMAGE_NAME = 'Preview from image [Crystools]'
CIMAGE_PREVIEW_IMAGE_DESC = 'Preview from image' + postfix
CIMAGE_PREVIEW_METADATA_NAME = 'Preview from metadata [Crystools]'
CIMAGE_PREVIEW_METADATA_DESC = 'Preview from metadata' + postfix
CIMAGE_SAVE_METADATA_NAME = 'Save image with extra metadata [Crystools]'
CIMAGE_SAVE_METADATA_DESC = 'Save image with extra metadata' + postfix
CMETADATA_EXTRACTOR_NAME = "Metadata extractor [Crystools]"
CMETADATA_EXTRACTOR_DESC = "Metadata extractor [Crystools]"
CMETADATA_COMPARATOR_NAME = "Metadata comparator [Crystools]"
CMETADATA_COMPARATOR_DESC = "Metadata comparator [Crystools]"
CMETADATA_EXTRACTOR_NAME = 'Metadata extractor [Crystools]'
CMETADATA_EXTRACTOR_DESC = 'Metadata extractor' + postfix
CMETADATA_COMPARATOR_NAME = 'Metadata comparator [Crystools]'
CMETADATA_COMPARATOR_DESC = 'Metadata comparator' + postfix
CUTILS_JSON_COMPARATOR_NAME = "Json comparator [Crystools]"
CUTILS_JSON_COMPARATOR_DESC = "Json comparator [Crystools]"
CUTILS_STAT_SYSTEM_NAME = "Stats system [Crystools]"
CUTILS_STAT_SYSTEM_DESC = "Stats system (powered by WAS) [Crystools]"
CUTILS_JSON_COMPARATOR_NAME = 'Json comparator [Crystools]'
CUTILS_JSON_COMPARATOR_DESC = 'Json comparator' + postfix
CUTILS_STAT_SYSTEM_NAME = 'Stats system [Crystools]'
CUTILS_STAT_SYSTEM_DESC = 'Stats system (powered by WAS)' + postfix
+2 -1
View File
@@ -1,5 +1,7 @@
import { ComfyWidgets } from '../../../scripts/widgets.js';
export const commonPrefix = '🪛';
export function displayContext(nodeType, app, index = 0, serialize_widgets = false, isVirtualNode = false) {
function populate(text) {
if (this.widgets) {
@@ -54,7 +56,6 @@ export function displayContext(nodeType, app, index = 0, serialize_widgets = fal
};
}
// propagate the output value to the dependents nodes, it does not work with some nodes ¯\_(ツ)_/¯
const propagateOutputToDependentsNodes = function(output, value) {
if (output.links && output.links.length) {
+3 -3
View File
@@ -1,7 +1,7 @@
import { app } from '../../../scripts/app.js';
import { api } from '../../../scripts/api.js';
import { ComfyWidgets } from '../../../scripts/widgets.js';
import { displayContext } from './common.js';
import { commonPrefix, displayContext } from './common.js';
// "Show any" Node
app.registerExtension({
@@ -22,8 +22,8 @@ app.registerExtension({
name: 'Crystools.Debugger.Metadata',
registerCustomNodes() {
const category = 'crystools/Debugger';
const friendlyName = 'Show Metadata [Crystools]';
const category = `crystools ${commonPrefix}/Debugger`;
const friendlyName = 'Show Metadata 🪛';
class MetadataNode {
// color = "#FF2222";
+3 -2
View File
@@ -1,5 +1,6 @@
import { api } from '../../../scripts/api.js';
import { app } from '../../../scripts/app.js';
import { commonPrefix } from './common.js';
const status = {
executing: 'Executing',
@@ -11,7 +12,7 @@ class CrystoolsProgressBar {
idExtensionName = 'Crystools.progressBar';
idShowProgressBar = 'Crystools.showStatus';
defaultShowStatus = true;
menuPrefix = '';
menuPrefix = commonPrefix;
htmlIdCrystoolsRoot = 'crystools-root';
htmlIdCrystoolsProgressBarContainer = 'crystools-progress-bar-container';
@@ -31,7 +32,7 @@ class CrystoolsProgressBar {
createSettings = () => {
app.ui.settings.addSetting({
id: this.idShowProgressBar,
name: this.menuPrefix + 'Show progress bar in menu',
name: this.menuPrefix + 'Show progress bar [menu]',
type: 'boolean',
defaultValue: this.defaultShowStatus,
onChange: this.showProgressBar,