-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Supporting Guess Mode with StableDiffusionControlNetPipeline #2971
Comments
I created a PoC for GuessMode. I had been working on it before but completely forgot about it until now... Usage: from diffusers import StableDiffusionControlNetPipeline, ControlNetModel
import torch
controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny")
pipe = StableDiffusionControlNetPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", controlnet=controlnet).to('cuda')
image = pipe("", image=canny_image, guess_mode=True).images[0]
image.save("guess_mode_generated.png") I used lllyasviel/ControlNet as a reference implementation and compared its output with my implementation. https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare_guess_mode/README.md The reference implementation uses a trained Unet with ControlNet, while the Diffusers version uses an vanilla SD1.5 non-EMA model for Unet, so there is a slight difference in the output by default. I felt that GuessMode further increased this difference. Additionally, there seems to be a tendency for the colors to be more intense. It's possible that slightly lowering the In this comparison, the "with prompt" version used the following prompts: prompt = "best quality, extremely detailed"
negative_prompt = "lowres, bad anatomy, worst quality, low quality" For Guess Mode, no prompts were specified ( This PoC implementation still needs improvements, as there are currently some limitations when using GuessMode:
When using GuessMode, only ControlNet should operate with no classifier free guidance, but the implementation for that part is still incomplete. @hireshgupta1997 Could you please try out this PoC if it's alright with you? |
Thanks @takuma104. It works completely fine for me. 😄 Would it be possible to create a PR to release this in the |
Happy to add such a feature to |
@hireshgupta1997 Thanks! I just opened Draft PR #2998. |
Thanks a lot @takuma104 for making these changes so quick 😄. I just wanted to learn more about the limitations to support |
@hireshgupta1997 In the Diffusers' Pipeline, the behavior changes based on the |
Sure, Thanks a lot @takuma104 for clarifying and making the necessary changes. 😄 |
Thank you @patrickvonplaten and @takuma104 for releasing this feature in |
Hello, how would one train this from scratch? A controlnet with guess mode? Id like to have an inpainting generator with diffusers. thanks. |
The ControlNet model supports Guess Mode that helps generate results without any text prompts. It recognizes the contents of the control map quite well and generates amazing outputs without any text prompt input.
I would want to place request for this feature that'll be helpful for the whole community. Please refer to the results below:
The text was updated successfully, but these errors were encountered: