Nodes/JLC Flux2 ControlNet/ JLC Flux2 Conditioning Cache Prep
ComfyUI Node

 JLC Flux2 Conditioning Cache Prep

One node that prewarms every cache in this pack

By Damkohler·Created 2 months ago·Updated 26 days ago· 20
 JLC Flux2 Conditioning Cache Prep
  • vae
  • empty_flux2_latent
  • reference_image_1
  • reference_image_2
  • reference_image_3
  • reference_image_4
  • reference_image_5
  • reference_image_6
  • reference_image_7
  • reference_image_8
  • reference_image_9
  • reference_image_10
  • control_image_1
  • control_image_2
  • control_image_3
  • control_image_4
  • inpaint_image
  • inpaint_mask
  • cache_ready_image
  • cache_set
  • cache_report
reference_count0
control_count0
use_inpaintfalse
clear_before_preparefalse
diagnosticstrue
input_connection_contract{}

This pack has three separate cache engines - ControlNet hint latents, reference-image latents, and the experimental inpaint context - each with its own specialist prep node. JLC Flux2 Conditioning Cache Prep is the newer, unified front end: one node that prewarms any or all of them in a single pass, and the README points new workflows straight at it. It's an additive convenience layer, not a replacement - the three specialist nodes stay for existing graphs, and this one just fronts the same caches with a layout that scales.

How it works

You pick what you want to prepare, then press Apply Input Layout and the node exposes only the sockets you chose. The counts are the whole interface:

  • reference_count (0–10) - reference-image slots.
  • control_count (0–4) - ControlNet hint slots.
  • use_inpaint - expose one image+mask pair for the inpaint context cache.
  • clear_before_prepare - wipe only the active cache domains first.
  • diagnostics - reporting.
  • input_connection_contract - a hidden frontend record of which sockets are physically wired. Don't touch it.

There's one wire that matters more than the others: empty_flux2_latent. When a ControlNet hint or inpaint pair is active, connect the same Empty Flux2 Latent your sampler uses - the node derives hint and inpaint geometry from that clean latent. Connect a sampler output and you've broken the contract.

The outputs tell you what happened: cache_ready_image (a small proof image, available only once every active entry is a confirmed cache hit or successful insert), cache_set (boolean), and cache_report (string).

Why the proof image exists

cache_ready_image is designed to connect to the setup side of JLC Conditional Save Image, while your real generated image connects to the inference side. That's the branch-gated workflow: warm caches on the setup pass, then run the sampler against the warm caches. If every selected branch is inactive (muted, bypassed, pruned, or resolved to None), the node completes successfully without touching the caches and returns a small "No Images to Cache" image so the IMAGE routing stays valid - selected-but-never-wired sockets, by contrast, are a configuration error.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/Damkohler/JLC-Flux2-ControlNet.git

Restart ComfyUI or install "JLC Flux2 ControlNet" via Manager. Needs current ComfyUI with native FLUX.2 support, Python 3.10+, and the FLUX.2 model stack; the ControlNet checkpoint only matters if you're conditioning with hints.

Gotchas

This is an experimental utility, so treat it as the warm-up pass it is. Caches are process-local - restart and everything's cold. Muted or bypassed branches are skipped gracefully, but a selected socket that was never wired is an error, so keep your layout and your graph in agreement. And respect the latent contract: clean Empty Flux2 Latent, never a sampled latent. The payoff is real for iteration-heavy FLUX.2 work - warm caches plus multi-branch ControlNet and references are the configuration the author validated for speed.

CategoryFlux2 Latents Cache/utils

Inputs (24)

NameTypeDefaultDescription
vaeVAE
reference_countINT00–10Number of reference-image cache inputs exposed by the layout button.
control_countINT00–4Number of ControlNet hint cache inputs exposed by the layout button.
use_inpaintBOOLEANfalseExpose one inpaint IMAGE/MASK pair. If both connected inputs resolve to None at execution time, inpaint is treated as intentionally inactive and skipped.
clear_before_prepareBOOLEANfalseClear only the active cache domains before preparing them.
diagnosticsBOOLEANtrue
input_connection_contractSTRING{}Hidden frontend-generated record of which dynamic input sockets are physically wired. Do not edit manually.
empty_flux2_latentoptLATENTConnect the same Empty Flux2 Latent used by the sampler. Do not connect the sampler output or any sampled latent. This is required only when an active ControlNet hint or active inpaint pair is present.
reference_image_1optIMAGE
reference_image_2optIMAGE
reference_image_3optIMAGE
reference_image_4optIMAGE
reference_image_5optIMAGE
reference_image_6optIMAGE
reference_image_7optIMAGE
reference_image_8optIMAGE
reference_image_9optIMAGE
reference_image_10optIMAGE
control_image_1optIMAGE
control_image_2optIMAGE
control_image_3optIMAGE
control_image_4optIMAGE
inpaint_imageoptIMAGE
inpaint_maskoptMASK

Outputs (3)

NameTypeDescription
cache_ready_imageIMAGE
cache_setBOOLEAN
cache_reportSTRING