feat: denoise strength as starting noise level#1738
Open
stduhpf wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Currently, in
img2imgmode, thestrengthparameter simply determines how many denoising steps to skip (e.g., a strength of 0.7 skips the first 30% of steps). This is a simple and familliar behavior, probably inherited from legacy engines like Automatic1111.The issue with this approach is that it doesn't align with the intuitive meaning of "denoising strength," and the actual amount of noise added is heavily dependent on the specific scheduler being used.
This PR introduces an alternative interpretation of the
strengthparameter, treating it as a noise level rather than a step count. When enabled, a strength of 0.7 ensures that denoising begins at the step where the model's input is approximately a mix of 70% noise and 30% initial image.Key Changes:
strengthto control the actual noise ratio. Depending on the scheduler and model, this may produce significantly different results than the default step-skipping method.Configuration:
These can be enabled via the
--extra-sample-argsargument using the following boolean fields:strength_as_noise_levelforce_first_sigmaRelated Issue / Discussion
N/A
Additional Information
With dreamshaper v8 (unet/diffusion):
Default behavior:
Enabling
strength_as_noise_level=on:Enabling
strength_as_noise_level=on,force_first_sigma=on:With Flux2 Klein 4b (DiT/Flow):
Checklist