OCSNoise ImmiscibleReference
Noise that repels from a reference
- custom_noise
- reference
- custom_noise_ref
- custom_noise_blend
- OCS_NOISE
Normal noise is lazy: its random values don't care about your image at all. Immiscible noise is the opposite - it's generated so that it's as different as possible from a reference, like oil and water refusing to mix. That's the idea behind the paper this node implements (arxiv 2406.12303), and OCSNoise ImmiscibleReference is the standalone version of it: generate noise, then reshuffle it so each piece sits far from (or close to) a reference latent. The README is careful to note the technique was designed for training, not inference - so think of this as an experimental flavor that sometimes gives sampling a useful kick, not a guaranteed upgrade.
What it is
A custom noise node (OCS_NOISE output) that takes a reference - either a LATENT or another noise generator - and produces immiscible noise from it. When a sampler requests noise for ancestral or SDE sampling, the node generates a batch of candidate noise and then optimizes the assignment so the noise is maximally (or minimally) distant from the reference. It's the "repelling" ingredient in the OCS noise kitchen.
The inputs that matter
reference(optional) - aLATENTto repel from. Attach this orcustom_noise_ref, not both.custom_noise_ref(optional) - an alternative reference source: use noise from another generator as the thing to repel from.custom_noise(required) - the base noise being immiscibilized.size(default 64) - number of batch repeats to generate for the matching. Setting it to 0 disables immiscible processing entirely, which makes this node a pass-through - handy for A/B comparisons.batching(defaultchannel) - what dimension gets matched:channel,batch,row,column, and thecycle_*variants. Column mode reshapes the input and can eat a lot of VRAM; row is slow but less brutal. Stick withchannelto start.maximize(default false) - false pushes noise away from the reference (the classic immiscible direction); true pulls it closer.distance_scale(default 0.1) - the v1/v2 switch: 0 gives you the original (v1) immiscible behavior, non-zero enables the v2 mode that also scales the input noise. 0.1 is the README's suggested starting point.blend(default 1.0) - how much of the output is immiscible noise vs. normal noise.custom_noise_blendlets you pick a different noise type for the normal side.
Output is OCS_NOISE, ready for a sampler's custom_noise input.
Why you'd bother
Immiscible noise in sampling is a "shuffle the noise to be maximally spread out relative to the current image" trick. Its biggest practical draw is in Restart sampling - the pack supports immiscible noise for restarts too, and some users report it changing how re-noised steps behave. It's genuinely experimental, so treat it as a sampler-flavor experiment: set it up, A/B against plain noise, and keep it only if it helps.
Installing and gotchas
Part of 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 blend_mode note: only slerp works well, and that requires installing ComfyUI-bleh. Set blend: 0 or size: 0 to quickly disable and compare.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| factor | FLOAT | 1.000-100–100 | Scaling factor for the generated noise of this type. |
| size | INT | 64 | Number of batch repeats to use when generating Immiscible noise. Setting this to 0 disables immiscible noise. If the batching type is batch, then Immiscible noise is also disabled unless the size is 2 or higher. Note that this size is in batch repeats regardless of the batching mode. For example, if you are generating a batch of 2 and you set this to 2, then you will generate noise with batch size 4. |
| batching | COMBO | channel | Dimension to maximize (or minimize) the noise with. Column mode requires reshaping the input and may require a lot of VRAM. Row mode is also fairly slow, but not as bad as column mode. Row and column modes have a very strong effect. |
| normalize_ref_scale | FLOAT | 0.00-10000–10000 | Controls whether the reference gets normalized. If set to 0, no normalization is done. |
| normalize_noise_scale | FLOAT | 0.00-10000–10000 | Controls whether the noise used as an input for immiscible noise is gets normalized first. If set to 0, no normalization is done. |
| maximize | BOOLEAN | false | When enabled, maximizes the distance between the noise and the reference rather than trying to minimize it. |
| distance_scale | FLOAT | 0.10-10000–10000 | Multiplier on the input noise for v2 Immiscible noise. Set to 0 to use v1 Immiscible noise. |
| distance_scale_ref | FLOAT | 0.10-10000–10000 | Multiplier on the refence for v2 Immiscible noise. No effect if distance_scale is 0. |
| blend | FLOAT | 1.00-10000–10000 | Percentage of immiscible noise to use. 1.0 means 100%. May not work very well with most blend modes. |
| blend_mode | COMBO | lerp | Blending function used when mixing immiscible noise with normal noise. Only slerp seems to work well (requires ComfyUI-bleh). |
| normalize | COMBO | Controls whether the generated noise is normalized to 1.0 strength. | |
| custom_noise | OCS_NOISE,SONAR_CUSTOM_NOISE | Input for custom noise used during ancestral or SDE sampling. | |
| referenceopt | LATENT | Attach either this or the custom_noise_ref input but not both. | |
| custom_noise_refopt | OCS_NOISE,SONAR_CUSTOM_NOISE | Optional input that can be attached instead of the reference latent. When used, noise from this generator will be used as the reference. | |
| custom_noise_blendopt | OCS_NOISE,SONAR_CUSTOM_NOISE | Optional input for blended noise (only used when blend is not 1.0). Can be used if you want to blend with a different noise type. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| OCS_NOISE | OCS_NOISE | A custom noise chain. |