Nodes/ComfyUI-sonar/FreeUExtremeConfig
ComfyUI Node

FreeUExtremeConfig

Build-your-own FreeU, one knob at a time

By blepping·Created 3 years ago·Updated 9 days ago· 49
FreeUExtremeConfig
  • sonar_power_filter_opt
  • frux_config_opt
  • FRUX_CONFIG
stage_1true
stage_2false
stage_3false
targetbackbone
start0.000
end1.000
slice1.000
slice_offset0.000
filter_norm0.000
scale1.000
blend1.000
blend_modelerp
hidden_meantrue
finaltrue

This node is why FreeUExtreme is called Extreme. Stock FreeU gives you four numbers. FreeUExtremeConfig gives you a config object with fourteen controls that describe where, when, and how hard the FreeU effect applies - and the output is a FRUX_CONFIG socket you chain into FreeUExtreme's input_config, middle_config, or output_config inputs. One config node doesn't patch anything on its own; it's a recipe that the FreeUExtreme node cooks.

The mental model

Think of a config as a named rule: "apply this filter to the backbone layers of the middle blocks, from 25% to 75% of sampling, at 80% strength, blended with lerp." The three stage_1/stage_2/stage_3 toggles pick which network stage the rule targets (stage 1 is the default-on one), and target chooses backbone, skip, or both - that's the classic FreeU axis of "boost the main path vs. trim the skip connections." hidden_mean (default true) is described as "you can think of this as FreeU V2 mode," i.e. the modern V2 formulation. Leave it on.

Then there are the scheduling and geometry knobs:

  • start / end (default 0 → 1) - the window of sampling, as a percentage, where this config is active. This is how you apply FreeU only in the composition-establishing early steps, or only for the detail-refining later ones.
  • slice / slice_offset - which portion of each layer gets the effect. slice 0.25, offset 0.25 means only the band from 25% to 50% of the layer is affected. Fiddly, but this is where people get the "selective sharpening" trick from.
  • filter_norm - normalization factor on the filter; 1.0 = 100% normalized.
  • scale and blend - strength of the effect, and how much of the filtered result gets mixed back in (1.0 = 100% filtered). blend_mode (lerp, inject, subtract_b) only really matters at in-between blend values.
  • final (default true) - when on, if this config matches, the others are ignored. Flip it off and multiple configs stack, which is how you build compound effects.

Two optional sockets round it out: sonar_power_filter_opt attaches a power filter to set the actual filtering parameters, and frux_config_opt lets you daisy-chain configs so a single socket can carry a whole list.

Getting started

A sensible first build: one config node, stage 1 on, hidden_mean on, target = both, leave scale/blend at 1, plug it into FreeUExtreme's input_config. That approximates stock FreeU V2. Then start cutting: restrict start/end to the middle of sampling to keep early composition untouched, or add a second config with final off and a tiny scale for a late-detail nudge. A/B every change against an unpatched generation on the same seed - the whole point of this kit is that you can isolate what each knob does, so take advantage of it.

Installing and gotchas

cd ComfyUI/custom_nodes
git clone https://github.com/blepping/ComfyUI-sonar

or "ComfyUI-sonar" via ComfyUI Manager, restart. No models to download. The pack's standing caveats apply: config inputs have churned across versions, so pin your git revision for reproducible output, and remember FreeU amplifies artifacts along with detail - a stacked, aggressive config chain will happily turn your subject into a low-relief sculpture. Start small.

Categorymodel_patches

Inputs (16)

NameTypeDefaultDescription
stage_1BOOLEANtrueControls whether this configuration applies to stage 1.
stage_2BOOLEANfalseControls whether this configuration applies to stage 2.
stage_3BOOLEANfalseControls whether this configuration applies to stage 3.
targetCOMBObackboneControls whether this filter applies to backbone or skip layers (or both).
startFLOAT0.0000–1Start time as percentage of sampling this configuration applies to. Inclusive.
endFLOAT1.0000–1End time as percentage of sampling this configuration applies to. Inclusive.
sliceFLOAT1.0000–1Percentage of the layer the FreeU effect is applied to.
slice_offsetFLOAT0.0000–1Offset as a percentage the layer is applied to. For example if slice is 0.25 and slice_offset is 0.25 then the filter will apply to the range 25% through 50%.
filter_normFLOAT0.000-10–10Normalization factor applied to the filter. 1.0 means 100% normalized.
scaleFLOAT1.000-10000–10000Strength of the effects applied by this configuration.
blendFLOAT1.000-10000–10000Blends the filtered result based on the specified strength where 1.0 means 100% filtered.
blend_modeCOMBOlerpMode used when blending. Generally only has an effect when blend is set to values other than 0 or 1
hidden_meanBOOLEANtrueYou can think of this as FreeU V2 mode.
finalBOOLEANtrueWhen enabled, other configurations won't be considered if this one matched. Otherwise, multiple configurations/filter effects can be stacked.
sonar_power_filter_optoptSONAR_POWER_FILTEROptionally attach a Power Filter here to set filtering parameters.
frux_config_optoptFRUX_CONFIGOptionally attach another configuration node here.

Outputs (1)

NameTypeDescription
FRUX_CONFIGFRUX_CONFIG