OpenPose Editor is not working properly.
Describe the bug OpenPose Editor tab is not properly working.
To Reproduce Steps to reproduce the behavior:
- Click send to txt2img.
- Check controlnet in txt2img tab.
- Pose is not applied.
Expected behavior Pose should be applied.
Additional context Probably happened after automatic1111's web ui repo update.
OpenPose Editor only open the tab but not sending the image for both button (txt2img and img2img).
I have the same problem.
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...
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 Could you please send me a pull request?
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.
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)