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

OpenPose Editor is not working properly.

Open iJustGhost opened this issue 2 years ago • 13 comments

Describe the bug OpenPose Editor tab is not properly working.

To Reproduce Steps to reproduce the behavior:

  1. Click send to txt2img.
  2. Check controlnet in txt2img tab.
  3. Pose is not applied.

Expected behavior Pose should be applied.

Additional context Probably happened after automatic1111's web ui repo update.

iJustGhost avatar Mar 27 '23 04:03 iJustGhost

OpenPose Editor only open the tab but not sending the image for both button (txt2img and img2img).

jemmywong79 avatar Mar 27 '23 08:03 jemmywong79

I have the same problem.

vienduong88 avatar Mar 27 '23 17:03 vienduong88

as an extension author, I know the cause of this issue is because webui updated its gradio version, which introducing bugs for many extensions who need to send to img to controlNet, but it needs this extension author to fix...

jtydhr88 avatar Mar 28 '23 02:03 jtydhr88

The HTML layout of webui is changed.

There is a temporarily sulotion, edit this file: webui\extensions\openpose-editor\javascript\main.js (Remember to backup the file before editing)

Find following code, ~line 482

const accordion = gradioApp().querySelector(selector).querySelector("#controlnet .transition"); if (accordion.classList.contains("rotate-90")) { accordion.click() }

    const tabs = gradioApp().querySelector(selector).querySelectorAll("#controlnet > div:nth-child(2) > .tabs > .tabitem, #controlnet > div:nth-child(2) > div:not(.tabs)")
    const tab = tabs[index]
    if (tab.classList.contains("tabitem")) {
        tab.parentElement.firstElementChild.querySelector(`:nth-child(${Number(index) + 1})`).click()
    }
    const input = tab.querySelector("input[type='file']")
    try {
        input.previousElementSibling.previousElementSibling.querySelector("button[aria-label='Clear']").click()
    } catch (e) {
        console.error(e)
    }

replace with:

	// 20230328 JY 
    const accordion = gradioApp().querySelector(selector).querySelector("#controlnet").querySelectorAll("span.icon.svelte-s1r2yt")[0];
			
	// Show controlNet box
	let rotate = accordion.style.transform.match(/rotate\((\d+)(.+)\)/);
	if (rotate) {
		let [num, unit] = rotate.slice(1);  
		if (num == "90") {
			accordion.click()
		}
	}	
	const input = gradioApp().querySelector(selector).querySelector("#controlnet").querySelector("input[type='file']");

reload webui.

FireworkTM avatar Mar 28 '23 07:03 FireworkTM

@FireworkTM Could you please send me a pull request?

fkunn1326 avatar Mar 28 '23 08:03 fkunn1326

The HTML layout of webui is changed.

There is a temporarily sulotion, edit this file: webui\extensions\openpose-editor\javascript\main.js (Remember to backup the file before editing)

Find following code, ~line 482

const accordion = gradioApp().querySelector(selector).querySelector("#controlnet .transition"); if (accordion.classList.contains("rotate-90")) { accordion.click() }

    const tabs = gradioApp().querySelector(selector).querySelectorAll("#controlnet > div:nth-child(2) > .tabs > .tabitem, #controlnet > div:nth-child(2) > div:not(.tabs)")
    const tab = tabs[index]
    if (tab.classList.contains("tabitem")) {
        tab.parentElement.firstElementChild.querySelector(`:nth-child(${Number(index) + 1})`).click()
    }
    const input = tab.querySelector("input[type='file']")
    try {
        input.previousElementSibling.previousElementSibling.querySelector("button[aria-label='Clear']").click()
    } catch (e) {
        console.error(e)
    }

replace with:

	// 20230328 JY 
    const accordion = gradioApp().querySelector(selector).querySelector("#controlnet").querySelectorAll("span.icon.svelte-s1r2yt")[0];
			
	// Show controlNet box
	let rotate = accordion.style.transform.match(/rotate\((\d+)(.+)\)/);
	if (rotate) {
		let [num, unit] = rotate.slice(1);  
		if (num == "90") {
			accordion.click()
		}
	}	
	const input = gradioApp().querySelector(selector).querySelector("#controlnet").querySelector("input[type='file']");

reload webui.

Tried this one, but dragging while everything is selected is not working. Still it works.

iJustGhost avatar Mar 28 '23 11:03 iJustGhost

The problem is still not fixed, basically the plugin is currently unusable and I'm using blender for posing for now. I tried the temporary fix by FireworkTM, it did not work for me.

There is no such button as "send to controlnet" as I see in every youtube video, but also the "send to text2img" button is not sending the pose to where it should, but only brings me to the "text2img" tab and does nothing else (as reported by other users already)

Liz2rdWizard avatar Mar 28 '23 18:03 Liz2rdWizard