FluxOrthoCFGPatcher
Keeping real CFG from burning Flux images
- model
- model
Once you've turned off Flux's baked-in guidance distillation (with something like FluxGuidanceDisable, or by running a de-distilled checkpoint), you get real CFG back - and real CFG on Flux is fragile. Push it past a couple of points and images blow out: oversaturated, crunchy, "deep fried." Flux was never trained on a genuine unconditional pass the way SD1.5 or SDXL was, so ordinary CFG math - subtract the unconditional prediction from the conditional one and scale - tends to double-correct. FluxOrthoCFGPatcher is a fix for that: it applies orthogonal CFG, the same family of trick as ComfyUI's PerpNegGuider, which the community already uses to make negative prompting behave on Flux.
The idea, in plain terms: your positive and negative conditioning point in somewhat different directions through the model's latent space. Naive CFG subtracts the negative direction wholesale, including the part that overlaps with the positive direction - which is redundant correction, and redundant correction is what burns the image. Orthogonal CFG projects out that overlapping component first, so what actually gets subtracted is only the part of the negative that's genuinely opposed to your prompt. You keep negative-prompt control without the runaway contrast.
What you're setting
It's a model patcher - one model in, one patched model out, wired straight into your sampler chain, same shape as FluxGuidanceDisable and often paired with it.
enable(default true) - the master switch.ortho_T5andortho_clip_L(both default true) - Flux conditions on two separate encoder streams, T5-XXL and CLIP-L. These let you apply the orthogonalization to each stream independently, since they don't necessarily need the same treatment.zero_clip_L(default true) - the same CLIP-L-zeroing option FluxGuidanceDisable has. If you're already zeroing CLIP-L upstream, this keeps the two nodes' settings consistent rather than fighting each other.
Installing it
Same pack, same steps as every RES4LYF node:
- ComfyUI Manager - search "RES4LYF," install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/ClownsharkBatwing/RES4LYF, thencd RES4LYF && pip install -r requirements.txt. Restart.
Nothing extra to download; it's a pure model patch.
Common issues
Images still burn at moderate CFG. Orthogonal CFG reduces the double-correction problem, it doesn't eliminate the underlying fact that Flux wasn't trained for this. Keep CFG modest - the RES4LYF README's own example for dedistilled Flux is CFG around 3.0, not the 7-9 you'd reach for on SDXL.
No negative-prompt effect at all. Check that guidance distillation is actually disabled upstream (FluxGuidanceDisable, or a genuinely de-distilled checkpoint). If the model is still running its baked-in guidance, there's no real unconditional pass for this node to orthogonalize against - it has nothing to work on.
Generation time doubled and you didn't expect it. That's real CFG, not a bug. Running a genuine unconditional pass means two model calls per step instead of one - the same cost SD1.5/SDXL always paid, which guidance-distilled Flux was specifically built to avoid. If you don't need negative prompting for a given run, skip this node and the disable node and stay on the fast path.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| enable | BOOLEAN | true | — |
| ortho_T5 | BOOLEAN | true | — |
| ortho_clip_L | BOOLEAN | true | — |
| zero_clip_L | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |