Malisius / booru2prompt

An extension for stable-diffusion-webui to convert image booru posts into prompts
58 stars 8 forks source link

"Send image to tag selection button" doesn't work #19

Open MinamiHasaki opened 8 months ago

MinamiHasaki commented 8 months ago

The button that is used to send an image to tag selection doesn't work. I click on an image and click the button. The screen changes, but all the values are empty, and after loading, produces an error.

MinamiHasaki commented 8 months ago

The button that is used to send an image to tag selection doesn't work. I click on an image and click the button. The screen changes, but all the values are empty, and after loading, produces an error.

I was able to fix this locally by changing one of the query selectors in javascript/ui.js.

From this:

function switch_to_select() {
    //gradioApp().querySelector('#selectbox').querySelector('textarea').value = gradioApp().querySelector('.px-3.py-1').innerHTML;
    gradioApp().querySelectorAll('#tab_b2p_interface')[0].querySelectorAll('button')[0].click();
    return gradioApp().querySelector('.px-3.py-1').innerHTML;
}

To this:

function switch_to_select() {
    //gradioApp().querySelector('#selectbox').querySelector('textarea').value = gradioApp().querySelector('.px-3.py-1').innerHTML;
    gradioApp().querySelectorAll('#tab_b2p_interface')[0].querySelectorAll('button')[0].click();
    return gradioApp().querySelector('.caption-label.svelte-1b19cri').innerHTML;
}