Commit 509fd145 authored by Roy Shilkrot's avatar Roy Shilkrot
Browse files

Merge remote-tracking branch 'upstream/master' into roy.add_simple_interrogate_api

parents bdc90837 dc7425a5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -29,4 +29,5 @@ notification.mp3
/textual_inversion
.vscode
/extensions
/test/stdout.txt
/test/stderr.txt
+12 −0
Original line number Diff line number Diff line
*       @AUTOMATIC1111
/localizations/ar_AR.json   @xmodar @blackneoo
/localizations/de_DE.json   @LunixWasTaken
/localizations/es_ES.json   @innovaciones
/localizations/fr_FR.json   @tumbly
/localizations/it_IT.json   @EugenioBuffo
/localizations/ja_JP.json   @yuuki76
/localizations/ko_KR.json   @36DB
/localizations/pt_BR.json   @M-art-ucci
/localizations/ru_RU.json   @kabachuha
/localizations/tr_TR.json   @camenduru
/localizations/zh_CN.json   @dtlnor @bgluminous
/localizations/zh_TW.json   @benlisquare
+24 −0
Original line number Diff line number Diff line

function extensions_apply(_, _){
    disable = []
    update = []
    gradioApp().querySelectorAll('#extensions input[type="checkbox"]').forEach(function(x){
        if(x.name.startsWith("enable_") && ! x.checked)
            disable.push(x.name.substr(7))

        if(x.name.startsWith("update_") && x.checked)
            update.push(x.name.substr(7))
    })

    restart_reload()

    return [JSON.stringify(disable), JSON.stringify(update)]
}

function extensions_check(){
    gradioApp().querySelectorAll('#extensions .extension_status').forEach(function(x){
        x.innerHTML = "Loading..."
    })

    return []
}
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ titles = {
    "Create style": "Save current prompts as a style. If you add the token {prompt} to the text, the style use that as placeholder for your prompt when you use the style in the future.",

    "Checkpoint name": "Loads weights from checkpoint before making images. You can either use hash or a part of filename (as seen in settings) for checkpoint name. Recommended to use with Y axis for less switching.",
    "Inpainting conditioning mask strength": "Only applies to inpainting models. Determines how strongly to mask off the original image for inpainting and img2img. 1.0 means fully masked, which is the default behaviour. 0.0 means a fully unmasked conditioning. Lower values will help preserve the overall composition of the image, but will struggle with large changes.",

    "vram": "Torch active: Peak amount of VRAM used by Torch during generation, excluding cached data.\nTorch reserved: Peak amount of VRAM allocated by Torch, including all active and cached data.\nSys VRAM: Peak amount of VRAM allocation across all applications / total GPU VRAM (peak utilization%).",

+39 −0
Original line number Diff line number Diff line
@@ -13,6 +13,15 @@ function showModal(event) {
    }
    lb.style.display = "block";
    lb.focus()

    const tabTxt2Img = gradioApp().getElementById("tab_txt2img")
    const tabImg2Img = gradioApp().getElementById("tab_img2img")
    // show the save button in modal only on txt2img or img2img tabs
    if (tabTxt2Img.style.display != "none" || tabImg2Img.style.display != "none") {
        gradioApp().getElementById("modal_save").style.display = "inline"
    } else {
        gradioApp().getElementById("modal_save").style.display = "none"
    }
    event.stopPropagation()
}

@@ -81,6 +90,25 @@ function modalImageSwitch(offset) {
    }
}

function saveImage(){
    const tabTxt2Img = gradioApp().getElementById("tab_txt2img")
    const tabImg2Img = gradioApp().getElementById("tab_img2img")
    const saveTxt2Img = "save_txt2img"
    const saveImg2Img = "save_img2img"
    if (tabTxt2Img.style.display != "none") {
        gradioApp().getElementById(saveTxt2Img).click()
    } else if (tabImg2Img.style.display != "none") {
        gradioApp().getElementById(saveImg2Img).click()
    } else {
        console.error("missing implementation for saving modal of this type")
    }
}

function modalSaveImage(event) {
    saveImage()
    event.stopPropagation()
}

function modalNextImage(event) {
    modalImageSwitch(1)
    event.stopPropagation()
@@ -93,6 +121,9 @@ function modalPrevImage(event) {

function modalKeyHandler(event) {
    switch (event.key) {
        case "s":
            saveImage()
            break;
        case "ArrowLeft":
            modalPrevImage(event)
            break;
@@ -198,6 +229,14 @@ document.addEventListener("DOMContentLoaded", function() {
    modalTileImage.title = "Preview tiling";
    modalControls.appendChild(modalTileImage)

    const modalSave = document.createElement("span")
    modalSave.className = "modalSave cursor"
    modalSave.id = "modal_save"
    modalSave.innerHTML = "🖫"
    modalSave.addEventListener("click", modalSaveImage, true)
    modalSave.title = "Save Image(s)"
    modalControls.appendChild(modalSave)

    const modalClose = document.createElement('span')
    modalClose.className = 'modalClose cursor';
    modalClose.innerHTML = '×'
Loading