This commit is contained in:
Chris
2025-04-30 22:26:50 +10:00
parent 8c00bd396d
commit d5941127a7
5 changed files with 7 additions and 18 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ from .image_filter import ImageFilter, MaskImageFilter, TextImageFilterWithExtra
from .list_utility_nodes import PickFromList, BatchFromImageList, ImageListFromBatch
from .string_utility_nodes import SplitByCommas, StringToFloat, StringToInt
VERSION = "1.4.1"
VERSION = "1.4.2"
WEB_DIRECTORY = "./js"
NODE_CLASS_MAPPINGS= {
+2 -3
View File
@@ -66,11 +66,10 @@ app.registerExtension({
this.outputs[0].type = type
this.inputs[0].type = type
}
return onConnectionsChange ? onConnectionsChange.apply(this, arguments) : undefined;
}
}
if (FILTER_TYPES.includes(nodeType.comfyClass )) {
nodeType.prototype.choose_id = function() { this._ni_widget.value = Math.floor(Math.random() * 1000000) }
const onNodeCreated = nodeType.prototype.onNodeCreated;
nodeType.prototype.onNodeCreated = function () {
this._ni_widget = this.widgets.find((n)=>n.name=='node_identifier')
@@ -79,8 +78,8 @@ app.registerExtension({
}
this._ni_widget.hidden = true
this._ni_widget.computeSize = () => [0,0]
this._ni_widget.value = Math.floor(Math.random() * 1000000)
this.choose_id()
return onNodeCreated ? onNodeCreated.apply(this, arguments) : undefined;
}
}
-1
View File
@@ -126,7 +126,6 @@ class Popup extends HTMLSpanElement {
close() {
this.state = State.INACTIVE
this.node.choose_id()
State.render(this)
}
+3 -12
View File
@@ -1,14 +1,5 @@
import torch
from json import JSONEncoder
def _default(self, obj): return getattr(obj.__class__, "to_json", _default.default)(obj)
_default.default = JSONEncoder().default
JSONEncoder.default = _default
class AlwaysEqual:
def to_json(self): return "*"
def __ne__(self, __value: object) -> bool: return False
def __eq__(self, __value: object) -> bool: return True
from comfy.comfy_types.node_typing import IO
class BatchFromImageList:
@classmethod
@@ -47,11 +38,11 @@ class PickFromList:
def INPUT_TYPES(s):
return {
"required": {
"anything" : (AlwaysEqual(), ),
"anything" : (IO.ANY, ),
"indexes": ("STRING", {"default": ""})
},
}
RETURN_TYPES = (AlwaysEqual(),)
RETURN_TYPES = (IO.ANY,)
RETURN_NAMES = ("picks",)
FUNCTION = "func"
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "cg-image-filter"
description = "A set of custom nodes that pause a workflow while you select images, add masks, or edit text."
version = "1.4.1"
version = "1.4.2"
license = { file = "LICENSE" }
[project.urls]