'Use for Controlnet', Drag'n'Drop (#1501)

* Drop area for Controlnet

* 'Use for Controlnet', DND
This commit is contained in:
JeLuF
2023-08-16 06:53:12 +02:00
committed by GitHub
parent 074c566826
commit a1854d3734
2 changed files with 41 additions and 23 deletions

View File

@ -517,6 +517,7 @@ function showImages(reqBody, res, outputContainer, livePreview) {
const imageRedoBuffer = []
let buttons = [
{ text: "Use as Input", on_click: onUseAsInputClick },
{ text: "Use for Controlnet", on_click: onUseForControlnetClick },
[
{
html: '<i class="fa-solid fa-download"></i> Download Image',
@ -627,6 +628,10 @@ function onUseAsInputClick(req, img) {
maskSetting.checked = false
}
function onUseForControlnetClick(req, img) {
controlImagePreview.src = img.src
}
function getDownloadFilename(img, suffix) {
const imageSeed = img.getAttribute("data-seed")
const imagePrompt = img.getAttribute("data-prompt")