fkunn1326 / openpose-editor

Openpose Editor for AUTOMATIC1111's stable-diffusion-webui
MIT License
1.73k stars 207 forks source link

OpenPose Editor is not working properly #106

Open koaqiu opened 1 year ago

koaqiu commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'openpose editor'
  2. Click on 'send to txt2img button' or click on 'Detect from Image' button
  3. See error

Screenshots image

Environment

Additional context python: 3.10.6   •  torch: 1.13.1+cu117   •  xformers: N/A   •  gradio: 3.23.0   •  commit: 955df775   •  checkpoint: fc2511737a


use https://github.com/AUTOMATIC1111/stable-diffusion-webui/tree/22bcc7be428c94e9408f589966c2040187245d81

same problem

koaqiu commented 1 year ago

image

do not exist

"#controlnet > div > div.tabs > div:not(.tab-nav)" "#controlnet > div:nth-child(2) > .tabs > .tabitem, #controlnet > div:nth-child(2) > div:not(.tabs)"

koaqiu commented 1 year ago

like this https://github.com/fkunn1326/openpose-editor/issues/99#issuecomment-1486346829

i change code to

        let input = gradioApp().querySelector(selector).querySelector("#controlnet").querySelector("input[type='file']");

        const input_image = (input) =>{
            try {
                if(input.previousElementSibling  
                    && input.previousElementSibling.previousElementSibling 
                    && input.previousElementSibling.previousElementSibling.querySelector("button[aria-label='Clear']")) {
                input.previousElementSibling.previousElementSibling.querySelector("button[aria-label='Clear']").click()
                }
            } catch (e) {
                console.error(e)
            }
            input.value = "";
            input.files = list;
            const event = new Event('change', { 'bubbles': true, "composed": true });
            input.dispatchEvent(event);
        }

        if (input == null){
            const callback = (observer) => {
                input = gradioApp().querySelector(selector).querySelector("#controlnet").querySelector("input[type='file']");
                if (input == null) {
                    console.error('input[type=file] NOT exists')
                    return
                }else{
                    input_image(input)
                    observer.disconnect()
                }
            }
            const observer = new MutationObserver(callback);
            observer.observe(gradioApp().querySelector(selector).querySelector("#controlnet"), { childList: true });
        }else{
            input_image(input)
        }

fix

fkunn1326 commented 1 year ago

@koaqiu Please send me a PR

koaqiu commented 1 year ago

@koaqiu Please send me a PR

done

Liz2rdWizard commented 1 year ago

Hey thank you guys for fixing this awesome plugin :) it works now!

Update did not fix it for me on my linux machine, I had to manually remove + reinstall

  1. Delete a1111/stable-diffusion-webui/extensions/openpose-editor folder
  2. Install the .git manually again
  3. Works :+1:

Thanks!