Nodes/RES4LYF/LatentPhaseMagnitudePower
ComfyUI Node Runs on cloud

LatentPhaseMagnitudePower

A nonlinear curve over a latent's structure and texture

By ClownsharkBatwing·Created 2 years ago·Updated 2 days ago· 1,350
LatentPhaseMagnitudePower
  • latent_0_batch
  • phase_luminositys
  • phase_cyan_reds
  • phase_lime_purples
  • phase_pattern_structures
  • magnitude_luminositys
  • magnitude_cyan_reds
  • magnitude_lime_purples
  • magnitude_pattern_structures
  • LATENT
◄phase_luminosity1.000►
◄phase_cyan_red1.000►
◄phase_lime_purple1.000►
◄phase_pattern_structure1.000►
◄magnitude_luminosity1.000►
◄magnitude_cyan_red1.000►
◄magnitude_lime_purple1.000►
◄magnitude_pattern_structure1.000►
◄latent_0_normalfalse►
◄latent_out_normalfalse►

The last of RES4LYF's four phase/magnitude nodes, and the most aggressive one. LatentPhaseMagnitudeMultiply scales a latent's structure and texture linearly; LatentPhaseMagnitudeOffset shifts them by a fixed amount; LatentPhaseMagnitudePower raises them to a power instead - a nonlinear curve that compresses small values and stretches large ones (or the reverse, depending on the exponent), rather than a flat adjustment across the board.

Same idea as the rest of the family underneath: decompose a latent's channels into phase (structure) and magnitude (texture/energy), and give you a per-channel dial. This one is for when scaling or shifting isn't giving you the shape of change you want and you need something more like a gamma curve.

How it works

Each of the four channels - luminosity, cyan-red, lime-purple, pattern-structure - gets its phase and magnitude raised to the corresponding phase_*/magnitude_* exponent, all defaulting to 1 (which is a genuine no-op for a power operation: anything to the power of 1 is unchanged). latent_0_normal and latent_out_normal toggle normalization in and out, both off by default.

Because phase is fundamentally an angle rather than a plain magnitude, exponentiating it is a more unusual operation than exponentiating a texture-energy value - expect it to behave less predictably than the magnitude side, and treat both as something to feel out experimentally rather than reason about from first principles.

The inputs and outputs that matter

  • latent_0_batch - the latent you're adjusting.
  • phase_luminosity, phase_cyan_red, phase_lime_purple, phase_pattern_structure - exponents applied to each channel's structural component.
  • magnitude_luminosity, magnitude_cyan_red, magnitude_lime_purple, magnitude_pattern_structure - exponents applied to each channel's texture/energy component.
  • latent_0_normal / latent_out_normal (default false) - normalization toggles.
  • Optional SIGMAS variants of each exponent, for scheduling the curve across steps.
  • Output: LATENT - the reshaped latent.

How to install it

Via ComfyUI Manager, search "RES4LYF" and install. Manually, from ComfyUI/custom_nodes:

git clone https://github.com/ClownsharkBatwing/RES4LYF/
cd RES4LYF
pip install -r requirements.txt

Activate a venv first if you use one; on portable builds, swap pip for python_embedded\Scripts\pip.exe. Restart ComfyUI afterward.

Common issues & troubleshooting

Everything at 1 looks unchanged. That's expected here - unlike the Offset node in this family, a power of 1 genuinely is a no-op, so the default is a safe starting point.

Values under 1 or above 1 behave unpredictably. Because you're exponentiating raw frequency-domain values (including phase, which wraps as an angle), small changes to the exponent can produce disproportionate visual shifts, especially on the magnitude side where you're compressing or expanding an energy distribution. Move in small steps and compare against the unmodified latent rather than guessing a target value up front.

You wanted a flat scale or shift instead. A power curve treats small and large values differently by design; if you want every value nudged by the same proportion or the same amount regardless of size, use LatentPhaseMagnitudeMultiply or LatentPhaseMagnitudeOffset instead.

No write-ups exist for this node. As with its siblings, there's no community documentation beyond the schema itself. Isolate one channel at a time on a fixed seed if you're trying to understand what it's actually doing before combining several changes at once.

CategoryRES4LYF/latents

Inputs (19)

NameTypeDefaultDescription
latent_0_batchLATENT—
phase_luminosityFLOAT1.000-10000–10000—
phase_cyan_redFLOAT1.000-10000–10000—
phase_lime_purpleFLOAT1.000-10000–10000—
phase_pattern_structureFLOAT1.000-10000–10000—
magnitude_luminosityFLOAT1.000-10000–10000—
magnitude_cyan_redFLOAT1.000-10000–10000—
magnitude_lime_purpleFLOAT1.000-10000–10000—
magnitude_pattern_structureFLOAT1.000-10000–10000—
latent_0_normalBOOLEANfalse—
latent_out_normalBOOLEANfalse—
phase_luminositysoptSIGMAS—
phase_cyan_redsoptSIGMAS—
phase_lime_purplesoptSIGMAS—
phase_pattern_structuresoptSIGMAS—
magnitude_luminositysoptSIGMAS—
magnitude_cyan_redsoptSIGMAS—
magnitude_lime_purplesoptSIGMAS—
magnitude_pattern_structuresoptSIGMAS—

Outputs (1)

NameTypeDescription
LATENTLATENT—