mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-21 07:07:00 +08:00
Merge branch 'comfyanonymous:master' into master
This commit is contained in:
commit
52c68cc4df
@ -76,9 +76,7 @@ class ModelPatcher:
|
|||||||
def model_size(self):
|
def model_size(self):
|
||||||
if self.size > 0:
|
if self.size > 0:
|
||||||
return self.size
|
return self.size
|
||||||
model_sd = self.model.state_dict()
|
|
||||||
self.size = comfy.model_management.module_size(self.model)
|
self.size = comfy.model_management.module_size(self.model)
|
||||||
self.model_keys = set(model_sd.keys())
|
|
||||||
return self.size
|
return self.size
|
||||||
|
|
||||||
def clone(self):
|
def clone(self):
|
||||||
@ -90,7 +88,6 @@ class ModelPatcher:
|
|||||||
|
|
||||||
n.object_patches = self.object_patches.copy()
|
n.object_patches = self.object_patches.copy()
|
||||||
n.model_options = copy.deepcopy(self.model_options)
|
n.model_options = copy.deepcopy(self.model_options)
|
||||||
n.model_keys = self.model_keys
|
|
||||||
n.backup = self.backup
|
n.backup = self.backup
|
||||||
n.object_patches_backup = self.object_patches_backup
|
n.object_patches_backup = self.object_patches_backup
|
||||||
return n
|
return n
|
||||||
@ -210,8 +207,9 @@ class ModelPatcher:
|
|||||||
|
|
||||||
def add_patches(self, patches, strength_patch=1.0, strength_model=1.0):
|
def add_patches(self, patches, strength_patch=1.0, strength_model=1.0):
|
||||||
p = set()
|
p = set()
|
||||||
|
model_sd = self.model.state_dict()
|
||||||
for k in patches:
|
for k in patches:
|
||||||
if k in self.model_keys:
|
if k in model_sd:
|
||||||
p.add(k)
|
p.add(k)
|
||||||
current_patches = self.patches.get(k, [])
|
current_patches = self.patches.get(k, [])
|
||||||
current_patches.append((strength_patch, patches[k], strength_model))
|
current_patches.append((strength_patch, patches[k], strength_model))
|
||||||
|
|||||||
@ -1800,7 +1800,7 @@ export class ComfyApp {
|
|||||||
* @param {*} graphData A serialized graph object
|
* @param {*} graphData A serialized graph object
|
||||||
* @param { boolean } clean If the graph state, e.g. images, should be cleared
|
* @param { boolean } clean If the graph state, e.g. images, should be cleared
|
||||||
*/
|
*/
|
||||||
async loadGraphData(graphData, clean = true) {
|
async loadGraphData(graphData, clean = true, restore_view = true) {
|
||||||
if (clean !== false) {
|
if (clean !== false) {
|
||||||
this.clean();
|
this.clean();
|
||||||
}
|
}
|
||||||
@ -1836,7 +1836,7 @@ export class ComfyApp {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
this.graph.configure(graphData);
|
this.graph.configure(graphData);
|
||||||
if (this.enableWorkflowViewRestore.value && graphData.extra?.ds) {
|
if (restore_view && this.enableWorkflowViewRestore.value && graphData.extra?.ds) {
|
||||||
this.canvas.ds.offset = graphData.extra.ds.offset;
|
this.canvas.ds.offset = graphData.extra.ds.offset;
|
||||||
this.canvas.ds.scale = graphData.extra.ds.scale;
|
this.canvas.ds.scale = graphData.extra.ds.scale;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -228,7 +228,7 @@ class ComfyList {
|
|||||||
$el("button", {
|
$el("button", {
|
||||||
textContent: "Load",
|
textContent: "Load",
|
||||||
onclick: async () => {
|
onclick: async () => {
|
||||||
await app.loadGraphData(item.prompt[3].extra_pnginfo.workflow);
|
await app.loadGraphData(item.prompt[3].extra_pnginfo.workflow, true, false);
|
||||||
if (item.outputs) {
|
if (item.outputs) {
|
||||||
app.nodeOutputs = item.outputs;
|
app.nodeOutputs = item.outputs;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user