mikonvergence / ControlNetInpaint

Inpaint images with ControlNet
MIT License
344 stars 29 forks source link

About 'strength' Parameter in StableDiffusionControlNetInpaintPipeline Compared to StableDiffusionInpaintPipeline #20

Closed swim2sun closed 1 year ago

swim2sun commented 1 year ago

The StableDiffusionInpaintPipeline introduces a strength parameter, as detailed in the documentation here. However, I couldn't locate this parameter in the StableDiffusionControlNetInpaintPipeline.

If I use the parameters num_inference_steps=40 and strength=0.93 in StableDiffusionInpaintPipeline, should I then use num_inference_steps=37 (calculated as 40 * 0.93) in StableDiffusionControlNetInpaintPipeline?

mikonvergence commented 1 year ago

Hi, StableDiffusionControlNetInpaintPipeline was designed to inherit all parameters from StableDiffusionInpaintPipeline but was written in March 2023, which means that some part of the interface has changed over time.

The strength has been added to the interface in May 2023 in commit c09c4f3.

There is no way to control this in this version without changing the underlying code - since the process always starts with a sample of pure noise (which is the same as a constant strength of 1.0).

If this is a crucial functionality for you, we can consider a PR for this. Let me know what you think.

swim2sun commented 1 year ago

Hi, @mikonvergence thank you for your clarification.

I tried to reference your code and make modifications based on the latest version of diffusers. However, I noticed that StableDiffusionControlNetInpaintPipeline inherits from StableDiffusionControlNetPipeline, and the latest version of StableDiffusionControlNetPipeline also does not include the strength parameter. As I'm still in the early stages of using stable diffusion and not familiar with the details, I find it challenging to proceed without this information.

I appreciate the information you provided. I will attempt to use StableDiffusionControlNetInpaintPipeline and compare the effects between strength=1 and strength=0.93.

Thank you for your work on this repo, it's fantastic!