Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

OpenPose Editor is not working properly #106

Open
koaqiu opened this issue Mar 29, 2023 · 5 comments
Open

OpenPose Editor is not working properly #106

koaqiu opened this issue Mar 29, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@koaqiu
Copy link
Contributor

koaqiu commented Mar 29, 2023

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 koaqiu added the bug Something isn't working label Mar 29, 2023
@koaqiu
Copy link
Contributor Author

koaqiu commented Mar 29, 2023

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
Copy link
Contributor Author

koaqiu commented Mar 29, 2023

like this
#99 (comment)

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
Copy link
Owner

@koaqiu Please send me a PR

@koaqiu
Copy link
Contributor Author

koaqiu commented Mar 30, 2023

@koaqiu Please send me a PR

done

@Liz2rdWizard
Copy link

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 👍

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants