mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-24 21:30:15 +08:00
Merge branch 'comfyanonymous:master' into feature/blockweights
This commit is contained in:
commit
ceece8c396
@ -366,7 +366,6 @@ def encode_adm(noise_augmentor, conds, batch_size, device):
|
|||||||
#TODO: add a way to control this
|
#TODO: add a way to control this
|
||||||
noise_augment = 0.05
|
noise_augment = 0.05
|
||||||
noise_level = round((noise_augmentor.max_noise_level - 1) * noise_augment)
|
noise_level = round((noise_augmentor.max_noise_level - 1) * noise_augment)
|
||||||
print(noise_level)
|
|
||||||
c_adm, noise_level_emb = noise_augmentor(adm_out[:, :noise_augmentor.time_embed.dim], noise_level=torch.tensor([noise_level], device=device))
|
c_adm, noise_level_emb = noise_augmentor(adm_out[:, :noise_augmentor.time_embed.dim], noise_level=torch.tensor([noise_level], device=device))
|
||||||
adm_out = torch.cat((c_adm, noise_level_emb), 1)
|
adm_out = torch.cat((c_adm, noise_level_emb), 1)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
" !git pull\n",
|
" !git pull\n",
|
||||||
"\n",
|
"\n",
|
||||||
"!echo -= Install dependencies =-\n",
|
"!echo -= Install dependencies =-\n",
|
||||||
"!pip install xformers==0.0.16 -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu117"
|
"!pip install xformers -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu118"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -11,11 +11,14 @@ app.registerExtension({
|
|||||||
this.properties = {};
|
this.properties = {};
|
||||||
}
|
}
|
||||||
this.properties.showOutputText = RerouteNode.defaultVisibility;
|
this.properties.showOutputText = RerouteNode.defaultVisibility;
|
||||||
|
this.properties.horizontal = false;
|
||||||
|
|
||||||
this.addInput("", "*");
|
this.addInput("", "*");
|
||||||
this.addOutput(this.properties.showOutputText ? "*" : "", "*");
|
this.addOutput(this.properties.showOutputText ? "*" : "", "*");
|
||||||
|
|
||||||
this.onConnectionsChange = function (type, index, connected, link_info) {
|
this.onConnectionsChange = function (type, index, connected, link_info) {
|
||||||
|
this.applyOrientation();
|
||||||
|
|
||||||
// Prevent multiple connections to different types when we have no input
|
// Prevent multiple connections to different types when we have no input
|
||||||
if (connected && type === LiteGraph.OUTPUT) {
|
if (connected && type === LiteGraph.OUTPUT) {
|
||||||
// Ignore wildcard nodes as these will be updated to real types
|
// Ignore wildcard nodes as these will be updated to real types
|
||||||
@ -49,8 +52,8 @@ app.registerExtension({
|
|||||||
currentNode = null;
|
currentNode = null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Move the previous node
|
// Move the previous node
|
||||||
currentNode = node;
|
currentNode = node;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We've found the end
|
// We've found the end
|
||||||
@ -112,6 +115,7 @@ app.registerExtension({
|
|||||||
node.__outputType = displayType;
|
node.__outputType = displayType;
|
||||||
node.outputs[0].name = node.properties.showOutputText ? displayType : "";
|
node.outputs[0].name = node.properties.showOutputText ? displayType : "";
|
||||||
node.size = node.computeSize();
|
node.size = node.computeSize();
|
||||||
|
node.applyOrientation();
|
||||||
|
|
||||||
for (const l of node.outputs[0].links || []) {
|
for (const l of node.outputs[0].links || []) {
|
||||||
const link = app.graph.links[l];
|
const link = app.graph.links[l];
|
||||||
@ -153,6 +157,7 @@ app.registerExtension({
|
|||||||
this.outputs[0].name = "";
|
this.outputs[0].name = "";
|
||||||
}
|
}
|
||||||
this.size = this.computeSize();
|
this.size = this.computeSize();
|
||||||
|
this.applyOrientation();
|
||||||
app.graph.setDirtyCanvas(true, true);
|
app.graph.setDirtyCanvas(true, true);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -161,9 +166,32 @@ app.registerExtension({
|
|||||||
callback: () => {
|
callback: () => {
|
||||||
RerouteNode.setDefaultTextVisibility(!RerouteNode.defaultVisibility);
|
RerouteNode.setDefaultTextVisibility(!RerouteNode.defaultVisibility);
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// naming is inverted with respect to LiteGraphNode.horizontal
|
||||||
|
// LiteGraphNode.horizontal == true means that
|
||||||
|
// each slot in the inputs and outputs are layed out horizontally,
|
||||||
|
// which is the opposite of the visual orientation of the inputs and outputs as a node
|
||||||
|
content: "Set " + (this.properties.horizontal ? "Horizontal" : "Vertical"),
|
||||||
|
callback: () => {
|
||||||
|
this.properties.horizontal = !this.properties.horizontal;
|
||||||
|
this.applyOrientation();
|
||||||
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
applyOrientation() {
|
||||||
|
this.horizontal = this.properties.horizontal;
|
||||||
|
if (this.horizontal) {
|
||||||
|
// we correct the input position, because LiteGraphNode.horizontal
|
||||||
|
// doesn't account for title presence
|
||||||
|
// which reroute nodes don't have
|
||||||
|
this.inputs[0].pos = [this.size[0] / 2, 0];
|
||||||
|
} else {
|
||||||
|
delete this.inputs[0].pos;
|
||||||
|
}
|
||||||
|
app.graph.setDirtyCanvas(true, true);
|
||||||
|
}
|
||||||
|
|
||||||
computeSize() {
|
computeSize() {
|
||||||
return [
|
return [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user