Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

An Extension for Automatic1111 Webui that enhances the quality of img2img upscale

License

Notifications You must be signed in to change notification settings

Haoming02/sd-webui-dynamic-hdr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

No Longer Maintained

Please check out the new and improved Vectorscope CC!

This repo will no longer receive updates...


SD Webui Dynamic HDR

This is an Extension for the Automatic1111 Webui, which tries to enhance the img2img upscale quality.

What is This ?

I came up with a convoluted way to slightly enhances the img2img process by artificially adding in some noise to retain some of the "texture" during upscale, and offsetting said noise based on the brightness of the input image, to further increase the contrast.1 On top of that, since this process happens before the Stable Diffusion pipeline, this can take advantage of the diffusion process and generate even better results rather than being just a simple filter.

How to Use ?

After installing this Extension, you can see its sub-section in the img2img tab. The default parameters can already yield some decent results. Refer to the table below and play around with the values.

Parameters

  • Steps: How many times does it apply the noises
  • Brightness: Offset the bounds of the luminance map
  • Contrast: The upper and lower bounds of the luminance map
  • Saturation: Alter the saturation of the input image
  • Power: Use Power instead of Multiplication calculation for saturation modification; Lower Saturation if you enable this
  • Bloom: Zero the lower bound, so only the upper bound is processed; Increase Blur for better effects
  • Grey: Generate a grey-scale instead of a full-color noise map
  • Sigma: Affects how much noise is applied; Set to 0 to turn this Extension into just a basic Filter
  • Blur: How strong should the luminance map be blurred
  • Debug: When enabled, attach the intermediate steps to output

Sample Images

Base Image 512x512; img2img to 1024x1024; Same prompts; Same seed; Same settings

Base Image Without Ext.
\ a b c d e
Steps 1 2 4 8 16
Brightness 4 2 3 -1 1
Contrast 4 2 3 2 1
Saturation 1.5 1.0 1.5 1.0 1.2
Sigma 1.0 1.0 1.0 2.0 0.5
Blur 64 16 16 8 4
Result

Roadmap

  • Extension Released
  • Add Support for X/Y/Z Plot
  • Append Parameters into Metadata
Implementation

What this Extension actually does: When you run img2img, it first calculates a luminance map of the input image. Then it blurs the map and scales the map to a range controlled by Brightness and Contrast. The saturation of the input image is modified. And a noise map controlled by Sigma is generated centered around the luminance map. The noise map is finally applied to the input image for specified Steps.

Footnotes

  1. Yes. I know the actual Stable Diffusion pipeline works with the noise in the latent space. This Extension works entirely in the normal pixel space. And thus, this Extension has nothing to do with Offset Noise.

About

An Extension for Automatic1111 Webui that enhances the quality of img2img upscale

Topics

Resources

License

Stars

Watchers

Forks

Languages