Commit 981fe9c4 authored by Liam's avatar Liam
Browse files

Merge remote-tracking branch 'upstream/master' into token_count

parents 5034f7d7 f2a4a2c3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -20,3 +20,5 @@ __pycache__
/interrogate
/user.css
/.idea
notification.mp3
/SwinIR
+15 −9
Original line number Diff line number Diff line
@@ -68,13 +68,19 @@ window.addEventListener('paste', e => {
    if ( ! isValidImageList( files ) ) {
        return;
    }
    [...gradioApp().querySelectorAll('input[type=file][accept="image/x-png,image/gif,image/jpeg"]')]
        .filter(input => !input.matches('.\\!hidden input[type=file]'))
        .forEach(input => {
            input.files = files;
            input.dispatchEvent(new Event('change'))
        });
    [...gradioApp().querySelectorAll('[data-testid="image"]')]
        .filter(imgWrap => !imgWrap.closest('.\\!hidden'))
        .forEach(imgWrap => dropReplaceImage( imgWrap, files ));

    const visibleImageFields = [...gradioApp().querySelectorAll('[data-testid="image"]')]
        .filter(el => uiElementIsVisible(el));
    if ( ! visibleImageFields.length ) {
        return;
    }
    
    const firstFreeImageField = visibleImageFields
        .filter(el => el.querySelector('input[type=file]'))?.[0];

    dropReplaceImage(
        firstFreeImageField ?
        firstFreeImageField :
        visibleImageFields[visibleImageFields.length - 1]
    , files );
});
+2 −2
Original line number Diff line number Diff line
@@ -57,8 +57,8 @@ titles = {

    "Interrogate": "Reconstruct prompt from existing image and put it into the prompt field.",

    "Images filename pattern": "Use following tags to define how filenames for images are chosen: [steps], [cfg], [prompt], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [prompt_words], [date], [job_timestamp]; leave empty for default.",
    "Directory name pattern": "Use following tags to define how subdirectories for images and grids are chosen: [steps], [cfg], [prompt], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [prompt_words], [date], [job_timestamp]; leave empty for default.",
    "Images filename pattern": "Use following tags to define how filenames for images are chosen: [steps], [cfg], [prompt], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [prompt_words], [date], [datetime], [job_timestamp]; leave empty for default.",
    "Directory name pattern": "Use following tags to define how subdirectories for images and grids are chosen: [steps], [cfg], [prompt], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [prompt_words], [date], [datetime], [job_timestamp]; leave empty for default.",
    "Max prompt words": "Set the maximum number of words to be used in the [prompt_words] option; ATTENTION: If the words are too long, they may exceed the maximum length of the file path that the system can handle",

    "Loopback": "Process an image, use it as an input, repeat.",
+3 −0
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@ onUiUpdate(function(){

    lastHeadImg = headImg;

    // play notification sound if available
    gradioApp().querySelector('#audio_notification audio')?.play();

    if (document.hasFocus()) return;

    // Multiple copies of the images are in the DOM when one is selected. Dedup with a Set to get the real number generated.
+2 −3
Original line number Diff line number Diff line
// various functions for interation with ui.py not large enough to warrant putting them in separate files

function selected_gallery_index(){
    var gr = gradioApp()
    var buttons = gradioApp().querySelectorAll(".gallery-item")
    var button = gr.querySelector(".gallery-item.\\!ring-2")
    var buttons = gradioApp().querySelectorAll('[style="display: block;"].tabitem .gallery-item')
    var button = gradioApp().querySelector('[style="display: block;"].tabitem .gallery-item.\\!ring-2')

    var result = -1
    buttons.forEach(function(v, i){ if(v==button) { result = i } })
Loading