Things for ControlNet
This commit is contained in:
@@ -213,7 +213,8 @@ export class ComfyNotifyAction extends ComfyGraphNode {
|
||||
return;
|
||||
|
||||
const options: NotifyOptions = {
|
||||
type: this.properties.type
|
||||
type: this.properties.type,
|
||||
showOn: "all"
|
||||
}
|
||||
|
||||
// Check if this event was triggered from a backend node and has the
|
||||
@@ -546,3 +547,35 @@ LiteGraph.registerNodeType({
|
||||
desc: "Turns multiple groups of nodes on/off at once based on an array of rules [{ tag: string, enable: boolean }, ...]",
|
||||
type: "actions/set_node_mode_advanced"
|
||||
})
|
||||
|
||||
export class ComfyNoChangeEvent extends ComfyGraphNode {
|
||||
static slotLayout: SlotLayout = {
|
||||
inputs: [
|
||||
{ name: "in", type: BuiltInSlotType.ACTION },
|
||||
],
|
||||
outputs: [
|
||||
{ name: "out", type: BuiltInSlotType.EVENT },
|
||||
],
|
||||
}
|
||||
|
||||
override onAction(action: any, param: any, options: { action_call?: string }) {
|
||||
if (param && typeof param === "object" && "noChangedEvent" in param) {
|
||||
param.noChangedEvent = true;
|
||||
}
|
||||
else {
|
||||
param = {
|
||||
value: param,
|
||||
noChangedEvent: true
|
||||
}
|
||||
}
|
||||
|
||||
this.triggerSlot(0, param, null, options);
|
||||
}
|
||||
}
|
||||
|
||||
LiteGraph.registerNodeType({
|
||||
class: ComfyNoChangeEvent,
|
||||
title: "Comfy.NoChangeEvent",
|
||||
desc: "Wraps an event's parameter such that passing it into a ComfyWidgetNode's 'store' action will not trigger its 'changed' event",
|
||||
type: "events/no_change"
|
||||
})
|
||||
|
||||
@@ -827,6 +827,7 @@ export class ComfyImageUploadNode extends ComfyWidgetNode<Array<GradioFileData>>
|
||||
{ name: "filename", type: "string" }, // TODO support batches
|
||||
{ name: "width", type: "number" },
|
||||
{ name: "height", type: "number" },
|
||||
{ name: "image_count", type: "number" },
|
||||
{ name: "changed", type: BuiltInSlotType.EVENT },
|
||||
]
|
||||
}
|
||||
@@ -851,11 +852,13 @@ export class ComfyImageUploadNode extends ComfyWidgetNode<Array<GradioFileData>>
|
||||
this.setOutputData(0, value[0].name) // TODO when ComfyUI LoadImage supports loading an image batch
|
||||
this.setOutputData(1, this.imageSize[0])
|
||||
this.setOutputData(2, this.imageSize[1])
|
||||
this.setOutputData(3, value.length)
|
||||
}
|
||||
else {
|
||||
this.setOutputData(0, "")
|
||||
this.setOutputData(1, 1)
|
||||
this.setOutputData(2, 1)
|
||||
this.setOutputData(3, 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user