Nodes/JLC Flux2 ControlNet/ JLC Flux2 Reference Image Orchestrator
ComfyUI Node

 JLC Flux2 Reference Image Orchestrator

Ten reference images into FLUX.2, through native conditioning

By Damkohler·Created 2 months ago·Updated 26 days ago· 20
 JLC Flux2 Reference Image Orchestrator
  • positive
  • negative
  • vae
  • 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
  • positive
  • negative
  • vae
  • 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
  • diagnostics_json
apply_topositive_and_negative
reference_latents_methoddo_not_set
slot_count2
enabled_1true
enabled_2true
enabled_3true
enabled_4true
enabled_5true
enabled_6true
enabled_7true
enabled_8true
enabled_9true
enabled_10true
cache_enabledtrue
cache_max_entries32
cache_max_cpu_mb256
clear_cache_before_runfalse
diagnosticstrue

Multi-reference conditioning is the whole reason FLUX.2 is worth its size: show the model who or what you mean, and it edits instead of hallucinating. JLC Flux2 Reference Image Orchestrator is the pack's way of feeding that - up to ten reference images, VAE-encoded and attached through ComfyUI's native reference_latents conditioning mechanism, then routed to positive, negative, or both conditioning streams. It's the stable reference path in this ecosystem, and it's deliberately conservative: no weighting, no fusion, no pooling - just stock FLUX.2 behavior with more slots and a cache bolted on.

How it works

Enabled images are VAE-encoded (or pulled from the pack's bounded CPU reference-latent cache) and appended in slot order through the native reference-latents channel. The two dropdowns are where the design decisions live:

  • apply_to - positive_and_negative (default), positive_only, or negative_only. Attaches the same reference sequence to the streams you pick.
  • reference_latents_method - the optional equivalent of ComfyUI's native Edit Model Reference Method node: do_not_set (default), offset, index, uxo/uno, index_timestep_zero. These change how reference tokens are positioned relative to the main latent, and for anything unusual you'll want to read up on the native method semantics first.

Then the slot machinery: slot_count (1–10) sets how many slots are visible, and each enabled_N toggle drops that slot before validation, cache lookup, encoding, or conditioning - the "off" path costs you nothing. cache_enabled (on by default) reuses the CPU reference-latent cache so unchanged references aren't re-encoded, with cache_max_entries, cache_max_cpu_mb, and clear_cache_before_run to keep it bounded. diagnostics is the usual reporting toggle.

Outputs are positive and negative conditioning, a pass-through vae, reference_image_1..10 pass-throughs, and a diagnostics_json string. This node sits before the ControlNet Apply or Orchestrator in the workflow.

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. Requires current ComfyUI with native FLUX.2 support, Python 3.10+, and a FLUX.2-dev model stack (text encoder + VAE). No pip dependencies.

Where people get burned

Two things, mostly. First, your resizing and cropping are done before this node - it encodes exactly the image tensor it receives, so references you didn't prepare will come out oddly composed. Second, the cache: it's method-agnostic (safe under any reference method) but it's also process-local and keyed to the image, so after a ComfyUI restart everything re-encodes, and if you swap a reference you should hit clear_cache_before_run or you'll keep getting the old latent. On FLUX.2-dev, more references mean more memory and slower runs - ten slots is the ceiling, not the target. Most people live at two or three.

CategoryFlux2 Conditioning

Inputs (31)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
apply_toCOMBOpositive_and_negativeAttach the same native reference-latent sequence to positive conditioning, negative conditioning, or both.
reference_latents_methodCOMBOdo_not_setOptional equivalent of ComfyUI's native Edit Model Reference Method node.
slot_countINT21–10Number of visible reference-image slots. The backend ignores every slot above this count.
enabled_1BOOLEANtrueWhen disabled, this slot is omitted before image validation, cache lookup, VAE encoding, or conditioning.
enabled_2BOOLEANtrueWhen disabled, this slot is omitted before image validation, cache lookup, VAE encoding, or conditioning.
enabled_3BOOLEANtrueWhen disabled, this slot is omitted before image validation, cache lookup, VAE encoding, or conditioning.
enabled_4BOOLEANtrueWhen disabled, this slot is omitted before image validation, cache lookup, VAE encoding, or conditioning.
enabled_5BOOLEANtrueWhen disabled, this slot is omitted before image validation, cache lookup, VAE encoding, or conditioning.
enabled_6BOOLEANtrueWhen disabled, this slot is omitted before image validation, cache lookup, VAE encoding, or conditioning.
enabled_7BOOLEANtrueWhen disabled, this slot is omitted before image validation, cache lookup, VAE encoding, or conditioning.
enabled_8BOOLEANtrueWhen disabled, this slot is omitted before image validation, cache lookup, VAE encoding, or conditioning.
enabled_9BOOLEANtrueWhen disabled, this slot is omitted before image validation, cache lookup, VAE encoding, or conditioning.
enabled_10BOOLEANtrueWhen disabled, this slot is omitted before image validation, cache lookup, VAE encoding, or conditioning.
cache_enabledBOOLEANtrueUse the bounded CPU reference-latent cache to avoid repeated VAE encoding of unchanged prepared images.
cache_max_entriesINT320–256
cache_max_cpu_mbINT2560–4096
clear_cache_before_runBOOLEANfalseClear the shared reference-latent cache first.
diagnosticsBOOLEANtrue
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

Outputs (14)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
reference_image_1IMAGE
reference_image_2IMAGE
reference_image_3IMAGE
reference_image_4IMAGE
reference_image_5IMAGE
reference_image_6IMAGE
reference_image_7IMAGE
reference_image_8IMAGE
reference_image_9IMAGE
reference_image_10IMAGE
diagnostics_jsonSTRING