Nodes/comfyui_overly_complicated_sampling/OCSNoise ExpressionFilteredNoise
ComfyUI Node

OCSNoise ExpressionFilteredNoise

Run a filter on your noise before the sampler sees it

By blepping·Created 2 years ago·Updated 2 months ago· 30
OCSNoise ExpressionFilteredNoise
  • custom_noise
  • ocs_noise_opt
  • OCS_NOISE
factor1.000
rescale0.000
normalize
yaml_config

OCS has a whole filter system - YAML definitions that can transform tensors during sampling using expressions, blends, and math. Most of the time those filters run inside the sampler, group, or substeps nodes. This node pulls that machinery out and points it at one specific thing: the noise itself. OCSNoise ExpressionFilteredNoise wraps an existing noise generator, runs a filter on every chunk of noise it produces, and hands the filtered result to the sampler. If you've ever wanted to shape or suppress part of the noise a sampler generates, this is the dedicated tool.

What it is

A custom noise node (OCS_NOISE output) that takes another custom noise generator as input, plus a yaml_config filter definition. Each time the sampler requests noise, the wrapped generator produces it and the filter transforms it before it's scaled and returned. It's the noise-shaped cousin of the OCS-ApplyFilter* nodes - same filter language, applied live during sampling instead of to a static tensor.

The inputs that matter

  • custom_noise (required) - the underlying noise generator to wrap. Connect an OCSNoise PerlinSimple, OCSNoise PerlinAdvanced, or any OCS/sonar noise node here.
  • yaml_config (required) - the filter definition, in the same YAML format used everywhere in OCS. The tooltip's warning applies with extra force: "there is essentially no error handling," so test filters in small steps. A basic filter looks like:
filter:
    filter_type: simple
    input: default
    output: default

plus the expression functions (clamp, lerp, math ops, sigma/sigma_next are available as variables) that do the actual shaping.

  • factor (default 1) and rescale - shared noise scaling controls from the base class.
  • normalize - whether output is normalized to 1.0 strength.
  • ocs_noise_opt - chain additional noise items.

The single OCS_NOISE output feeds a sampler's custom_noise input or an OCS Param (key: custom_noise).

Why you'd reach for it

Two patterns show up in practice. One: you want noise that's dampened or boosted at certain sigma ranges, which you can express as a filter keyed on sigma - for example suppressing high-frequency noise early in the denoise. Two: you want to experiment with the filter language before committing to a sampler-level filter, since a standalone node is easier to iterate on than a filter buried in the sampler's YAML. If you just want plain Perlin noise, skip this and use the Perlin nodes directly - this one exists for when plain isn't what you want.

Installing and gotchas

Installed with the pack - Manager search "Overly Complicated Sampling" or git clone https://github.com/blepping/comfyui_overly_complicated_sampling into ComfyUI/custom_nodes, restart. No models or mandatory deps.

The trap is the filter language itself: it's OCS's own expression syntax, not Python, so //, **, and the :> keyword-arg operator are the tools you have. A malformed filter is a runtime error, and because it fires on every noise request you'll get the same error repeatedly until you fix it. Read the pack's docs/filter.md and docs/expression.md before writing anything non-trivial - they're short and they'll save you a lot of guessing.

CategoryOveryComplicatedSampling/noise

Inputs (6)

NameTypeDefaultDescription
factorFLOAT1.000-100–100Scaling factor for the generated noise of this type.
rescaleFLOAT0.0000–100When non-zero, this custom noise item and other custom noise items items connected to it will have their factor scaled to add up to the specified rescale value.
normalizeCOMBOControls whether the generated noise is normalized to 1.0 strength.
custom_noiseOCS_NOISE,SONAR_CUSTOM_NOISEInput for custom noise used during ancestral or SDE sampling.
yaml_configSTRINGEnter your filter definition here. There is essentially no error handling.
ocs_noise_optoptOCS_NOISE,SONAR_CUSTOM_NOISEOptional input for more custom noise items. The following input types are supported: OCS_NOISE, SONAR_CUSTOM_NOISE

Outputs (1)

NameTypeDescription
OCS_NOISEOCS_NOISEA custom noise chain.