ControlNet now available in the WebUI! #7784
Replies: 21 comments 33 replies
-
Unprompted v7.5.1 Update: I've rewritten the model loading mechanism using built-in A1111 functions. If you tried the previous version, you'll need to move and rename the following files:
Now the Important: Please do not attempt to load the ControlNet model from the normal WebUI dropdown. Just let the shortcode do its thing. Known Issues:
|
Beta Was this translation helpful? Give feedback.
-
Yess, thanks for that! |
Beta Was this translation helpful? Give feedback.
-
Hey @ThereforeGames ! I have successfully downloaded and installed the files in the mentioned locations, I get the following error when I try to use the walter white command: Error running postprocess: G:\stablediffusion\stable-diffusion-webui\extensions\unprompted\scripts\unprompted.py What would be a way around this? |
Beta Was this translation helpful? Give feedback.
-
Had the files in '\extensions\unprompted\lib\stable_diffusion\controlnet\annotator\ckpts' It works now, though only with DDIM and throws an error when token length is more than 77. PS: Also it doesn't seem to work with inpaint mode, can that be supported? |
Beta Was this translation helpful? Give feedback.
-
Unprompted v7.5.2 Update: The Scribble and M-LSD models are now supported! Specify which model you'd like to use with the For example, here's how you might reference the Scribble model:
Remember, with each model you need to follow the steps outlined in the original post. TL;DR rename the .pth file to .ckpt, download associated annotator files, and make a copy of the yaml file. In the near future, I'll hook up this shortcode to the Wizard UI. My priority right now is adapting the remaining models. Have fun! |
Beta Was this translation helpful? Give feedback.
-
OK , got this Running on local URL: http://127.0.0.1:7860 To create a public link, set 0%| | 0/1 [00:00<?, ?it/s]
Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8 ', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', 'Will upscale the image by the selected scale factor; use width and height sliders to set tile size ', 64, 0, 2, 1, '', 0, '', True, False, False, 1, '', 0, '', 0, '', True, False, False, False, 0, True, True, '', False, 1, 'Both ▦', False, '', False, True, False, False, False, False, 0, False, '', '', '', 'generateMasksTab', 1, 4, 2.5, 30, 1.03, 1, 1, 5, 0.5, 5, False, True, 'Will upscale the image depending on the selected target size type ', 512, 8, 32, 64, 0.35, 32, 0, True, 0, False, 8, 0, 0, 2048, 2048, 2) {}Traceback (most recent call last): File "F:\sd\modules\call_queue.py", line 56, in f res = list(func(*args, **kwargs)) File "F:\sd\modules\call_queue.py", line 37, in f res = func(*args, **kwargs) File "F:\sd\modules\img2img.py", line 169, in img2img processed = process_images(p) File "F:\sd\modules\processing.py", line 486, in process_images res = process_images_inner(p) File "F:\sd\modules\processing.py", line 628, in process_images_inner samples_ddim = p.sample(conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength, prompts=prompts) File "F:\sd\modules\processing.py", line 1044, in sample samples = self.sampler.sample_img2img(self, self.init_latent, x, conditioning, unconditional_conditioning, image_conditioning=self.image_conditioning) File "F:\sd\modules\sd_samplers_kdiffusion.py", line 302, in sample_img2img samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs)) File "F:\sd\modules\sd_samplers_kdiffusion.py", line 221, in launch_sampling return func() File "F:\sd\modules\sd_samplers_kdiffusion.py", line 302, in samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs)) File "F:\sd\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "F:\sd\repositories\k-diffusion\k_diffusion\sampling.py", line 128, in sample_euler denoised = model(x, sigma_hat * s_in, **extra_args) File "F:\sd\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "F:\sd\modules\sd_samplers_kdiffusion.py", line 116, in forward x_out = self.inner_model(x_in, sigma_in, cond={"c_crossattn": [cond_in], "c_concat": [image_cond_in]}) File "F:\sd\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "F:\sd\repositories\k-diffusion\k_diffusion\external.py", line 112, in forward eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs) File "F:\sd\repositories\k-diffusion\k_diffusion\external.py", line 138, in get_eps return self.inner_model.apply_model(*args, **kwargs) File "F:\sd\extensions\unprompted/lib_unprompted/stable_diffusion/controlnet\cldm\cldm.py", line 332, in apply_model control = self.control_model(x=x_noisy, hint=cond_hint, timesteps=t, context=cond_txt) File "F:\sd\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "F:\sd\extensions\unprompted/lib_unprompted/stable_diffusion/controlnet\cldm\cldm.py", line 287, in forward guided_hint = self.input_hint_block(hint, emb, context) File "F:\sd\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "F:\sd\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\openaimodel.py", line 86, in forward x = layer(x) File "F:\sd\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "F:\sd\extensions-builtin\Lora\lora.py", line 182, in lora_Conv2d_forward return lora_forward(self, input, torch.nn.Conv2d_forward_before_lora(self, input)) File "F:\sd\venv\lib\site-packages\torch\nn\modules\conv.py", line 457, in forward return self._conv_forward(input, self.weight, self.bias) File "F:\sd\venv\lib\site-packages\torch\nn\modules\conv.py", line 453, in _conv_forward return F.conv2d(input, weight, bias, self.stride, RuntimeError: Given groups=1, weight of size [16, 3, 3, 3], expected input[2, 5, 1, 1] to have 3 channels, but got 5 channels instead` |
Beta Was this translation helpful? Give feedback.
-
Can anyone describe what makes this better than just using IMG2IMG or Pix2Pix? |
Beta Was this translation helpful? Give feedback.
-
Wow so fast I made a tutorial for their native script I guess I should make one for this one now |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Looks amazing, but unfortunately, I can't seem to use it. I get this issue at step 6
I tried again with save_memory = True in config.py, but no luck. Is this just not usable with 8gb VRAM? What's the minimum? |
Beta Was this translation helpful? Give feedback.
-
not working on a fresh installation. i have started recording a tutorial video but not working even on a fresh installation 0 extensions installed other than yours fresh latest version - python 3.10.8 windows 10 here all the settings and error
|
Beta Was this translation helpful? Give feedback.
-
ok this extension seriously wasted my 1.5 hours finished recording hopefully will be on my channel tomorrow : https://www.youtube.com/@SECourses |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to run this on the cpu when using --use-cpu=all? Right now it doesn't work but hopefully that might be something easy to fix. |
Beta Was this translation helpful? Give feedback.
-
WebUI could not be started.
|
Beta Was this translation helpful? Give feedback.
-
This one works guys! This allows even for 960x960 resolution and no doubles on 1.5 model, i cant believe this, its really a revolution for SD, this piece of code is pretty incredible, same pose, any res you want, set weight to 0.5 |
Beta Was this translation helpful? Give feedback.
-
Made a tutorial for the flawlessly working extension sorry ThereforeGames i have spent 1.5 hours on your extension yesterday while making the video. it also caused me like 1 hours when post editing 16.) Automatic1111 Web UI |
Beta Was this translation helpful? Give feedback.
-
With much love and appreciation to @Mikubill and @ThereforeGames for the extension work, IMO this seems like something that should be integrated directly as a feature. |
Beta Was this translation helpful? Give feedback.
-
Hey there! Amazing script, but I find some issue in batch process, creating only one image from butch after it I have this error: |
Beta Was this translation helpful? Give feedback.
-
I'm using @Mikubill's extension, and it works flawlessly except for openpose which always produced completely blank black images for the mask while throwing no error. Anyone else have this issue? Edit: Literally as I went back to test it more it just started working... I didn't change anything. The only thing I can think of is that perhaps there was something still downloading or installing in the background that hadn't finished, though I'm baffled why it wouldn't throw an error in that case. Anyway, it's working now. |
Beta Was this translation helpful? Give feedback.
-
well, It's in steps 3 and 4 in the description
Step 3) Download the cldm_v15.yaml file from the ControlNet repository and place it next to the ckpt:
https://github.com/lllyasviel/ControlNet/tree/main/models
Step 4) Rename it to control_sd15_openpose.yaml
|
Beta Was this translation helpful? Give feedback.
-
2/15 EDIT: If you run into any issues with this shortcode, I would encourage you to try Mikubill's dedicated ControlNet extension. Their implementation differs from my own in that theirs hooks directly into the A1111 pipeline whereas mine is more of a "wrapper" for the original ControlNet code (including its own external DDIM sampler.)
Hi folks,
Good news! I managed to get the incredible ControlNet script running in our favorite WebUI.
It is available via the Unprompted extension.
If you already have Unprompted, all you have to do is fetch the latest update through the Extensions menu. If you don't have Unprompted yet, then... I don't know what to tell you. I guess you don't like me very much.
Jokes aside, I only got this working a few minutes ago, so it's limited to the pose2image model for now. But it should be trivial to add support for the remaining models (knock on wood.) Might have a few more of them ready tonight! (Which ones do you want first?)
EDIT - Currently supported models: Pose, Scribble, M-LSD, Depth Map, Normal Map
Setup
Step 1) After installing the Unprompted extension, you need to grab a few files from ControlNet's HuggingFace page:
https://huggingface.co/lllyasviel/ControlNet
You can git the whole thing if you want, but it's something like 50+ GB. For the Pose model, all you need are the following:
Step 2) Place the
control_sd15_openpose.pth
file into your WebUI'smodels/Stable-diffusion
directory. Rename it from.pth
to.ckpt
.Step 3) Download the
cldm_v15.yaml
file from the ControlNet repository and place it next to the ckpt:https://github.com/lllyasviel/ControlNet/tree/main/models
Step 4) Rename it to
control_sd15_openpose.yaml
.Step 5) Now, place the two annotator files here:
extensions\unprompted\lib_unprompted\stable_diffusion\controlnet\annotator\ckpts
Step 6) Boot up the WebUI. In the img2img tab, load an initial image and use the
[controlnet]
shortcode. Here's the prompt for my example above:[controlnet]walter white dancing in a suit and red tie, blue sky background, best quality
Press generate. If the resulting image doesn't adhere to the pose, press generate again. There's currently a bug where the first result sometimes doesn't work.
Important: Please do not attempt to load the ControlNet model from your normal WebUI dropdown. Just let the shortcode do its thing.
Tip: Try using the
save_memory
argument if you encounter any memory problems.Known Issues
Have fun!
Beta Was this translation helpful? Give feedback.
All reactions