diff --git a/README.md b/README.md
index 399dd62..4791110 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,33 @@
# ComfyUI-sonar
-A janky implementation of Sonar sampling (momentum-based sampling) for [ComfyUI](https://github.com/comfyanonymous/ComfyUI). It may or may not be working _properly_ but it does produce pretty reasonable results. I am using it personally. At this point, I would say it's suitable for general use with the caveat that it's very likely stuff like implementation and inputs to nodes will still be changing fairly frequently. In other words, don't depend on reproduceable generations with this unless you're willing to keep track of the git revision something was generated with.
+A janky implementation of Sonar sampling (momentum-based sampling) for [ComfyUI](https://github.com/comfyanonymous/ComfyUI) as well as an assortment of advanced noise tools.
-Currently supports Euler, Euler Ancestral, and DPM++ SDE sampling.
+Disclaimer: It's very likely stuff like implementation and inputs to nodes will still be changing fairly frequently. In other words, don't depend on reproduceable generations with this unless you're willing to keep track of the git revision something was generated with.
+
+Momentum based sampling currently supports Euler, Euler Ancestral, and DPM++ SDE sampling.
See the [ChangeLog](changelog.md) for recent user-visible changes.
## Description
+This started out as an implementation of Sonar sampling and has evolved into something more like a noise toybox.
+
+Please note that while a lot of the nodes in here have a `Sonar` prefix, that doesn't indicate a relation with
+the original Sonar sampling implementation. Why is there random noise stuff in this repo? Mainly because it gets
+very awkward having node collections depending on other node collections.
+
+Keep reading below this section for information on Sonar sampling and associated nodes.
+
+For information on the advanced noise tools which include many different noise types, nodes to schedule,
+composite and otherwise manipulate noise see:
+
+* [Base Noise Types](docs/base_noise_types.md) - examples and descriptions of the base noise types.
+* [Advanced Power Noise](docs/advanced_power_noise.md) - examples and descriptions of the advanced power noise node.
+* [Advanced Noise Nodes](docs/advanced_noise_nodes.md) - examples and descriptions of advanced noise nodes (schedule, composite, etc).
+* [FreeU Extreme](docs/frux.md) - a build your own FreeU kit that allows advanced filtering, blending, scheduling of effects as well as targetting input and middle blocks.
+
+## Sonar Description
+
See https://github.com/Kahsolt/stable-diffusion-webui-sonar for a more in-depth explanation.
The `direction` parameter should (unless I screwed it up) work like setting sign to positive or negative: `1.0` is positive, `-1.0` is negative. You can also potentially play with fractional values.
@@ -40,117 +60,6 @@ Attempt to add momentum and guidance to the DPM++ SDE sampler. It may not work c
You can optionally plug this into the Sonar sampler nodes. See the [Guidance](#guidance) section below.
-### `NoisyLatentLike`
-
-This node takes a reference latent and generates noise of the same shape. The one required input is `latent`.
-
-You can connect a `SonarCustomNoise` or `SonerPowerNoise` node to the `custom_noise_opt` input: if that is attached, the built in noise type selector is ignored. The generated noise will be multiplied by the `multiplier` value. Note that you cannot use `brownian` noise whether specified directly or via custom noise nodes.
-
-The node has two main modes: simply generate and scale the noise by the multiplier and return or add it to the input latent. In this mode, you don't connect anything to the `mul_by_sigmas_opt` or `model_opt` inputs and you would use other nodes to calculate the correct strength.
-
-In the second mode you must connect sigmas (for example from a `BasicScheduler` node) to the `mul_by_sigmas_opt` input and connect a model to the `model_opt` input. It will calculate the strength based on the first item in the list of sigmas (so you could use something like a `SplitSigmas` node to slice them as needed). Note that `multiplier` still applies: the calculated strength will be scaled by it. This second mode is generally this is the most convenient way to use the node since the two main uses cases are: making a latent with initial noise or adding noise to a latent (for img2img type stuff).
-
-If you want to create noise for initial sampling, connect model and sigmas to the node, connect an empty latent (or one of the appropriate size) to it and that is basically all you need to do (aside from configuring the noise types). For img2img (upscaling, etc), either slice the sigmas at the appropriate or set a denoise in something like the `BasicScheduler` node. **Note**: You also need to turn on the `add_to_latent` toggle. Turning this on doesn't matter for initial noise since an empty latent is all zeros.
-
-
-### `SamplerConfigOverride`
-
-can be used to override configuration settings for other samplers, including the noise type. For example, you could force `euler_ancestral` to use a different noise type. It's also possible to override other settings like `s_noise`, etc. *Note*: The wrapper inspects the sampling function's arguments to see what it supports, so you should connect the sampler directly to this rather than having other nodes (like a different sampler wrapper) in between.
-
-### `SonarCustomNoise`
-
-See the [Noise](#noise) section below for information on noise types.
-
-### `SonarPowerNoise`
-
-This node generates [fractional Brownian motion (fBm) noise](https://en.wikipedia.org/wiki/Fractional_Brownian_motion#Frequency-domain_interpretation). It offers versatility in producing various types of noise including gaussian, pink, 2D brownian noise, and all intermediates.
-
-By default, the node generates normal gaussian noise.
-
-
-
-Expand detailed explanation
-
-
-Here's an overview of its parameters:
-
-- `factor` and `rescale` operate similarly to `SonarCustomNoise`, enabling the addition of multiple sources of noises.
-- `time_brownian` introduces correlation across sampler timesteps for SDE solvers.
-- `alpha` is the main parameter. `alpha > 0` amplifies low frequencies; `alpha = 1` yields pink noise, and `alpha = 2` produces brownian noise. Conversely, for `alpha < 0`, it amplifies high frequencies.
-- `min_freq` and `max_freq` determine the range of frequencies allowed through. Setting `max_freq = `$\sqrt{1/2} \simeq 0.7071$ enables the passage of the highest frequencies. In cases where `alpha < 0`, setting `max_freq = 0.5` is advisable to diminish the power of diagonally oriented frequencies.
-- `stretch`, `rotate`, and `pnorm` alter the filter's shape by stretching, rotating, or cushioning the band-pass region.
-- Lowering `mix` moderates the filter's effect by blending back unfiltered gaussian noise from the same sample.
-- `common_mode` is an attempt to desaturate the latent by injecting the average across channels into every latent channel. However, this may result in a specific color due to the encoding of the unit vector by the latent space. Note that this is done _after_ the `mix`ing of unfiltered gaussian noise.
-- Enabling `preview` provides a visual representation of the filter. `no_mix` sets `mix = 1` for the preview. The preview includes, from left to right:
- - Fourier domain visualization: Low frequencies at the center, with black indicating filtered-out frequencies.
- - Spatial visualization of the 2D kernel: The filtering can be interpreted as convolution with the displayed kernel.
- - Sample: Gaussian sample with shaped frequency spectrum. A single latent channel will look like this.
-
-**Frequency-domain Interpretation**: The Fourier transform decomposes a 2D latent into sinusoids covering all spatial orientations and frequencies. For an independent and identically distributed gaussian sample, energy is evenly distributed across all frequencies and orientations. Scaling the power spectrum by $1 / f^\alpha$, where $\alpha>0$, boosts low frequencies, introducing spatial correlations.
-
-**Spatial Domain Interpretation**: A gaussian latent sample comprises independently sampled pixels, exhibiting no spatial correlations. Conversely, a requirement that each pixel value differs from its neighbors by a $\epsilon \sim \mathcal{N}(0, 1)$ results in 2D brownian noise ($\alpha=2$).
-
-**Seed Considerations**: While the node defaults to outputting gaussian noise, a given seed produce a different sample than the one produced by other gaussian noise sources. This stems from sampling the noise directly in the frequency domain to avoid the cost of a FFT. When `time_brownian = true`, noise sampling occurs in the spatial domain, ensuring that default parameters yield output equivalent to `SonarCustomNoise` set to `brownian`.
-
-
-
-From a usage perspective, using positive alpha will tend to create a colorful effect, using negative alpha will create line/streak like artifacts sort of like an oil painting canvas. Start with small values at first (`-0.1`, `0.1`) and adjust as necessary. `time_brownian` makes the effect of power noise (and alpha) stronger - also note that it can only be used when sampling and not for `NoisyLatentLike`. Setting `common_mode` also generally seems to intensify these effects. Different types of models (normal EPS models, v-prediction models, SDXL) generally react differently to these exotic noise types so my advice is to experiment! Lowering `mix` uses normal gaussian noise for part of the generated noise. For example, `mix=1.0` means 100% power noise, `mix=0.5` means 50/50 power noise and normal gaussian noise. This also is about the same as setting factor to `0.5` and plugging in a `SonarCustomNoise` node with factor at `0.5` also and the type set to `guassian`.
-
-Noise from the `SonarCustomNoise` node and `SonarPowerNoise` can be freely mixed.
-
-### `SonarModulatedNoise`
-
-Experimental noise modulation based on code stolen from
-[ComfyUI-Extra-Samplers](https://github.com/Clybius/ComfyUI-Extra-Samplers). _Probably_ does not work correctly
-for normal sampling — I expect the modulation will be based on the tensor where the noise sampler was created
-rather than each step. However it may be useful for something like restart sampling noise
-(see `KRestartSamplerCustomNoise` below). You can also pass it a reference latent to modulate based on
-instead.
-
-*Note*: It's likely this node will be changed in the future.
-
-### `SonarRepeatedNoise`
-
-Experimental node to cache noise sampler results. Why would you want to do this? Some noise samplers are
-relatively slow (`pyramid` for example) or it may be slow to generate noise if you are mixing many types
-of noise. When `permute` is enabled, a random effect like flipping the noise or rolling it in some dimension
-will be chosen each time the noise sampler is called. I recommend leaving `permute` on. Note that repeated
-noise (especially with `permute` disabled) can be stronger than normal noise, so you may need to rescale to
-a value lower than `1.0` or decrease `s_noise` for the sampler. You may also set the maximum number of
-times noise is reused by setting `max_recycle`.
-
-*Note*: It's likely this node will be changed in the future.
-
-### `SonarCompositeNoise`
-
-Allows compositing noise types based on a mask. Noise is mixed based on the strength of the mask at a location.
-For example, where the mask is 1.0 (max strength) you will get 100% `noise_src` and 0% `noise_dst`. Where the
-mask is 0.75 you will get 75% `noise_src` and 25% `noise_dst`.
-
-### `SonarScheduledNoise`
-
-Allows switching between noise types based on percentage of sampling (note: not percentage of steps). You
-don't have to specify the fallback noise type but instead of noise you'll just get zeros if you do that.
-Most of the time you'll want to connect something like gaussian noise at 1.0 strength there.
-
-### `SonarGuidedNoise`
-
-Works similarly as described in the [Guidance](#guidance) section below, however the guidance is applied
-to the raw noise. You can use `SonarScheduledNoise` to only apply guidance at certain times. Using `euler`
-mode seems considerably stronger than `linear`. The default value should be reasonable for `euler`, may need to be
-increased somewhat for `linear`.
-
-### `KRestartSamplerCustomNoise`
-
-If you have a recent enough version of [ComfyUI_restart_sampling](https://github.com/ssitu/ComfyUI_restart_sampling/)
-installed, you'll also get the `KRestartSamplerCustomNoise` node which is exactly the same as `KRestartSamplerCustom`
-except for adding an optional custom noise input.
-See the restart sampling repo for more information: https://github.com/ssitu/ComfyUI_restart_sampling
-
-### `RestartSamplerCustomNoise`
-
-As above, except this is the custom sampler version.
-
## Sonar Sampler Parameters
Very abbreviated section. The init type can make a big difference. If you use `RANDOM` you can get away with setting `direction` to high values (like up to `2.25` or so) and absurdly low values (like `-30.0`). It's also possible to set `momentum` and `momentum_hist` to negative values, although whether it's a good idea...
@@ -167,27 +76,26 @@ Without guidance it should basically work the same as the ancestral Euler versio
## Noise
-I basically just copied a bunch of noise functions without really knowing what they do. The main thing I can say is they produce a semi-reasonable result and it's different from the other noise samplers. See [Credits](#credits) below.
+See [Base Noise Types](docs/base_noise_types.md) for examples.
-1. `gaussian`: This is the default noise type.
-2. `uniform`: Might enhance background details?
-3. `brownian`: This is the noise type SDE samplers use.
-4. `perlin`
-5. `studentt`: There's a comment that says it may enhance subject details. It seemed to produce a fairly dark result.
-6. `pink`
-7. `highres_pyramid`: Not extensively tested, but it is slower than the other noise types. I would guess it does something like enhance details.
-8. `laplacian`
-9. `power`
-10. `rainbow_mild` and `rainbow_intense`: A combination of green (-ish, the implementation may be broken) noise plus perlin noise. Very colorful results.
-11. `green_test`: Even more rainbow-y than the rainbow noise types. It _probably_ isn't working correctly, but the results are very interesting and colorful. Depending on the model, it may not work well for an initial generation but may be worth trying with img2img type workflows.
-
-You can scroll down to the the [Examples](#examples) section near the bottom to see some example generations with different noise types.
-
-The sampler and `NoisyLatentLike` nodes now take an optional `SonarCustomNoise` input. You can chain `SonarCustomNoise` nodes together to mix different types of noise, similar to how some of the built in ones. It shouldn't matter what order the noise types are chained. If `rescale` is set to `0.0` no rescaling will occur. `factor` is the proportion of that type of noise you want. If you want to use `rescale` it should be on the node that you are plugging into a sampler. Just for example if you had two `SonarCustomNoise` nodes both with `factor=0.7` and `rescale=1.0` on the last one, it would be effectively the same as if you'd used `factor=0.5` and `rescale=1.0` doesn't actually do anything. You can also rescale to values above `1.0` — the result is more noise, similar to increasing `s_noise` above `1.0` on a sampler. The simple explanation is `rescale` means you don't have to make sure the `factor`s add up to the scale you want (which normally would be `1.0`).
+The sampler and `NoisyLatentLike` nodes now take an optional `SonarCustomNoise` input.
**Note**: If you connect the optional `SonarCustomNoise` node to a Sonar sampler, the `NoisyLatentLike` node or the `SamplerConfigOverride` node, it will override the noise type selected in the node.
+## Integrations
+You'll get some bonus features if you have some other node collections installed:
+
+### `KRestartSamplerCustomNoise`
+
+If you have a recent enough version of [ComfyUI_restart_sampling](https://github.com/ssitu/ComfyUI_restart_sampling/)
+installed, you'll also get the `KRestartSamplerCustomNoise` node which is exactly the same as `KRestartSamplerCustom`
+except for adding an optional custom noise input.
+See the restart sampling repo for more information: https://github.com/ssitu/ComfyUI_restart_sampling
+
+### `RestartSamplerCustomNoise`
+
+As above, except this is the custom sampler version.
## Related
@@ -201,9 +109,11 @@ My version was initially based on this Sonar sampler implementation for Diffuser
Many noise generation functions copied from https://github.com/Clybius/ComfyUI-Extra-Samplers with only minor modifications. I may have broken some of them in the process _or_ they may not have been suitable for use and I took them anyway. If they don't work it is not a reflection on the original source.
-`SonarPowerNoise` contributed by [elias-gaeros](https://github.com/elias-gaeros/). Thanks!
+New pyramid noise based on implementation in [Jonathan Whitaker](https://wandb.ai/johnowhitaker/multires_noise/reports/Multi-Resolution-Noise-for-Diffusion-Model-Training--VmlldzozNjYyOTU2)'s article on multi-resolution noise.
-## Examples
+Original `SonarPowerNoise` contributed by [elias-gaeros](https://github.com/elias-gaeros/). Additionally, he provided a lot of guidance with refactoring it to allow separate filtering and other enhancements and answered a multitude of dumb questions. To say those changes are only co-authored is probably giving myself too much credit. Thank you! Your patience and help is very much appreciated.
+
+## Sonar Examples
Unfortunately, right now these examples are somewhat incomplete and out of date. I hope to update them when I get the time.
@@ -226,149 +136,10 @@ Using the `linear` guidance type and `guidance_factor=-0.015`. The reference ima
+### Noise Types
-### Noise Types (img2img)
+See:
-These were generated with `s_noise=1.05` to make the noise effect more pronounced, 30 steps at `0.66` denoise, sonar settings increased slightly to enhance the effect (`momentum=0.9, momentum_hist=0.85, direction=1.0, momentum_init=ZERO`). It is probably easier to compare using these as the image _mostly_ stays the same as the sonar sampler settings change.
-
-
-Expand renoise example images
-
-#### Base
-
-Base image - no Sonar Sampler steps.
-
-
-
-#### Euler A
-
-Normal (non-sonar) Eular A. Not really a comparison with noise (think it would use gaussian) but with the difference in effect from momentum.
-
-
-
-
-#### Gaussian
-
-
-
-#### Brownian
-
-
-
-#### Perlin
-
-
-
-#### Uniform
-
-
-
-#### Highres Pyramid
-
-
-
-#### Pink
-
-
-
-#### StudentT
-
-**outdated**
-
-
-
-
-#### StudentT_test
-
-**outdated**
-
-
-
-#### Laplacian
-
-
-
-#### Power
-
-
-
-#### Rainbow Mild
-
-
-
-#### Rainbow Intense
-
-
-
-#### Green_test
-
-
-
-
-
-### Noise Types (Initial Generations)
-
-These were generated with `s_noise=1.1` to make the noise effect more pronounced, default sonar settings (`momentum=0.95, momentum_hist=0.75, direction=1.0, momentum_init=ZERO`). It may be harder to see the noise effects since the composition can change a lot in initial generations.
-
-
-Expand initial generation example images
-
-#### Gaussian
-
-
-
-#### Brownian
-
-
-
-#### Perlin
-
-
-
-#### Uniform
-
-
-
-#### Highres Pyramid
-
-
-
-#### Pink
-
-
-
-#### StudentT
-
-**outdated**
-
-
-
-#### StudentT_test
-
-**outdated**
-
-
-
-#### Laplacian
-
-
-
-#### Power
-
-
-
-#### Rainbow Mild
-
-
-
-#### Rainbow Intense
-
-
-
-#### Green_test
-
-This might seem too crazy for actual use, but you can actually get decent results using the DPMPP Sonar sampler and a relatively high step count.
-
-
-
-
+* [Base Noise Types](docs/base_noise_types.md)
+* [Advanced Power Noise](docs/advanced_power_noise.md)
+* [Advanced Noise Nodes](docs/advanced_noise_nodes.md)
diff --git a/assets/example_images/frux/freeuv2_builtin.png b/assets/example_images/frux/freeuv2_builtin.png
new file mode 100644
index 0000000..c7d8fbf
Binary files /dev/null and b/assets/example_images/frux/freeuv2_builtin.png differ
diff --git a/assets/example_images/frux/frux.png b/assets/example_images/frux/frux.png
new file mode 100644
index 0000000..0469672
Binary files /dev/null and b/assets/example_images/frux/frux.png differ
diff --git a/assets/example_images/frux/fruxworkflow.png b/assets/example_images/frux/fruxworkflow.png
new file mode 100644
index 0000000..7e5ef0e
Binary files /dev/null and b/assets/example_images/frux/fruxworkflow.png differ
diff --git a/assets/example_images/noise_adv/noise_chain_example.png b/assets/example_images/noise_adv/noise_chain_example.png
new file mode 100644
index 0000000..00cc527
Binary files /dev/null and b/assets/example_images/noise_adv/noise_chain_example.png differ
diff --git a/assets/example_images/noise_adv/noise_composite_brownian.png b/assets/example_images/noise_adv/noise_composite_brownian.png
new file mode 100644
index 0000000..62e2a6d
Binary files /dev/null and b/assets/example_images/noise_adv/noise_composite_brownian.png differ
diff --git a/assets/example_images/noise_adv/noise_composite_pyramid.png b/assets/example_images/noise_adv/noise_composite_pyramid.png
new file mode 100644
index 0000000..82ea6e7
Binary files /dev/null and b/assets/example_images/noise_adv/noise_composite_pyramid.png differ
diff --git a/assets/example_images/noise_adv/noise_composite_pyramid_neg.png b/assets/example_images/noise_adv/noise_composite_pyramid_neg.png
new file mode 100644
index 0000000..4ce25fe
Binary files /dev/null and b/assets/example_images/noise_adv/noise_composite_pyramid_neg.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_dtol_euler.png b/assets/example_images/noise_adv/noise_guided_dtol_euler.png
new file mode 100644
index 0000000..450f262
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_dtol_euler.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_dtol_euler_neg.png b/assets/example_images/noise_adv/noise_guided_dtol_euler_neg.png
new file mode 100644
index 0000000..58fd41e
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_dtol_euler_neg.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_dtol_linear.png b/assets/example_images/noise_adv/noise_guided_dtol_linear.png
new file mode 100644
index 0000000..468905a
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_dtol_linear.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_dtol_linear_neg.png b/assets/example_images/noise_adv/noise_guided_dtol_linear_neg.png
new file mode 100644
index 0000000..358e958
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_dtol_linear_neg.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_ltod_euler.png b/assets/example_images/noise_adv/noise_guided_ltod_euler.png
new file mode 100644
index 0000000..02fbc8b
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_ltod_euler.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_ltod_euler_neg.png b/assets/example_images/noise_adv/noise_guided_ltod_euler_neg.png
new file mode 100644
index 0000000..cd082c4
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_ltod_euler_neg.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_ltod_linear.png b/assets/example_images/noise_adv/noise_guided_ltod_linear.png
new file mode 100644
index 0000000..39f336d
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_ltod_linear.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_ltod_linear_neg.png b/assets/example_images/noise_adv/noise_guided_ltod_linear_neg.png
new file mode 100644
index 0000000..fe18101
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_ltod_linear_neg.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_pattern_euler.png b/assets/example_images/noise_adv/noise_guided_pattern_euler.png
new file mode 100644
index 0000000..cdbab10
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_pattern_euler.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_pattern_euler_neg.png b/assets/example_images/noise_adv/noise_guided_pattern_euler_neg.png
new file mode 100644
index 0000000..5b83603
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_pattern_euler_neg.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_pattern_linear.png b/assets/example_images/noise_adv/noise_guided_pattern_linear.png
new file mode 100644
index 0000000..52fb23b
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_pattern_linear.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_pattern_linear_neg.png b/assets/example_images/noise_adv/noise_guided_pattern_linear_neg.png
new file mode 100644
index 0000000..e3f017e
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_pattern_linear_neg.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_pattern_linear_strong.png b/assets/example_images/noise_adv/noise_guided_pattern_linear_strong.png
new file mode 100644
index 0000000..f3974d3
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_pattern_linear_strong.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_pattern_linear_strong_neg.png b/assets/example_images/noise_adv/noise_guided_pattern_linear_strong_neg.png
new file mode 100644
index 0000000..d621aa1
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_pattern_linear_strong_neg.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_ref_gradient.png b/assets/example_images/noise_adv/noise_guided_ref_gradient.png
new file mode 100644
index 0000000..f3169e1
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_ref_gradient.png differ
diff --git a/assets/example_images/noise_adv/noise_guided_ref_pattern.png b/assets/example_images/noise_adv/noise_guided_ref_pattern.png
new file mode 100644
index 0000000..380ecf4
Binary files /dev/null and b/assets/example_images/noise_adv/noise_guided_ref_pattern.png differ
diff --git a/assets/example_images/noise_adv/noise_modulated_ss_dims1.png b/assets/example_images/noise_adv/noise_modulated_ss_dims1.png
new file mode 100644
index 0000000..eaa6711
Binary files /dev/null and b/assets/example_images/noise_adv/noise_modulated_ss_dims1.png differ
diff --git a/assets/example_images/noise_adv/noise_modulated_ss_dims2.png b/assets/example_images/noise_adv/noise_modulated_ss_dims2.png
new file mode 100644
index 0000000..7727527
Binary files /dev/null and b/assets/example_images/noise_adv/noise_modulated_ss_dims2.png differ
diff --git a/assets/example_images/noise_adv/noise_modulated_ss_dims3.png b/assets/example_images/noise_adv/noise_modulated_ss_dims3.png
new file mode 100644
index 0000000..c5db095
Binary files /dev/null and b/assets/example_images/noise_adv/noise_modulated_ss_dims3.png differ
diff --git a/assets/example_images/noise_adv/noise_modulated_ss_dims3_studentt.png b/assets/example_images/noise_adv/noise_modulated_ss_dims3_studentt.png
new file mode 100644
index 0000000..528c9a0
Binary files /dev/null and b/assets/example_images/noise_adv/noise_modulated_ss_dims3_studentt.png differ
diff --git a/assets/example_images/noise_adv/noise_modulated_ss_neg_dims1.png b/assets/example_images/noise_adv/noise_modulated_ss_neg_dims1.png
new file mode 100644
index 0000000..049d7e7
Binary files /dev/null and b/assets/example_images/noise_adv/noise_modulated_ss_neg_dims1.png differ
diff --git a/assets/example_images/noise_adv/noise_modulated_ss_neg_dims2.png b/assets/example_images/noise_adv/noise_modulated_ss_neg_dims2.png
new file mode 100644
index 0000000..15d0b56
Binary files /dev/null and b/assets/example_images/noise_adv/noise_modulated_ss_neg_dims2.png differ
diff --git a/assets/example_images/noise_adv/noise_modulated_ss_neg_dims3.png b/assets/example_images/noise_adv/noise_modulated_ss_neg_dims3.png
new file mode 100644
index 0000000..6c1045b
Binary files /dev/null and b/assets/example_images/noise_adv/noise_modulated_ss_neg_dims3.png differ
diff --git a/assets/example_images/noise_adv/noise_modulated_ss_neg_dims3_studentt.png b/assets/example_images/noise_adv/noise_modulated_ss_neg_dims3_studentt.png
new file mode 100644
index 0000000..9f1a466
Binary files /dev/null and b/assets/example_images/noise_adv/noise_modulated_ss_neg_dims3_studentt.png differ
diff --git a/assets/example_images/noise_adv/noise_repeated_adjusted.png b/assets/example_images/noise_adv/noise_repeated_adjusted.png
new file mode 100644
index 0000000..f6c7d9d
Binary files /dev/null and b/assets/example_images/noise_adv/noise_repeated_adjusted.png differ
diff --git a/assets/example_images/noise_adv/noise_repeated_normal.png b/assets/example_images/noise_adv/noise_repeated_normal.png
new file mode 100644
index 0000000..1e64685
Binary files /dev/null and b/assets/example_images/noise_adv/noise_repeated_normal.png differ
diff --git a/assets/example_images/noise_base_types/noise_brownian.png b/assets/example_images/noise_base_types/noise_brownian.png
new file mode 100644
index 0000000..ed064f9
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_brownian.png differ
diff --git a/assets/example_images/noise_base_types/noise_gaussian.png b/assets/example_images/noise_base_types/noise_gaussian.png
new file mode 100644
index 0000000..e4356ea
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_gaussian.png differ
diff --git a/assets/example_images/noise_base_types/noise_green_test.png b/assets/example_images/noise_base_types/noise_green_test.png
new file mode 100644
index 0000000..ad756d3
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_green_test.png differ
diff --git a/assets/example_images/noise_base_types/noise_green_test_neg.png b/assets/example_images/noise_base_types/noise_green_test_neg.png
new file mode 100644
index 0000000..b4aa3c8
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_green_test_neg.png differ
diff --git a/assets/example_images/noise_base_types/noise_highres_pyramid.png b/assets/example_images/noise_base_types/noise_highres_pyramid.png
new file mode 100644
index 0000000..ccab023
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_highres_pyramid.png differ
diff --git a/assets/example_images/noise_base_types/noise_highres_pyramid_area.png b/assets/example_images/noise_base_types/noise_highres_pyramid_area.png
new file mode 100644
index 0000000..c335ecd
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_highres_pyramid_area.png differ
diff --git a/assets/example_images/noise_base_types/noise_highres_pyramid_bislerp.png b/assets/example_images/noise_base_types/noise_highres_pyramid_bislerp.png
new file mode 100644
index 0000000..d89c0ba
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_highres_pyramid_bislerp.png differ
diff --git a/assets/example_images/noise_base_types/noise_laplacian.png b/assets/example_images/noise_base_types/noise_laplacian.png
new file mode 100644
index 0000000..c032c83
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_laplacian.png differ
diff --git a/assets/example_images/noise_base_types/noise_perlin.png b/assets/example_images/noise_base_types/noise_perlin.png
new file mode 100644
index 0000000..5810e8f
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_perlin.png differ
diff --git a/assets/example_images/noise_base_types/noise_pink.png b/assets/example_images/noise_base_types/noise_pink.png
new file mode 100644
index 0000000..33accd8
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pink.png differ
diff --git a/assets/example_images/noise_base_types/noise_power_builtin.png b/assets/example_images/noise_base_types/noise_power_builtin.png
new file mode 100644
index 0000000..aa4af78
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_power_builtin.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_alpha_-0.5.png b/assets/example_images/noise_base_types/noise_powernoise_alpha_-0.5.png
new file mode 100644
index 0000000..e1234ff
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_alpha_-0.5.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_alpha_-1.5.png b/assets/example_images/noise_base_types/noise_powernoise_alpha_-1.5.png
new file mode 100644
index 0000000..8274b45
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_alpha_-1.5.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_alpha_0.25.png b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.25.png
new file mode 100644
index 0000000..2e41ad4
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.25.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_alpha_0.25_common_0.25.png b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.25_common_0.25.png
new file mode 100644
index 0000000..a73ef4d
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.25_common_0.25.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_alpha_0.35.png b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.35.png
new file mode 100644
index 0000000..f495935
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.35.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_alpha_0.35_common_0.35.png b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.35_common_0.35.png
new file mode 100644
index 0000000..8f489f2
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.35_common_0.35.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_alpha_0.5.png b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.5.png
new file mode 100644
index 0000000..be0dfb5
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.5.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_alpha_0.5_common_0.5.png b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.5_common_0.5.png
new file mode 100644
index 0000000..6d09159
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_alpha_0.5_common_0.5.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_default.png b/assets/example_images/noise_base_types/noise_powernoise_default.png
new file mode 100644
index 0000000..d16c845
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_default.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_tb.png b/assets/example_images/noise_base_types/noise_powernoise_tb.png
new file mode 100644
index 0000000..01b5780
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_tb.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_tb_alpha_-0.5.png b/assets/example_images/noise_base_types/noise_powernoise_tb_alpha_-0.5.png
new file mode 100644
index 0000000..0c12c8a
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_tb_alpha_-0.5.png differ
diff --git a/assets/example_images/noise_base_types/noise_powernoise_tb_alpha_0.5.png b/assets/example_images/noise_base_types/noise_powernoise_tb_alpha_0.5.png
new file mode 100644
index 0000000..c6bebf1
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_powernoise_tb_alpha_0.5.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid.png b/assets/example_images/noise_base_types/noise_pyramid.png
new file mode 100644
index 0000000..600ac38
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_area.png b/assets/example_images/noise_base_types/noise_pyramid_area.png
new file mode 100644
index 0000000..95ef7b7
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_area.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_bislerp.png b/assets/example_images/noise_base_types/noise_pyramid_bislerp.png
new file mode 100644
index 0000000..5709f44
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_bislerp.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_discount5.png b/assets/example_images/noise_base_types/noise_pyramid_discount5.png
new file mode 100644
index 0000000..d1e8268
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_discount5.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_mix.png b/assets/example_images/noise_base_types/noise_pyramid_mix.png
new file mode 100644
index 0000000..9e42f79
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_mix.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_mix_area.png b/assets/example_images/noise_base_types/noise_pyramid_mix_area.png
new file mode 100644
index 0000000..0cba6ba
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_mix_area.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_mix_area_neg.png b/assets/example_images/noise_base_types/noise_pyramid_mix_area_neg.png
new file mode 100644
index 0000000..eb14e9d
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_mix_area_neg.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_mix_bislerp.png b/assets/example_images/noise_base_types/noise_pyramid_mix_bislerp.png
new file mode 100644
index 0000000..2fdb8e7
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_mix_bislerp.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_mix_bislerp_neg.png b/assets/example_images/noise_base_types/noise_pyramid_mix_bislerp_neg.png
new file mode 100644
index 0000000..a45163e
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_mix_bislerp_neg.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_mix_neg.png b/assets/example_images/noise_base_types/noise_pyramid_mix_neg.png
new file mode 100644
index 0000000..09a9991
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_mix_neg.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_neg.png b/assets/example_images/noise_base_types/noise_pyramid_neg.png
new file mode 100644
index 0000000..74a0854
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_neg.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_old.png b/assets/example_images/noise_base_types/noise_pyramid_old.png
new file mode 100644
index 0000000..d647150
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_old.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_old_area.png b/assets/example_images/noise_base_types/noise_pyramid_old_area.png
new file mode 100644
index 0000000..4941745
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_old_area.png differ
diff --git a/assets/example_images/noise_base_types/noise_pyramid_old_bislerp.png b/assets/example_images/noise_base_types/noise_pyramid_old_bislerp.png
new file mode 100644
index 0000000..b87d085
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_pyramid_old_bislerp.png differ
diff --git a/assets/example_images/noise_base_types/noise_rainbow_intense.png b/assets/example_images/noise_base_types/noise_rainbow_intense.png
new file mode 100644
index 0000000..5cd2e4a
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_rainbow_intense.png differ
diff --git a/assets/example_images/noise_base_types/noise_rainbow_mild.png b/assets/example_images/noise_base_types/noise_rainbow_mild.png
new file mode 100644
index 0000000..2ad8b11
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_rainbow_mild.png differ
diff --git a/assets/example_images/noise_base_types/noise_studentt.png b/assets/example_images/noise_base_types/noise_studentt.png
new file mode 100644
index 0000000..7236a51
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_studentt.png differ
diff --git a/assets/example_images/noise_base_types/noise_uniform.png b/assets/example_images/noise_base_types/noise_uniform.png
new file mode 100644
index 0000000..9ccb8b8
Binary files /dev/null and b/assets/example_images/noise_base_types/noise_uniform.png differ
diff --git a/docs/advanced_noise_nodes.md b/docs/advanced_noise_nodes.md
new file mode 100644
index 0000000..a39abce
--- /dev/null
+++ b/docs/advanced_noise_nodes.md
@@ -0,0 +1,316 @@
+# Advanced Nodes
+
+## Normalization
+
+Normalization essentially rebalances the noise (or mixture of noise) to 1.0 strength and then scales based
+on the factor of the node. Most nodes will allow you to set three values:
+
+* `default`: By default, noise will be normalized only just before it's used. So you could consider this setting to be false except for where it is connected to an actual noise consumer (i.e. a `SamplerConfigOverride` node).
+* `forced`: Will always normalize.
+* `disabled`: Will never normalize.
+
+## `SONAR_CUSTOM_NOISE`
+
+This node output type actually constitutes a chain of noise items. For most nodes, when you use it as input,
+they will add an item to the chain. There are some exceptions that treat the `SONAR_CUSTOM_NOISE` input as a list:
+
+* `SonarRepeatedNoise`
+* `SonarRandomNoise`
+
+There are also some exceptions that will consume the list rather than adding an item to it:
+
+* `SonarModulatedNoise`
+* `SonarCompositeNoise`
+* `SonarScheduledNoise`
+* `SonarGuidedNoise`
+
+The distinction is mainly only important when setting `rescale`. Visual example:
+
+
+
+It may be counter intuitive that there are actually two separate chains here.
+
+## Examples
+
+Note on the examples included for some of these nodes:
+
+The example images included for some of these nodes all have metadata and can be loaded in ComfyUI.
+Generated using `dpmpp_2s_ancestral`, Karras scheduler and starting out with gaussian noise then switching
+to the custom noise type at the 35% mark.
+
+***
+
+### `SonarCustomNoise`
+
+You can chain `SonarCustomNoise` nodes together to mix different types of noise. The order of `SonarCustomNoise` nodes is not important.
+
+Parameters:
+
+- `factor` controls the strength of the noise.
+- `rescale` controls rebalancing `factor` for nodes in the chain. When `rescale` is set to `0.0`, no rebalancing will occur. Otherwise the current node as well as the nodes connect to it will have their `factor` adjusted to add up to the rescale value. For example, if you have three nodes with `factor` 1.0 and the last with `rescale` 1.0, then the `factor` value will be adjusted to `1/3 = 0.3333...`. *Note*: Rescaling uses the `factor` absolute value.
+- `noise_type` allows you to select the built-in noise type.
+
+***
+
+### `NoisyLatentLike`
+
+This node takes a reference latent and generates noise of the same shape. The one required input is `latent`.
+
+You can connect a `SonarCustomNoise` or `SonerPowerNoise` node to the `custom_noise_opt` input: if that is attached, the built in noise type selector is ignored. The generated noise will be multiplied by the `multiplier` value. **Note**: If you select `brownian` noise (either through the dropdown or by connecting custom noise nodes) you must connect a model and sigmas.
+
+The node has two main modes: simply generate and scale the noise by the multiplier and return or add it to the input latent. In this mode, you don't connect anything to the `mul_by_sigmas_opt` or `model_opt` inputs and you would use other nodes to calculate the correct strength.
+
+In the second mode you must connect sigmas (for example from a `BasicScheduler` node) to the `mul_by_sigmas_opt` input and connect a model to the `model_opt` input. It will calculate the strength based on the first item in the list of sigmas (so you could use something like a `SplitSigmas` node to slice them as needed). Note that `multiplier` still applies: the calculated strength will be scaled by it. This second mode is generally this is the most convenient way to use the node since the two main uses cases are: making a latent with initial noise or adding noise to a latent (for img2img type stuff).
+
+If you want to create noise for initial sampling, connect model and sigmas to the node, connect an empty latent (or one of the appropriate size) to it and that is basically all you need to do (aside from configuring the noise types). For img2img (upscaling, etc), either slice the sigmas at the appropriate or set a denoise in something like the `BasicScheduler` node. *Note*: For img2img, you also need to turn on the `add_to_latent` toggle. Turning this on doesn't matter for initial noise since an empty latent is all zeros.
+
+**Note**: This node does not currently respect the latent noise mask.
+
+***
+
+### `SamplerConfigOverride`
+
+This node can be used to override configuration settings for other samplers, including the noise type. For example, you could force `euler_ancestral` to use a different noise type. It's also possible to override other settings like `s_noise`, etc. *Note*: The wrapper inspects the sampling function's arguments to see what it supports, so you should connect the sampler directly to this rather than having other nodes (like a different sampler wrapper) in between.
+
+***
+
+### `SonarModulatedNoise`
+
+Experimental noise modulation based on code stolen from
+[ComfyUI-Extra-Samplers](https://github.com/Clybius/ComfyUI-Extra-Samplers). `intensity` and `frequency` modulation
+types _probably_ do not work correctly for normal sampling — I expect the modulation will be based on the tensor
+where the noise sampler was created rather than each step. However it may be useful for something like restart sampling
+noise (see `KRestartSamplerCustomNoise` below). You can also pass it a reference latent to modulate based on
+instead (only used for `intensity` and `frequency` modulation types).
+
+*Note*: It's likely this node will be changed in the future.
+
+
+
+⭐ Expand Example Images ⭐
+
+
+
+These examples all use the `spectral_signum` modulation type as it doesn't depend on a reference.
+
+#### Positive Strength
+
+Dims 3:
+
+
+
+Dims 3 (with studentt noise):
+
+
+
+Dims 2:
+
+
+
+Dims 1:
+
+
+
+#### Negative Strength
+
+Dims 3:
+
+
+
+Dims 3 (with studentt noise):
+
+
+
+Dims 2:
+
+
+
+Dims 1:
+
+
+
+
+
+***
+
+### `SonarRepeatedNoise`
+
+Experimental node to cache noise sampler results. Why would you want to do this? Some noise samplers are
+relatively slow (`pyramid` for example) or it may be slow to generate noise if you are mixing many types
+of noise. When `permute` is enabled, a random effect like flipping the noise or rolling it in some dimension
+will be chosen each time the noise sampler is called. I recommend leaving `permute` on. Note that repeated
+noise (especially with `permute` disabled) can be stronger than normal noise, so you may need to rescale to
+a value lower than `1.0` or decrease `s_noise` for the sampler. You may also set the maximum number of
+times noise is reused by setting `max_recycle`.
+
+
+
+⭐ Expand Example Images ⭐
+
+
+
+Repeated noise is very strong (especially when permute is disabled). You generally won't get good
+results using 1.0 strength:
+
+
+
+I recommend considerably decreasing the strength (example here is using 0.75 which is still a bit too much):
+
+
+
+
+
+***
+
+### `SonarCompositeNoise`
+
+Allows compositing noise types based on a mask. Noise is mixed based on the strength of the mask at a location.
+For example, where the mask is 1.0 (max strength) you will get 100% `noise_src` and 0% `noise_dst`. Where the
+mask is 0.75 you will get 75% `noise_src` and 25% `noise_dst`.
+
+
+
+⭐ Expand Example Images ⭐
+
+
+
+These examples use a base noise type of gaussian and composite in an area with a different type
+near middle. The custom noise is also set to a higher strength than normal to highlight the effect.
+
+**No Composite (for comparison)**
+
+
+
+**Brownian**
+
+
+
+**Pyramid**
+
+
+
+**Pyramid negative factor**
+
+
+
+
+
+***
+
+### `SonarScheduledNoise`
+
+Allows switching between noise types based on percentage of sampling (note: not percentage of steps).
+
+**Note**: You don't have to connect the fallback noise type but the default is to generate _no_ noise, which
+is most likely not what you want. The majority of the time, it is recommend to connect something like gaussian
+noise at 1.0 strength.
+
+All the example images here use the `SonarScheduledNoise` node so you can pick any one of them to see it
+in action!
+
+***
+
+### `SonarGuidedNoise`
+
+Works similarly as described in the [Guidance](../README.md#guidance) section of the main README, however the guidance is applied
+to the raw noise. You can use `SonarScheduledNoise` to only apply guidance at certain times. Using `euler`
+mode seems considerably stronger than `linear`. The default value should be reasonable for `euler`, may need to be
+increased somewhat for `linear`.
+
+
+
+⭐ Expand Example Images ⭐
+
+
+
+#### Pattern
+
+These examples use a half circle pattern as the reference: 
+
+
+##### Euler
+
+Positive strength:
+
+
+
+Negative strength:
+
+
+
+***
+
+##### Linear
+
+Normal positive strength:
+
+
+
+Normal negative strength:
+
+
+
+Strong positive strength:
+
+
+
+Strong negative strength:
+
+
+
+
+***
+
+#### Gradient
+
+These examples use a vertical gradient as the reference: 
+
+That is dark to light. Light to dark examples just flip the gradient vertically.
+
+##### Euler
+
+Dark to light:
+
+
+
+Light to dark:
+
+
+
+Dark to light (negative strength):
+
+
+
+Light to dark (negative strength):
+
+
+
+***
+
+##### Linear
+
+Dark to light:
+
+
+
+Light to dark:
+
+
+
+Dark to light (negative strength):
+
+
+
+Light to dark (negative strength):
+
+
+
+
+
+***
+
+### `SonarRandomNoise`
+
+Randomly chooses between the noise types in the chain connected to it each time the noise sampler is called.
+You generally do not want to use `rescale` here. You can also set `mix_count` to choose and combine multiple
+types.
diff --git a/docs/advanced_power_noise.md b/docs/advanced_power_noise.md
new file mode 100644
index 0000000..e466287
--- /dev/null
+++ b/docs/advanced_power_noise.md
@@ -0,0 +1,127 @@
+# Advanced Power Noise
+
+## `SonarPowerNoise`
+
+This node generates [fractional Brownian motion (fBm) noise](https://en.wikipedia.org/wiki/Fractional_Brownian_motion#Frequency-domain_interpretation). It offers versatility in producing various types of noise including gaussian, pink, 2D brownian noise, and all intermediates.
+
+By default, the node generates normal gaussian noise.
+
+
+
+⭐⭐ Expand advanced parameter explanation ⭐⭐
+
+Here's an overview of its parameters:
+
+- `factor` and `rescale` operate similarly to `SonarCustomNoise`, enabling the addition of multiple sources of noises.
+- `time_brownian` introduces correlation across sampler timesteps for SDE solvers.
+- `alpha` is the main parameter. `alpha > 0` amplifies low frequencies; `alpha = 1` yields pink noise, and `alpha = 2` produces brownian noise. Conversely, for `alpha < 0`, it amplifies high frequencies.
+- `min_freq` and `max_freq` determine the range of frequencies allowed through. Setting `max_freq = `$\sqrt{1/2} \simeq 0.7071$ enables the passage of the highest frequencies. In cases where `alpha < 0`, setting `max_freq = 0.5` is advisable to diminish the power of diagonally oriented frequencies.
+- `stretch`, `rotate`, and `pnorm` alter the filter's shape by stretching, rotating, or cushioning the band-pass region.
+- Lowering `mix` moderates the filter's effect by blending back unfiltered gaussian noise from the same sample.
+- `common_mode` is an attempt to desaturate the latent by injecting the average across channels into every latent channel. **FIXME: it's not all channels anymore** However, this may result in a specific color due to the encoding of the unit vector by the latent space. Note that this is done _after_ the `mix`ing of unfiltered gaussian noise.
+- `channel_correlation` **FIXME**: TBD
+- Enabling `preview` provides a visual representation of the filter. `no_mix` sets `mix = 1` for the preview. The preview includes, from left to right:
+ - Fourier domain visualization: Low frequencies at the center, with black indicating filtered-out frequencies.
+ - Spatial visualization of the 2D kernel: The filtering can be interpreted as convolution with the displayed kernel.
+ - Sample: Gaussian sample with shaped frequency spectrum. A single latent channel will look like this.
+
+**Frequency-domain Interpretation**: The Fourier transform decomposes a 2D latent into sinusoids covering all spatial orientations and frequencies. For an independent and identically distributed gaussian sample, energy is evenly distributed across all frequencies and orientations. Scaling the power spectrum by $1 / f^\alpha$, where $\alpha>0$, boosts low frequencies, introducing spatial correlations.
+
+**Spatial Domain Interpretation**: A gaussian latent sample comprises independently sampled pixels, exhibiting no spatial correlations. Conversely, a requirement that each pixel value differs from its neighbors by a $\epsilon \sim \mathcal{N}(0, 1)$ results in 2D brownian noise ($\alpha=2$).
+
+**Seed Considerations**: While the node defaults to outputting gaussian noise, a given seed produce a different sample than the one produced by other gaussian noise sources. This stems from sampling the noise directly in the frequency domain to avoid the cost of a FFT. When `time_brownian = true`, noise sampling occurs in the spatial domain, ensuring that default parameters yield output equivalent to `SonarCustomNoise` set to `brownian`.
+
+
+
+
+
+From a usage perspective, using positive alpha will tend to create a colorful effect, using negative alpha will create line/streak like artifacts sort of like an oil painting canvas. Start with small values at first (`-0.1`, `0.1`) and adjust as necessary. `time_brownian` makes the effect of power noise (and alpha) stronger - also note that it can only be used when sampling and not for `NoisyLatentLike`. Setting `common_mode` also generally seems to intensify these effects. Different types of models (normal EPS models, v-prediction models, SDXL) generally react differently to these exotic noise types so my advice is to experiment! Lowering `mix` uses normal gaussian noise for part of the generated noise. For example, `mix=1.0` means 100% power noise, `mix=0.5` means 50/50 power noise and normal gaussian noise. This also is about the same as setting factor to `0.5` and plugging in a `SonarCustomNoise` node with factor at `0.5` also and the type set to `guassian`.
+
+Noise from the `SonarCustomNoise` node and `SonarPowerNoise` can be freely mixed.
+
+## `SonarPowerFilterNoise`
+
+This node lets you connect a filter (see below) and a custom noise chain. It basically lets you run any type of noise through the power noise filter.
+
+New parameters:
+
+* `filter_norm_factor` controls how much normalization is applied to the filter. `1.0` means fully normalized, `0.0` means no normalization.
+* You may set the preview type to `custom` to see a color preview of the filtered noise. Note that this uses whatever preview type you have configured in ComfyUI (for example, TAESD). The preview is based on SD 1.5's interpretation of the noise.
+
+## `SonarPowerFilter`
+
+Most of the parameters here are similar to the `SonarPowerNoise` node. New parameters:
+
+* `scale` allows you to scale the filter (you could consider this to be set to `1.0` in the `SonarPowerNoise` node).
+* `compose_mode` allows you to compose multiple filters. Note that composition occurs like `current_filter OPERATION connected_filter`. So if you set `compose_mode` to `sub`, you will get `current_filter - connected_filter`. Scaling occurs before composition.
+
+## `SonarPreviewFilter`
+
+Allows you to preview a filter. It does not modify the input filter.
+
+***
+
+## Examples
+
+The example images are all workflow-included. Generated using `dpmpp_2s_ancestral`, Karras scheduler and
+starting out with gaussian noise then switching to power noise at the 35% mark. `filter_norm_factor` is set to
+1.0 in these examples.
+
+### Node Defaults
+
+This should be the same as normal gaussian noise.
+
+
+
+### Positive Alpha
+
+Positive alpha generally produces a colorful effect. Start with relatively low values and increase
+until you achieve the desired result. Note that these examples use _relatively_ extreme settings.
+
+With alpha 0.25:
+
+
+
+With alpha 0.25, common mode 0.25:
+
+
+
+With alpha 0.35:
+
+
+
+With alpha 0.35, common mode 0.35:
+
+
+
+With alpha 0.5:
+
+
+
+With alpha 0.5, common mode 0.5:
+
+
+
+### Negative Alpha
+
+With alpha -0.5:
+
+
+
+With alpha -1.5:
+
+
+
+### Time Brownian Mode
+
+
+
+With alpha 0.5:
+
+
+
+With alpha -0.5:
+
+
+
+
diff --git a/docs/base_noise_types.md b/docs/base_noise_types.md
new file mode 100644
index 0000000..eddf57d
--- /dev/null
+++ b/docs/base_noise_types.md
@@ -0,0 +1,173 @@
+# Base Noise Examples
+
+The example images are all workflow-included. Generated using `dpmpp_2s_ancestral`, Karras scheduler and
+starting out with gaussian noise then switching to the custom noise type at the 35% mark.
+
+Some of these noise types are too extreme to be used for initial generations or even with pure
+noise of that type. However you can either schedule the noise type to kick in at a certain percentage
+(as in these examples) and/or mix it with something a bit more run of the mill. See
+[advanced_noise_nodes](advanced_noise_nodes.md).
+
+## Brownian
+
+This is the default noise type for SDE samplers.
+
+
+
+***
+## Gaussian
+
+This is the default noise type for non-SDE samplers.
+
+
+
+***
+
+## Green Test
+
+This is _probably_ not actually green noise. It produces a very colorful effect, however
+it's very strong and not really suitable for initial generation.
+
+
+
+You can also use a negative multiplier to achieve a different effect:
+
+
+
+***
+
+## Highres Pyramid
+
+
+
+Variation using area scaling:
+
+
+
+Variation using bislerp scaling:
+
+
+
+***
+
+## Laplacian
+
+
+
+***
+
+## Perlin
+
+
+
+***
+
+## Pink
+
+
+
+***
+
+## Power Builtin
+
+
+
+Also see the [Advanced Power Noise](advanced_power_noise.md) examples.
+
+***
+
+## Pyramid
+
+
+
+You can also use a negative multiplier to achieve a different effect:
+
+
+
+Variation using area scaling:
+
+
+
+Variation using bislerp scaling:
+
+
+
+***
+
+## Pyramid Discount5
+
+Pyramid noise, generated with a discount of 0.5. (Generally less extreme effect.)
+
+
+
+***
+
+## Pyramid Mix
+
+Pyramid mix is a combination of positive and negative pyramid noise. The effect on
+the generation is mild compared to raw pyramid noise.
+
+
+
+You can also use a negative multiplier to achieve a different effect:
+
+
+
+Variation using area scaling:
+
+
+
+You can also use a negative multiplier to achieve a different effect:
+
+
+
+Variation using bislerp scaling:
+
+
+
+You can also use a negative multiplier to achieve a different effect:
+
+
+
+***
+
+## Pyramid Old
+
+This may not actually be pyramid noise at all. Also note that it is quite slow to generate as it
+effectively generates noise ~60x the latent size.
+
+
+
+Variation using area scaling:
+
+
+
+Variation using bislerp scaling:
+
+
+
+***
+
+## Rainbow
+
+Rainbow is a mix of Perlin and Green noise types.
+
+The "mild" variation uses a relatively low proportion of green noise:
+
+
+
+The "intense" variation uses a higher proportion of green noise for a more extreme effect.
+
+
+
+***
+
+## Studentt
+
+
+
+***
+
+## Uniform
+
+
diff --git a/docs/frux.md b/docs/frux.md
new file mode 100644
index 0000000..d83dd4c
--- /dev/null
+++ b/docs/frux.md
@@ -0,0 +1,40 @@
+# FreeU Extreme
+
+I admit it's a really dumb name. This is basically a build-your-own FreeU kit.
+
+## Example Workflow
+
+Workflow image is also workflow-embedded.
+
+
+
+## Nodes
+
+### `FreeUExtreme`
+
+Allows you to apply a FreeU (v1 or v2) effect to input, output or middle blocks.
+
+**Note**: ComfyUI by default does not allow patching the middle in the required way. You will need to have
+[FreeU Advanced](https://github.com/WASasquatch/FreeU_Advanced) installed and enabled, otherwise connecting
+configs to the `middle` input will have no effect.
+
+Also note that input and middle do not have a `skip` target so configs targetting that will never match.
+
+### `FreeUExtremeConfig`
+
+Better documentation coming soon hopefully. For now, see the workflow example above to get started.
+
+Also see documentation on filters [here](./advanced_power_noise.md#sonarpowerfilter).
+
+## Examples
+
+ComfyUI built-in FreeU V2 for reference:
+
+
+
+FreeU Extreme example:
+
+
+
+Note that this is just for example purposes - no attempt was made to get a pretty generation. You
+may get better results enabling `hidden_mean` even for the skip connections.
diff --git a/py/nodes.py b/py/nodes.py
index 4fd1451..d7c20a5 100644
--- a/py/nodes.py
+++ b/py/nodes.py
@@ -878,6 +878,7 @@ NODE_CLASS_MAPPINGS = {
"SamplerSonarEuler": SamplerNodeSonarEuler,
"SamplerSonarEulerA": SamplerNodeSonarEulerAncestral,
"SamplerSonarDPMPPSDE": SamplerNodeSonarDPMPPSDE,
+ "SonarGuidanceConfig": GuidanceConfigNode,
"SamplerConfigOverride": SamplerNodeConfigOverride,
"NoisyLatentLike": NoisyLatentLikeNode,
"SonarCustomNoise": SonarCustomNoiseNode,
@@ -887,7 +888,6 @@ NODE_CLASS_MAPPINGS = {
"SonarScheduledNoise": SonarScheduledNoiseNode,
"SonarGuidedNoise": SonarGuidedNoiseNode,
"SonarRandomNoise": SonarRandomNoiseNode,
- "SonarGuidanceConfig": GuidanceConfigNode,
}
NODE_DISPLAY_NAME_MAPPINGS = {}
diff --git a/py/powernoise.py b/py/powernoise.py
index 97c9d8c..0ada675 100644
--- a/py/powernoise.py
+++ b/py/powernoise.py
@@ -1,3 +1,7 @@
+# Initial implementation by https://github.com/elias-gaeros/
+# He also provided a lot of help with refactoring and other improvements. Thanks!
+# (But if anything is broken in here, I'm almost certainly the one to blame.)
+
from __future__ import annotations
import math