WASasquatch / WASABI

Weighted Adaptive Slerp And Blend Interpolator.

Repository from Github https://github.comWASasquatch/WASABIRepository from Github https://github.comWASasquatch/WASABI

WASABI

Weighted Adaptive Slerp And Blend Interpolator.

Because your prompts deserve flavor.

WASABI is a custom node for ComfyUI that takes your prompt, scales it, and interpolates it with the original reference embedding, this seems to show substantial promise in terms of quality of prompt adherence with Wan 2.1/2.2.

I have yet to verify effectiveness in other models.

Installation

  1. Open ComfyUI Manager and navigate to the "Custom Nodes" tab.
  2. Click the "Install Custom Nodes" button and search for "WASABI".
  3. Click the "Install" button next to the "WASABI" node.
  4. Restart ComfyUI.

Intent & Explanation

  • Goal: Experiment with conditioning-space operations (token-level scaling and interpolation) to improve prompt adherence and controllability, with a focus on Wan 2.1/2.2 text encoders.
  • What it does: Given an input conditioning (from CLIP/T5), WASABI can:
    • Scale token embeddings globally or per-token via schedules.
    • Interpolate from the current embedding toward a reference embedding using several kernels (e.g., slerp, lerp), optionally blending back toward the original.
    • Apply the same logic to pooled outputs where present (for global prompt intent).

The node exposes schedule-driven controls for three quantities:

  • ref_schedule: how far each token moves toward the reference (t_ref).
  • scale_schedule: token-wise scale multiplier.
  • blend_schedule: how much to blend the result back toward the original after moving toward the reference.

Advanced options tune the interpolation kernel (e.g., hybrid thresholds, angle clamps, Bézier tension, easing).

Modes

  • scale: Multiply embeddings by a scalar or per-token vector. Use to amplify or attenuate token strength.
  • slerp: Spherical linear interpolation toward the reference. Preserves angular relationships; good for semantic-preserving motion.
  • lerp: Linear interpolation toward the reference. Simpler, sometimes punchier but less norm-stable.
  • bislerp: SLERP toward reference, then blend back toward original using the same kernel family.
  • bilerp: LERP toward reference, then blend back.
  • binlerp: Normalized LERP (nlerp) toward reference; keeps vectors unit-length during interpolation.
  • bihybrid: Hybrid SLERP/LERP picked by angle threshold and smoothed across the transition.
  • biangle clamp: SLERP with a maximum rotation angle; limits large semantic swings.
  • bisbezier: Spherical Bézier curve between A→B; allows curved paths with tension control.
  • biease_slerp: SLERP with an easing function applied to t (smoothstep, cosine, gamma, identity).
  • biease_lerp: LERP with an easing function applied to t.

All “bi*” modes optionally apply a final blend back toward the original embedding, controlled by blend_back and blend_schedule.

Schedules & Advanced Options

  • Schedules (string):
    • "" empty → disabled.
    • linspace(a,b), cosine(a,b), flat(v), or explicit lists like "0 0.25 0.5 0.75 1" (resampled to token length).
  • Advanced options (DICT):
    • hybrid_angle_threshold_deg: Degrees where bihybrid switches LERP↔SLERP.
    • hybrid_smoothness: Smoothness of the transition.
    • angle clamp_theta_max_deg: Max rotation for biangle clamp.
    • sbezier_tension: Curve tension for bisbezier.
    • ease_kind: smoothstep|cosine|gamma|identity for biease_*.
    • ease_gamma: Exponent used when ease_kind=gamma.

Quick Usage

  • Use WASABI CLIP Text Encode to encode text ready for sampler conditioning
  • Or conditioning from CLIPTextEncode or other encoding nodes, then pass through WASABI Conditioning Modulate with your chosen mode, scale, and optional schedules/advanced options.

There is the optional Schedule Options node that can be used to generate schedules for ref_schedule, scale_schedule, and blend_schedule. As well as the Advanced Options node that can be used to generate advanced options for hybrid_angle_threshold_deg, hybrid_smoothness, angle clamp_theta_max_deg, sbezier_tension, ease_kind, and ease_gamma for the advanced bi* modes.

Notes

  • Designed and tested primarily with Wan 2.1/2.2; results may vary on other models.
  • ComfyUI expects images as BHWC; any plots generated by the Schedule Options node follow BHWC.

About

Weighted Adaptive Slerp And Blend Interpolator.

License:MIT License


Languages

Language:Python 100.0%