Extensions/Ideogram 4 VAE Coordinate Bridge
ComfyUI Extension

Ideogram 4 VAE Coordinate Bridge

A standalone ComfyUI node that bridges Ideogram 4 model latents to the connected Flux.2 VAE normalization.

By wcde·Created 25 days ago·Updated 25 days ago· 0
wcde/ComfyUI-Ideogram4-VAE-Coordinate-Bridge
Nodes
On cloudLocal install
Stars0
Updated25 days ago
Readme

ComfyUI Ideogram 4 VAE Coordinate Bridge

A standalone ComfyUI node that maps Ideogram 4 / Flux.2 packed latents between the model's official normalization and the BatchNorm statistics stored in the connected VAE.

Why this exists

Ideogram 4 operates on 128 packed latent channels. The diffusion model and a loaded VAE checkpoint can describe those channels with different per-channel means and scales. Passing the model output directly to such a VAE can therefore change tone, color, contrast, detail, and phase-dependent artifacts.

Ideogram 4 VAE Coordinate Bridge installs an exact affine conversion on the MODEL's latent format:

  • text-to-image: converts the completed sample before VAE Decode;
  • img2img and reference latents: converts the encoded latent before sampling and converts the result back before decode.

The node does not apply the conversion repeatedly during denoising.

Installation

Clone or extract this repository into:

ComfyUI/custom_nodes/ComfyUI-Ideogram4-VAE-Coordinate-Bridge

Restart ComfyUI after installation.

Usage

  1. Add Ideogram 4 VAE Coordinate Bridge.
  2. Connect the Ideogram 4 / Flux.2 MODEL.
  3. Connect the same packed VAE used by VAE Decode and, for img2img, VAE Encode.
  4. Connect the node's model output to your guider or the next MODEL patch.

The node has no strength control. Its conversion is determined entirely by the official Ideogram 4 latent constants and the connected VAE's stored BatchNorm statistics.

Compatibility

The node requires:

  • an Ideogram 4 / Flux.2 MODEL with 128 packed latent channels and spatial downscale ratio 16;
  • a packed Flux.2-style VAE exposing 128 bn.running_mean and bn.running_var values.

It intentionally rejects incompatible models and VAEs rather than silently applying an incorrect transform.

How it works

For every packed latent channel, model-space values are converted to VAE-space values with:

z_vae = (z_model * official_scale + official_mean - vae_mean) / vae_scale

The inverse conversion is used for non-empty input latents:

z_model = (z_vae * vae_scale + vae_mean - official_mean) / official_scale

The channel order is converted from the published Ideogram token order to ComfyUI's packed channel order before applying the transform.

Performance

The node stores four small 128-element vectors and performs one channel-wise affine conversion at each relevant sampling boundary. It does not run the VAE or add work to individual denoising steps.