JLC Flux2 Conditioning Cache Prep
One node that prewarms every cache in this pack
- 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
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.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| vae | VAE | — | |
| reference_count | INT | 00–10 | Number of reference-image cache inputs exposed by the layout button. |
| control_count | INT | 00–4 | Number of ControlNet hint cache inputs exposed by the layout button. |
| use_inpaint | BOOLEAN | false | Expose 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_prepare | BOOLEAN | false | Clear only the active cache domains before preparing them. |
| diagnostics | BOOLEAN | true | — |
| input_connection_contract | STRING | {} | Hidden frontend-generated record of which dynamic input sockets are physically wired. Do not edit manually. |
| empty_flux2_latentopt | LATENT | Connect 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_1opt | IMAGE | — | |
| reference_image_2opt | IMAGE | — | |
| reference_image_3opt | IMAGE | — | |
| reference_image_4opt | IMAGE | — | |
| reference_image_5opt | IMAGE | — | |
| reference_image_6opt | IMAGE | — | |
| reference_image_7opt | IMAGE | — | |
| reference_image_8opt | IMAGE | — | |
| reference_image_9opt | IMAGE | — | |
| reference_image_10opt | IMAGE | — | |
| control_image_1opt | IMAGE | — | |
| control_image_2opt | IMAGE | — | |
| control_image_3opt | IMAGE | — | |
| control_image_4opt | IMAGE | — | |
| inpaint_imageopt | IMAGE | — | |
| inpaint_maskopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| cache_ready_image | IMAGE | — |
| cache_set | BOOLEAN | — |
| cache_report | STRING | — |