mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-27 06:40:16 +08:00
Adjust batch image prompt
This commit is contained in:
parent
2c146b810b
commit
ec9ff003bf
@ -581,9 +581,15 @@ const MULTIIMAGEUPLOAD = (node, inputName, inputData, app) => {
|
|||||||
if (graphCanvas == null)
|
if (graphCanvas == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const panel = graphCanvas.createPanel("Pick Images", { closable: true });
|
if (imagesWidget.panel != null)
|
||||||
panel.node = node;
|
return
|
||||||
panel.classList.add("multiimageupload_dialog");
|
|
||||||
|
imagesWidget.panel = graphCanvas.createPanel("Pick Images", { closable: true });
|
||||||
|
imagesWidget.panel.onClose = () => {
|
||||||
|
imagesWidget.panel = null;
|
||||||
|
}
|
||||||
|
imagesWidget.panel.node = node;
|
||||||
|
imagesWidget.panel.classList.add("multiimageupload_dialog");
|
||||||
const swap = (arr, i, j) => {
|
const swap = (arr, i, j) => {
|
||||||
const temp = arr[i];
|
const temp = arr[i];
|
||||||
arr[i] = arr[j];
|
arr[i] = arr[j];
|
||||||
@ -596,7 +602,7 @@ const MULTIIMAGEUPLOAD = (node, inputName, inputData, app) => {
|
|||||||
<div class="right">
|
<div class="right">
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
const rootElem = panel.addHTML(rootHtml, "root");
|
const rootElem = imagesWidget.panel.addHTML(rootHtml, "root");
|
||||||
const left = rootElem.querySelector('.left')
|
const left = rootElem.querySelector('.left')
|
||||||
const right = rootElem.querySelector('.right')
|
const right = rootElem.querySelector('.right')
|
||||||
|
|
||||||
@ -659,13 +665,23 @@ const MULTIIMAGEUPLOAD = (node, inputName, inputData, app) => {
|
|||||||
inner_refresh();
|
inner_refresh();
|
||||||
})
|
})
|
||||||
|
|
||||||
const clearButton = panel.addButton("Clear", () => {
|
imagesWidget.panel.footer.style.display = "flex";
|
||||||
|
|
||||||
|
const clearButton = imagesWidget.panel.addButton("Clear", () => {
|
||||||
imagesWidget.value = []
|
imagesWidget.value = []
|
||||||
showImages(imagesWidget.value);
|
showImages(imagesWidget.value);
|
||||||
inner_refresh();
|
inner_refresh();
|
||||||
})
|
})
|
||||||
clearButton.style.display = "block";
|
clearButton.style.display = "block";
|
||||||
clearButton.style.marginLeft = "initial";
|
clearButton.style.marginLeft = "initial";
|
||||||
|
clearButton.style.height = "28px";
|
||||||
|
|
||||||
|
const okButton = imagesWidget.panel.addButton("OK", () => {
|
||||||
|
imagesWidget.panel.close();
|
||||||
|
})
|
||||||
|
okButton.style.display = "block";
|
||||||
|
okButton.style.height = "28px";
|
||||||
|
okButton.style.marginLeft = "auto";
|
||||||
|
|
||||||
const inner_refresh = () => {
|
const inner_refresh = () => {
|
||||||
left.innerHTML = ""
|
left.innerHTML = ""
|
||||||
@ -729,7 +745,7 @@ const MULTIIMAGEUPLOAD = (node, inputName, inputData, app) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inner_refresh();
|
inner_refresh();
|
||||||
document.body.appendChild(panel);
|
document.body.appendChild(imagesWidget.panel);
|
||||||
}, { serialize: false });
|
}, { serialize: false });
|
||||||
|
|
||||||
const uploadWidget = node.addWidget("button", "choose files to upload", "images", () => {
|
const uploadWidget = node.addWidget("button", "choose files to upload", "images", () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user