mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-10 13:32:36 +08:00
Merge branch 'feature/clipspace' into feature/maskpainting
This commit is contained in:
commit
f5af731ffd
@ -160,51 +160,55 @@ export class ComfyApp {
|
|||||||
'images': this.images
|
'images': this.images
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
{
|
|
||||||
content: "Paste (Clipspace)",
|
if(ComfyApp.clipspace != null) {
|
||||||
callback: () => {
|
options.push(
|
||||||
if(ComfyApp.clipspace != null) {
|
{
|
||||||
if(ComfyApp.clipspace.widgets != null && this.widgets != null) {
|
content: "Paste (Clipspace)",
|
||||||
ComfyApp.clipspace.widgets.forEach(({ type, name, value }) => {
|
callback: () => {
|
||||||
const prop = Object.values(this.widgets).find(obj => obj.type === type && obj.name === name);
|
if(ComfyApp.clipspace != null) {
|
||||||
if (prop) {
|
if(ComfyApp.clipspace.widgets != null && this.widgets != null) {
|
||||||
prop.value = value;
|
ComfyApp.clipspace.widgets.forEach(({ type, name, value }) => {
|
||||||
|
const prop = Object.values(this.widgets).find(obj => obj.type === type && obj.name === name);
|
||||||
|
if (prop) {
|
||||||
|
prop.value = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// image paste
|
||||||
|
if(ComfyApp.clipspace.imgs != undefined && this.imgs != undefined && this.widgets != null) {
|
||||||
|
var filename = "";
|
||||||
|
if(this.images && ComfyApp.clipspace.images) {
|
||||||
|
this.images = ComfyApp.clipspace.images;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// image paste
|
if(ComfyApp.clipspace.images != undefined) {
|
||||||
if(ComfyApp.clipspace.imgs != undefined && this.imgs != undefined && this.widgets != null) {
|
filename = `${ComfyApp.clipspace.images[0].filename} [${ComfyApp.clipspace.images[0].type}]`;
|
||||||
var filename = "";
|
}
|
||||||
if(this.images && ComfyApp.clipspace.images) {
|
else if(ComfyApp.clipspace.widgets != undefined) {
|
||||||
this.images = ComfyApp.clipspace.images;
|
const index_in_clip = ComfyApp.clipspace.widgets.findIndex(obj => obj.name === 'image');
|
||||||
}
|
if(index_in_clip >= 0) {
|
||||||
|
filename = `${ComfyApp.clipspace.widgets[index_in_clip].value}`;
|
||||||
if(ComfyApp.clipspace.images != undefined) {
|
}
|
||||||
filename = `${ComfyApp.clipspace.images[0].filename} [${ComfyApp.clipspace.images[0].type}]`;
|
|
||||||
}
|
|
||||||
else if(ComfyApp.clipspace.widgets != undefined) {
|
|
||||||
const index_in_clip = ComfyApp.clipspace.widgets.findIndex(obj => obj.name === 'image');
|
|
||||||
if(index_in_clip >= 0) {
|
|
||||||
filename = `${ComfyApp.clipspace.widgets[index_in_clip].value}`;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const index = this.widgets.findIndex(obj => obj.name === 'image');
|
const index = this.widgets.findIndex(obj => obj.name === 'image');
|
||||||
if(index >= 0 && filename != "" && ComfyApp.clipspace.imgs != undefined) {
|
if(index >= 0 && filename != "" && ComfyApp.clipspace.imgs != undefined) {
|
||||||
this.imgs = ComfyApp.clipspace.imgs;
|
this.imgs = ComfyApp.clipspace.imgs;
|
||||||
|
|
||||||
this.widgets[index].value = filename;
|
this.widgets[index].value = filename;
|
||||||
if(this.widgets_values != undefined) {
|
if(this.widgets_values != undefined) {
|
||||||
this.widgets_values[index] = filename;
|
this.widgets_values[index] = filename;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
);
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user