Skip to content

Add guidance start/end parameters to StableDiffusionControlNetImg2ImgPipeline #2731

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

Merged
merged 2 commits into from
Mar 21, 2023
Merged

Add guidance start/end parameters to StableDiffusionControlNetImg2ImgPipeline #2731

merged 2 commits into from
Mar 21, 2023

Conversation

hyowon-ha
Copy link
Contributor

@hyowon-ha hyowon-ha commented Mar 18, 2023

Description

This pull request adds optional parameters controlnet_guidance_start and controlnet_guidance_end to the StableDiffusionControlNetImg2ImgPipeline (#2584), which was recently added by @mikegarts.

The purpose of these parameters is to enable users to control when the ControlNet is activated and deactivated during the denoising process. I noticed that this option was missing from the pipeline, and I believe it will help to provide more room for structural changes in the output.

These parameters are similar to those in Mikubill's WebUI extension for ControlNet, which have proven to be very useful.

Testing

The testing code included in this pull request is similar to that in #2584. You can specify the new "controlnet_guidance_start" and "controlnet_guidance_end" parameters when calling the pipe like this.

result_img = pipe_controlnet(controlnet_conditioning_image=control_image, 
                        image=input_image,
                        prompt="an android robot, cyberpank, digitl art masterpiece", 
                        num_inference_steps=20,
                        controlnet_guidance_start=0.2,
                        controlnet_guidance_end=0.8).images[0]

Thank you for considering this contribution. I look forward to your feedback and any necessary changes.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 18, 2023

The documentation is not available anymore as the PR was closed or merged.

@mikegarts
Copy link
Contributor

@hyowon-ha Thanks! This could come handy to have a better control on the output :)

@patrickvonplaten
Copy link
Contributor

@hyowon-ha Thanks! This could come handy to have a better control on the output :)

Taking this as a "Looks good to me"

@patrickvonplaten patrickvonplaten merged commit 58bcf46 into huggingface:main Mar 21, 2023
w4ffl35 pushed a commit to w4ffl35/diffusers that referenced this pull request Apr 14, 2023
…Pipeline (huggingface#2731)

* Add guidance start/end parameters to community controlnet img2img pipeline

* Fix formats
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
…Pipeline (huggingface#2731)

* Add guidance start/end parameters to community controlnet img2img pipeline

* Fix formats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants