sd-webui-vectorscope-cc/README.md

4.6 KiB

SD Webui Vectorscope CC

This is an Extension for the Automatic1111 Webui, which performs some kind of Offset Noise* natively.

Note: This Extension is the result of my numerous trial and error*. I have no idea how and why this works. 💀

How to Use

After installing this Extension, you will a new section in both txt2img and img2img tabs. Refer to the parameters and sample images below, and play around with the values.

Note: Since this modifies the underlying latent noise, the composition may change drastically.

Parameters

  • Enable: Turn on & off this Extension
  • Alt: Modify an alternative Tensor. The effects are significantly stronger when this is on.
  • Brightness: Adjust the overall brightness of the image
    • Note: Value too high causes the image to be blurry; Value too low causes extra noises to appear.
  • Contrast: Adjust the overall contrast of the image
  • Saturation: Adjust the overall saturation of the image
  • Skip: Only process the first few steps and skip the rest, to combat the issues mentioned in Brightness
Parameter Decrease Increase
R Cyan Red
G Magenta Green
B Yellow Blue

Sample Images

  • Checkpoint: UHD-23
  • Pos. Prompt: (masterpiece, best quality), 1girl, solo, night, street, city, neon_lights
  • Neg. Prompt: (low quality, worst quality:1.2), EasyNegative, EasyNegativeV2
  • Euler a; 20 steps; 7.5 CFG; Hires. fix; Latent (nearest); 16 H.steps; 0.6 D.Str.; Seed:3814649974
  • No offset noise Checkpoints/LoRAs were used

Base
Extension Disabled

Dark
Brightness:-2; Contrast:1

Bright
Brightness:1; Contrast:-0.5; Alt:Enabled

Chill
Brightness:-2.5; Contrast:1.5
R:-0.5; B:1

Mexican Movie
Brightness:3; Contrast:-1.5; Saturation:1
R:1; G:0.5; B:-2

Notice the significant difference even when using the same seed!

Roadmap

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

Offset Noise TL;DR

It was discovered that, the noise functions used during training were flawed, causing Stable Diffusion to always generate images with an average brightness of 0.5.

ie. Even if you prompt for dark/night or bright/snow, the overall image still looks "grey" on average

Technical Explanations


What is Actually Under the Hood

After reading through and messing around with the code, I found out that it is possible to modify the Tensors representing the latent noise used by the Stable Diffusion process.

The dimentions of the Tensors is (1, 4, 64, 64), which can be thought of like this:

1 noise image, with 4 channels, each with 64x64 values

So I tried to play around with the values of each channel, and ended up discovering these relationships between channels and colors. Thus, I wrote it as an Extension.

And why does it work this way? IDK


Vectorscope?

The Extension is named this way because the color relations remind me of the Vectorscope in Premiere Pro. Those who are experienced in Color Correction should be rather familiar with this Extension.