Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > comfyui-flux2-photomatch > FLUX.2 Klein Ref Latent Controller

ComfyUI Node: FLUX.2 Klein Ref Latent Controller

Class Name

Flux2KleinRefLatentController

Category
conditioning/flux2klein
Author
frkanozsoy (Account age: 0days)
Extension
comfyui-flux2-photomatch
Latest Updated
2026-11-03
Github Stars
0.0K

How to Install comfyui-flux2-photomatch

Install this extension via the ComfyUI Manager by searching for comfyui-flux2-photomatch
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfyui-flux2-photomatch in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

FLUX.2 Klein Ref Latent Controller Description

Scales a selected Flux2 Klein reference latent's attention influence with optional spatial fading.

FLUX.2 Klein Ref Latent Controller:

Flux2KleinRefLatentController adjusts how strongly one reference latent influences a Flux2 Klein model during attention processing. It works by scaling the selected reference’s attention data in a cloned model, so you can change its contribution without modifying the original model. You can apply the same strength across the reference or use a directional fade to give some areas more influence than others. This provides a way to experiment with reference influence while leaving the accompanying conditioning unchanged; the visible effect depends on the model and the reference information available when the model runs.

FLUX.2 Klein Ref Latent Controller Input Parameters:

model

A required MODEL input. Supply the model whose reference influence you want to adjust. The node clones it and installs an attention patch on the clone, leaving the supplied model object unmodified. There is no numeric range or default for this input.

conditioning

A required CONDITIONING input. Supply the conditioning that accompanies the model. The node passes it through unchanged, but when spatial fading is enabled, it also looks in its metadata for reference_latents to determine the selected reference’s spatial layout. If that metadata or the selected latent is unavailable, the node can still apply uniform strength when reference tokens are available at runtime. There is no numeric range or default for this input.

strength

A required FLOAT input controlling the multiplier applied to the selected reference’s attention keys and values. The default is 1.0, the minimum is 0.0, the maximum is 1000.0, and the step is 0.05. At 1.0, the selected data retains its original scale before any spatial fade; 0.0 multiplies it by zero; values above 1.0 increase its scale. This is an attention-data multiplier, not a guaranteed percentage of visual influence, so test changes against your actual results.

reference_index

A required INT input choosing which reference to control, counted from zero. The default and minimum are 0, and the maximum is 7: 0 selects the first reference, 1 the second, and so on. The patch acts only when runtime reference-token information contains an entry at this index. When spatial fading is enabled, the node also searches the conditioning metadata for a latent at the same index; if it cannot find one, the selected reference receives uniform scaling instead.

spatial_fade

An optional selection controlling whether strength varies across the selected reference’s spatial positions. The options are none, center_out, edges_out, top_down, and left_right; the default is none. With none, all selected reference tokens receive the same multiplier. center_out gives central positions more weight than positions farther out; edges_out does the reverse. top_down reduces weight from top to bottom, while left_right reduces it from left to right. A fade requires a matching reference latent in the conditioning metadata; otherwise the node falls back to uniform scaling.

spatial_fade_strength

An optional FLOAT input setting how pronounced the selected spatial fade is. The default is 0.5, the minimum is 0.0, the maximum is 1.0, and the step is 0.05. At 0.0, all spatial positions receive equal weight even if a fade mode is selected. As the value increases, the lower-weight positions receive less of the configured strength; at 1.0, positions at the low end of the fade can receive zero weight. It has no effect when spatial_fade is none or no matching reference latent is found.

debug

An optional BOOLEAN input with a default of False. When enabled, the patch prints a [RefLatentController] line when it processes a valid selected reference, showing the block index, reference index, token slice, and configured strength. This helps you check whether the selected reference is being processed. It does not change the scaling calculation; leave it off when you do not need diagnostic output.

FLUX.2 Klein Ref Latent Controller Output Parameters:

model

The first output is a MODEL: a clone of the supplied model with the reference-weighting attention patch installed. Connect this output wherever you want the adjusted model to be used. The patch applies its scaling when attention runs and the selected reference’s token information is present; receiving this model output alone does not mean a visible change has already occurred.

conditioning

The second output is CONDITIONING. It is the same conditioning value passed into the node, returned unchanged for connection to later workflow steps. It may provide reference-latent metadata used to calculate a spatial fade, but the node does not rewrite the conditioning or embed the adjusted strength in it.

FLUX.2 Klein Ref Latent Controller Usage Tips:

  • Start with strength at 1.0 and spatial_fade at none to establish a baseline, then change one setting at a time so you can judge its effect.
  • Set reference_index to the zero-based position of the reference you intend to adjust. If you have several references, check their order before assuming that 0 targets the one you want.
  • For an even adjustment across the reference, leave spatial_fade at none. This also avoids depending on reference_latents metadata for the fade calculation.
  • To vary influence by position, choose a fade mode and begin with the default spatial_fade_strength of 0.5. Increase it for a stronger positional difference or set it to 0.0 to compare against even weighting.
  • Enable debug temporarily when you need to confirm that the selected reference is being processed. Look for the [RefLatentController] line in the process output, then turn debugging off when finished.

FLUX.2 Klein Ref Latent Controller Common Errors and Solutions:

Missing required input: model or conditioning

  • Explanation: The node requires both a MODEL and CONDITIONING connection. A workflow may report a missing-input validation error when either is absent.
  • Solution: Connect a compatible model to model and conditioning to conditioning before running the workflow.

Invalid value for strength, reference_index, or spatial_fade_strength

  • Explanation: The interface limits strength to 0.0–1000.0, reference_index to 0–7, and spatial_fade_strength to 0.0–1.0. Values outside these ranges may fail interface or workflow validation.
  • Solution: Bring the value into its stated range. Check the value supplied by any connected control as well as the value shown on the node.

Invalid spatial_fade option

  • Explanation: The interface offers only none, center_out, edges_out, top_down, and left_right. An unsupported value may be rejected by workflow validation; the helper also has no fade calculation for an unrecognized mode.
  • Solution: Select one of the listed options, or use none for uniform strength.

No visible change after adjusting strength

  • Explanation: The patch returns without changing attention data when runtime reference_image_num_tokens is absent or does not contain the selected reference_index. This is normally a silent no-op, not a specific error message from the node.
  • Solution: Check that your workflow supplies reference information to the model at runtime and that reference_index matches an available reference. Temporarily enable debug; a [RefLatentController] line indicates that a valid selected reference reached the patch.

Spatial fade appears to have no effect

  • Explanation: The node applies a fade only when it finds the selected latent under reference_latents in the conditioning metadata. Without it, scaling is uniform. A spatial_fade_strength of 0.0 also makes all calculated spatial weights equal. Neither condition produces a dedicated error message in this source.
  • Solution: Confirm that the supplied conditioning contains the selected reference latent, choose a fade mode other than none, and use a fade strength above 0.0.

No [RefLatentController] debug line appears

  • Explanation: Debug output is printed only when debug is enabled and the patch processes a selected reference with a valid runtime token entry. The node itself does not print a warning when that entry is missing.
  • Solution: Turn on debug, run the workflow through model execution, and check the process output. If the line is still absent, verify the reference setup and reference_index.

FLUX.2 Klein Ref Latent Controller Related Nodes

Go back to the extension to check out more related nodes.
comfyui-flux2-photomatch
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

FLUX.2 Klein Ref Latent Controller