-
Notifications
You must be signed in to change notification settings - Fork 200
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
Support for Multi-Controlnet, and using separate images for controlnet #53
Comments
I notice that codes below:
How should I change the code to load Both of them? |
Yes, you need to create two controlnet models like model1 and model2 and load different saved pth. And you will need to extract the controlnet features for each of the controlnet model. (you need to modify cond and the sample function Line 299 in 619e88f
Line 316 in 619e88f
And to use two controlnet simultanously, https://github.com/lllyasviel/ControlNet/blob/ed85cd1e25a5ed592f7d8178495b4483de0331bf/cldm/cldm.py#L41 |
@williamyang1991 Thank you very much for the reply! But I still need a bit more assistance... I changed the cldm.py code as you listed above, and I changed the webUI code to be like this:
But I ran into this error: Traceback (most recent call last): The RuntimeError suggests that the two conditions are not properly combined, I guess. Would you please take a look and give some suggestions? I'd really appreciate it~ |
Sorry about the lengthy post... I just realized that I did not change this:
What should I change here? |
You need change Since now you have two control_models and two features in cond['c_concat'] |
@williamyang1991 Thank you very much for the reply. I really appreciate it... I found that code in cldm.py, but I don't know how to change it. Would you be so kind to show me? I browsed thru https://github.com/Mikubill/sd-webui-controlnet, but could not find how multi-controlnet is implemented there.
|
I'm sorry that I'm under deadline pressure and cannot help you with every details. The main idea is to track everywhere cond['c_concat'] is used and modify the corresponding code. |
Thanks for the code, it's been working really well!
But I'd like to have further precision with multi-controlnet. (I am using 3D software to create a video first) So I want to use both Canny and Depth. I'd like to use Canny thru the input video and depth images that I rendered myself. How can I modify the code to do so?
The text was updated successfully, but these errors were encountered: