openpose-editor icon indicating copy to clipboard operation
openpose-editor copied to clipboard

OpenPose Editor is not working properly

Open koaqiu opened this issue 2 years ago • 5 comments

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

  • OS: windows 11
  • Browser chrome 111.0.5563.111

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 avatar Mar 29 '23 12:03 koaqiu

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 avatar Mar 29 '23 13:03 koaqiu

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

koaqiu avatar Mar 29 '23 14:03 koaqiu

@koaqiu Please send me a PR

fkunn1326 avatar Mar 30 '23 02:03 fkunn1326

@koaqiu Please send me a PR

done

koaqiu avatar Mar 30 '23 07:03 koaqiu

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!

Liz2rdWizard avatar Mar 30 '23 23:03 Liz2rdWizard