-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New Feature] Integrated Openpose Editor #1454
Conversation
wow great. how can js send data to gradio? what is the currently used method? |
There is a hidden gr.Textbox that accepts pose JSON from JS code. |
wow sounds very a1111. will take a look soon |
This is pretty great, is there a way to have a button to make entire hand and bones appear instead of enabling bones one by one ? |
Yes, you can toggle visibility on entire hand, body, face. But invalid/missing keypoints are marked invisible by default, so if there are invalid keypoints, they are likely to be jammed at the same location. I am working on the documentation on the editor repo. Hopefully that will clarify things. |
Need to install https://github.com/huchenlei/sd-webui-openpose-editor/tree/main first. (No need to build now as it automatically pull latest release binary from GitHub.) |
I think I now have answers to the 2 questions originally asked: How should the edited image be used by controlnet?Option2: Add a button to push the preprocessor result to the input image and select none for preprocessor. How should we release this feature to the users?Option2: Display a line of text let user know the feature need another extension to function. This PR is now ready to be merged. |
or perhaps we just add a dirty flag to preview image. if sha256 of a input image match some marked sha256 then replace it with another image before processing. maintain a sha to ndarray dict |
Probably need to hash all the input settings (resolution, etc) used to generate the preview image instead of just the hash of input image. I think for now a "Send back" button is the most cost efficient solution. Note: |
then user click two buttons,first a button from extension and then send back? |
i think i can try it a bit tomorrow or later soon. how big is that extension? is it possible to directly move into cn, or hide the button if extension not installed? |
The extension is not too big. 2~3k lines of typescript code. The problem is that the extension needs to be build with nodeJS installed. My current workaround is to let user pull the compiled app from github release. If we include the editor in this repository, it is likely to messup the release page. I can add an option in settings to hide the edit button, and prompt the user to go to settings and toggle that option if they don't want to see an edit button with alert sign. |
When the user is satisfied with the image in the preview, the user can click Overall workflow:
|
it seems when I click a button titled "Send to ControlNet", I will expect that this image will be used by CN. Clicking another button again sounds a bit ... |
We can directly set the input image when clicking send to ControlNet but that would overwrite the input image. If the user decides to adjust the pose again, the original input image won't be available as the background image in the editor. The ideal way is let ControlNet use the edited pose in the generated image section, but I found it not so easy to implement. |
@lllyasviel Gentle ping on the review. I can try to implement the logic to use the up-to-date preview image if you think that is the way to go. |
I am relatively busy this week. I think we can use a branch in this repo or what to test the features, and then perhaps the weekend I can test it more and try to merge hopefully. |
dd5e429
to
1a70d52
Compare
A new branch |
4f521b8
to
8d32cf8
Compare
8d32cf8
to
70b5f9f
Compare
Hi @lllyasviel, Can you take a look again? I add a new checkbox to allow direct usage of preview image as controlnet input. Now the workflow is reduced to:
|
70b5f9f
to
b7b7e5b
Compare
b7b7e5b
to
d19e8ed
Compare
🎨 nits 🎨 Load alert screen when no editor is detected. 🔧 add option to hide edit button 🐛 Resolve conflicts during rebase 🚧 Set use preview as input after edit 🐛 Fix merge conflict
d19e8ed
to
e4c67ee
Compare
I am going to merge this if no further oppositions / feedbacks are received. Some testings:
We can either make the feature disabled by default or revert this PR if the user feedback is really negative. |
|
|
Also from the demo there is an issue with the openpose detection: The same hand got detected twice on the right person. Going to open an issue for this. |
#1012 proposed an integrated openpose editor. Months passed, we are finally close to have one.
Workflow of this feature:
screen-capture.webm
There are still a few things that need to be worked out though:
How should the edited image be used by controlnet?
#1211 Discussed why we cannot make the preview result directly used by controlnet. TLDR is that many preprocessors use values from WebUI that are only available when clicking the generate button.
Option1: Let controlnet use pre-rendered openpose image if there is an update-to-date one. (Make an exception for openpose only as openpose preprocessor does not depend on any WebUI runtime values)
Option2: Add a button to push the preprocessor result to the input image and select none for preprocessor. This option is not so ideal as once sent, the pose becomes uneditable.
How should we release this feature to the users.
Behind the scene, the feature is embedding an openpose editor web page in an iframe. The controlnet JS code communiates with the iframe web page via
window.postMessage
. Currently this requires user install https://github.com/huchenlei/sd-webui-openpose-editor/tree/main separately.If the extra extension is not installed, how should we handle the prompting:
Option1: Install the extension in the background. (Maybe too agressive?)
Option2: Display a line of text let user know the feature need another extension to function.