Nodes/RES4LYF/ReFluxPatcherAdvanced
ComfyUI Node Runs on cloud

ReFluxPatcherAdvanced

RES4LYF's style/faceswap patch for Flux, block by block

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
ReFluxPatcherAdvanced
  • model
  • model
doublestream_blocksall
singlestream_blocksall
style_dtypefloat64
enabletrue

This one has an actual origin story. RES4LYF's author has said the ReFluxPatcher line of nodes exists partly because the Flux PuLID repository it depended on for faceswap work was broken, and rather than wait on an upstream fix, he patched Flux from the outside himself. That same effort turned into RES4LYF's broader zero-shot faceswap and universal style-transfer work on Flux - including "scattersort," a style mode built specifically to stop faceswaps dragging the wrong color and lighting along with them from the source image. ReFluxPatcherAdvanced is the current, block-selectable version of that Flux hook.

What it does

Like the other Re*Patcher nodes in the pack, this wraps a loaded model so RES4LYF's style-guide, faceswap, and dual-conditioning system can inject an extra signal into the forward pass - and Flux gets its own patcher because its transformer's double-stream and single-stream block layout needs architecture-specific handling that a generic patch can't do correctly. The "advanced" part is choosing exactly which of those blocks the style signal touches: narrow it to earlier double-stream blocks to keep the influence mostly compositional, or let it reach into later single-stream blocks for finer texture and detail work. There's no plain "ReFluxPatcher" in this list - leave both block fields at "all" for the equivalent of the on/off version.

Flux is worth being clear-eyed about here: it's the model this feature set was originally built for, and probably the single most common target for this node given the size of Flux's LoRA and workflow ecosystem - even as the wider community has largely moved its day-to-day generation work on to newer models.

The inputs and outputs that matter

  • model (MODEL, required) - your loaded Flux model (Dev, Schnell, or a Flux-architecture derivative).
  • doublestream_blocks (STRING, default "all") - which double-stream blocks get the style patch. Comma-separated indices or ranges; leave at "all" until you have a reason to narrow.
  • singlestream_blocks (STRING, default "all") - same for single-stream blocks.
  • style_dtype (default float64) - precision for the style computation specifically, separate from whatever dtype your Flux weights are loaded in (many people run Flux at fp8 to fit VRAM; that's fine, this setting doesn't force your whole model to float64, just the guide pathway).
  • enable (BOOLEAN, default true) - bypass switch, so you can compare patched vs. unpatched without rewiring.

Output: a patched model, connected onward exactly like any model output.

How to install it

Ships with RES4LYF - no separate install. Via ComfyUI Manager: search "RES4LYF", install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF/
cd RES4LYF
pip install -r requirements.txt

(use the portable install's embedded pip.exe on Windows if that's your setup). You'll need your own Flux checkpoint - this node patches a model you've already loaded, it doesn't download one.

Common issues & troubleshooting

Faceswap results drag color or lighting from the source image. This is exactly the failure mode "scattersort" was built to fix - make sure you're actually using the style mode intended for faceswap work rather than a generic style-transfer setting, if your workflow exposes that choice.

You don't know what to put in the block fields. Start at "all", confirm it's doing what you expect, then narrow one field at a time on a fixed seed. These are free-text fields with no validation - a bad index or typo fails silently rather than erroring loudly.

Running Flux at fp8 and worried this forces full precision. It doesn't - style_dtype only governs the style-guide computation this patcher adds, not your base model weights. Your fp8 or GGUF-quantized Flux stays exactly as loaded.

Wrong patcher for a Flux-derived model. Chroma is built on Flux.1-schnell but has its own patcher (ReChromaPatcherAdvanced) for a reason - the two aren't interchangeable even though they share lineage. Use this one for actual Flux Dev/Schnell weights.

CategoryRES4LYF/model_patches

Inputs (5)

NameTypeDefaultDescription
modelMODEL
doublestream_blocksSTRINGall
singlestream_blocksSTRINGall
style_dtypeCOMBOfloat645 options: default, bfloat16, float16, float32, float64
enableBOOLEANtrue

Outputs (1)

NameTypeDescription
modelMODEL