Nodes/ComfyUI-42lux-Hildegard-Refiner/Hildegard References Split
ComfyUI Node

Hildegard References Split

Three reference latents per tile — the actual trick behind Hildegard

By 42lux·Created 3 months ago·Updated 3 months ago· 57
Hildegard References Split
  • image
  • dac_data
  • vae
  • TILE(S)
  • POSITION(S)
  • tile_latent
  • position_latent
  • global_latent
tile0
cell_size512
ctrl3_max_size2048
tile_high_freq_reduce0.00
low_freq_radius256

This is the node that makes Hildegard Hildegard. References Split slices the upscaled image into tiles and, for each one, builds three reference latents - the tile itself, a 3×3 position map of its neighbors, and a thumbnail of the whole image. FLUX.2 Klein is natively a reference-editing model, and this pack repurposes that: instead of ControlNet Tile (which has gone quiet for the new-generation models - check the KB's controlnet essay if you've noticed the stall), it feeds Klein spatial context it already understands. The matching LoRA (42lux/hildegard) teaches the model to actually read those three slots.

Why this beats each-tile-in-isolation: the classic tiled upscale failure is tiles drifting into patchwork because each one is generated blind. Here every tile carries its own crop (fidelity), a position map showing where it sits among its eight neighbors (context), and a global thumbnail (color and composition anchor). Tiles stop hallucinating structure that isn't there, and seams stay invisible.

How it works

For each tile it builds, in one pass:

  • tile_latent - VAE-encoded crop of the tile. Optionally frequency-reduced (below).
  • position_latent - VAE-encoded 3×3 map: the current tile in the center cell, its 8 neighbors around it, with cyan corner brackets ringing the center so the model knows where the cell boundaries are. Off-canvas cells stay neutral gray.
  • global_latent - VAE-encoded thumbnail of the whole upscaled image, long edge capped at ctrl3_max_size.

All four outputs are index-aligned: element i is the same physical tile across TILE(S), tile_latent, and position_latent. The author describes it as "a pure reference-based upscale that samples from an empty latent" - you run your sampler once per tile, feeding the latents through the ReferenceLatent nodes plus per-ref weight controls (Flux2KleinRefLatentWeight), then stitch with Combine.

The frequency knob - the part people argue about

tile_high_freq_reduce (0.0–1.0, default 0) subtracts part of the tile's high-frequency band before encoding, with low_freq_radius (default 256) as the Gaussian blur that defines the low/high cutoff. At 0.0 the reference keeps full source detail - tight fidelity, little room for the model to add. At 1.0 it's a soft, low-contrast shell - only broad shapes and color survive, and Klein invents fresh micro-detail. Only tile_latent is affected; structure and global context stay locked. Reach for it when the source is noisy or over-sharpened and you want the model to re-synthesize clean detail. This was the feature one reviewer called the key innovation of the whole pack.

Inputs and outputs that matter

image (the upscaled output of Hildegard Plan), dac_data (its grid geometry), and vae (for FLUX.2 Klein, the Klein VAE - the fl2vae in the example workflow). tile (default 0) processes all tiles; set it to a number to process just that one. cell_size (default 512) is the side of each position-map cell - 512 is the LoRA's training default, leave it. ctrl3_max_size (default 2048) caps the global thumbnail; the shipped workflow still uses 768, and the author says for modest 1k–4k upscales you can disconnect the thumbnail entirely.

Outputs: TILE(S) and POSITION(S) image lists, plus tile_latent, position_latent, and the single global_latent.

Install

Same pack as Plan - ComfyUI Manager (search "ComfyUI-42lux-Hildegard-Refiner") or:

cd ComfyUI/custom_nodes
git clone https://github.com/42lux/ComfyUI-42lux-Hildegard-Refiner

Restart. No pip deps. Then the actual requirement: download the Hildegard LoRA from huggingface.co/42lux/hildegard and load it (e.g. LoraLoaderModelOnly) before sampling. Skip it and nothing will happen - the model won't know what those three reference slots mean. Prompt with the RFNTILE. trigger phrase from the README or one of the LLM prompt templates in the pack's llm_prompt_templates/.

Gotchas

Keep the index order intact - if you process a subset, feed Combine the same tiles in the same order. If someone hits a tensor size mismatch on the reference latents, it's almost always a hand-tuned graph feeding a reference at the wrong size; wire this node's outputs straight into the ref slots. And expect this node to be the slow, VRAM-hungry step of the pipeline - it's doing real VAE encodes, per tile. A 12GB card will top out around a 2048-tile pass regardless of what you do downstream.

Categoryupscale/hildegard-refiner

Inputs (8)

NameTypeDefaultDescription
imageIMAGEUpscaled IMAGE from Hildegard Plan.
dac_dataHILDEGARD_DATAdac_data from Hildegard Plan. Carries the tile grid, overlaps, and ordering this node has to honor.
vaeVAEVAE used to encode the three reference image types into latents. For FLUX.2 Klein, the Klein VAE.
tileINT00 = process all tiles in the grid (each output is a list of N entries). N >= 1 = process only that single tile (each output is a list of 1). Index follows the same linear/spiral ordering Hildegard Plan picked.
cell_sizeINT51264–2048Side length (px) of each cell in the 3x3 position map. The final position image is cell_size x 3 on each axis. Larger = more spatial context detail, larger position latent. 512 is the Hildegard training default.
ctrl3_max_sizeINT2048256–8192Long-edge cap (px) for the global thumbnail before VAE encoding. The whole upscaled image is downscaled so its longer edge fits this. 2048 is the Hildegard training default.
tile_high_freq_reduceFLOAT0.000–1Attenuate the tile reference's high-frequency band (micro-detail / edges / texture) before VAE-encoding. 0 = full source detail preserved in the reference (tight fidelity, model has little room to add). 1 = soft, low-contrast version with only broad shapes and color preserved. Only affects the tile_latent output. The TILE(S) image output, position_latent, and global_latent are untouched.
low_freq_radiusFLOAT2561–256Gaussian-blur radius (px) defining the cutoff between low and high frequencies for tile_high_freq_reduce. Larger = more of the source's detail is classified as 'low frequency' and survives the reduce. Smaller = only the very-broadest shapes survive; the model regenerates everything else.

Outputs (5)

NameTypeDescription
TILE(S)IMAGE
POSITION(S)IMAGE
tile_latentLATENT
position_latentLATENT
global_latentLATENT