Nodes/ComfyUI-Fluxtapoz/RF-Edit Prep Attn Inj
ComfyUI Node Runs on cloud

RF-Edit Prep Attn Inj

A pass-through node that exists to fight ComfyUI's execution order

By logtd·Created 2 years ago·Updated 2 years ago· 1,392
RF-Edit Prep Attn Inj
  • latent
  • attn_inj
  • LATENT
  • ATTN_INJ

PrepareAttnBank is the most honest node in the Fluxtapoz pack: the source code literally comments that it's a "Hack to force order of operations in ComfyUI graph." It takes a latent and an ATTN_INJ bank in, and gives you back the exact same latent and bank out. Nothing is computed. Its entire job is to make ComfyUI execute the RF-Edit forward sampler before the reverse sampler.

Why a fake node is necessary

In an RF-Edit graph, FlowEditForwardSampler produces both the SAMPLER and the ATTN_INJ attention bank. The reverse sampler needs that bank - it was recorded during the forward pass. But ComfyUI's scheduler doesn't guarantee that the node producing a value runs before a node that merely receives it somewhere else in the graph; execution order follows the wiring, and a bank that hasn't been filled yet is just empty. PrepareAttnBank forces the dependency: because the reverse sampler's branch consumes the latent and bank that have already been threaded through this node, ComfyUI has to finish the forward sampler first.

How you wire it

In the pack's example_rf_edit_workflow.json, the chain looks like this:

FlowEditForwardSampler (SAMPLER, ATTN_INJ)
        │
        └──> PrepareAttnBank (latent, attn_inj) ──> FlowEditReverseSampler

Inputs:

  • latent (LATENT) - your image latent, passed through untouched.
  • attn_inj (ATTN_INJ) - the bank from the forward sampler, passed through untouched.

Outputs:

  • LATENT and ATTN_INJ - identical to the inputs.

Installation

Same as every node in the pack: ComfyUI Manager → search "ComfyUI-Fluxtapoz" → install → restart, or git clone https://github.com/logtd/ComfyUI-Fluxtapoz into custom_nodes. No dependencies beyond einshape, no model files.

Common issues

The failure it prevents is the silent kind: RF-Edit output that looks like the edit happened but the original structure is gone, because the reverse sampler got an empty attention bank. If you remove this node to "simplify" the graph and RF-Edit stops holding structure, that's the reason - put it back. Other than that there's nothing to tune, nothing to break, and honestly nothing to think about. It's a wiring tool, not a feature, and it does its one job perfectly.

Categoryfluxtapoz

Inputs (2)

NameTypeDefaultDescription
latentLATENT
attn_injATTN_INJ

Outputs (2)

NameTypeDescription
LATENTLATENT
ATTN_INJATTN_INJ