Nodes/ComfyUI-Fluxtapoz/RF-Edit Double Layers Override
ComfyUI Node Runs on cloud

RF-Edit Double Layers Override

The 19 double-block switches that decide how much of your original survives an RF-Edit

By logtd·Created 2 years ago·Updated 2 years ago· 1,392
RF-Edit Double Layers Override
    • DOUBLE_LAYERS
    0false
    1false
    2false
    3false
    4false
    5false
    6false
    7false
    8false
    9false
    10false
    11false
    12false
    13false
    14false
    15false
    16false
    17false
    18false

    When an RF-Edit comes back almost right - subject there, pose held, but the details have drifted - the fix lives in this node. RFDoubleBlocksOverride ("RF-Edit Double Layers Override") is a row of nineteen switches, one per double block in Flux's transformer, and each one decides whether that layer's attention gets carried over from your original image or gets to regenerate freely under the new prompt.

    Here's what it's doing. In the Fluxtapoz pack, RF-Edit is logtd's implementation of RF-Solver-Edit (the "Taming Rectified Flow for Inversion and Editing" paper). The workflow runs your image backwards through the ODE with the RF-Edit Forward Sampler, turning it into noise, then samples back up with a new prompt using the RF-Edit Reverse Sampler. Between those two passes, attention values from the original get saved into a bank and then re-injected. That injection is what holds the composition together - without it, an "edit" would just be generating something that happens to start from your colors.

    The mechanism is dead simple once you see it: during the forward pass, for the last save_steps, the enabled layers' attention values get copied into the bank. During the reverse pass, for the first inject_steps, those exact values are forced back into the same layers. Switch on = preserved. Switch off = free. There's no model training, no ControlNet, no hidden API - just attention maps moving between two sampling passes.

    Flux's transformer has 19 double blocks (indices 0–18) that process the image and text streams jointly, then 38 single blocks. This node covers only the double blocks, and the author's default is all nineteen off. So a stock RF-Edit workflow preserves structure entirely through the single blocks - you reach for the double-layer switches when you want the text–image coupling itself locked down, or when the single blocks alone aren't holding the composition.

    The inputs that matter: nineteen booleans, 0 through 18, all defaulting to false. No tooltips, no widgets - it's a config builder. The output, DOUBLE_LAYERS, wires into the double_layers input on both the RF-Edit Forward Sampler and the RF-Edit Reverse Sampler. Use the same node's output for both: if the forward pass banks attention for layers the reverse pass isn't looking up (or vice versa), the reverse silently skips them and your edit gets looser than you think you configured.

    Installing it is installing the whole pack. In ComfyUI Manager, search "Fluxtapoz" and hit install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/logtd/ComfyUI-Fluxtapoz
    

    Then restart ComfyUI. The only Python dependency is einshape, a tiny tensor-reshape helper - the genuinely heavy prerequisite is Flux itself, so this is dead weight without a working FLUX.1 dev stack (the 12B transformer, T5 and CLIP encoders, and VAE) already on your disk.

    Where people get burned: flip too many double blocks on and the edit fights the new prompt - the injected text–image attention refuses to let go of the old composition. Flip them off entirely and you're back at the default, which is fine for most edits. And if you've banked many steps at high resolution, watch your host RAM: the bank stores values on CPU, off the GPU, which keeps VRAM safe but can add up. The pack's example workflows run perfectly without touching this node - it's a tuning knob for when "good enough" isn't.

    Categoryfluxtapoz

    Inputs (19)

    NameTypeDefaultDescription
    0BOOLEANfalse
    1BOOLEANfalse
    2BOOLEANfalse
    3BOOLEANfalse
    4BOOLEANfalse
    5BOOLEANfalse
    6BOOLEANfalse
    7BOOLEANfalse
    8BOOLEANfalse
    9BOOLEANfalse
    10BOOLEANfalse
    11BOOLEANfalse
    12BOOLEANfalse
    13BOOLEANfalse
    14BOOLEANfalse
    15BOOLEANfalse
    16BOOLEANfalse
    17BOOLEANfalse
    18BOOLEANfalse

    Outputs (1)

    NameTypeDescription
    DOUBLE_LAYERSDOUBLE_LAYERS