Nodes/Refocus - Generative Refocusing/Genfocus Switch Adapter
ComfyUI Node

Genfocus Switch Adapter

Swap between DeblurNet and BokehNet on one loaded pipeline

By EricRollei·Created 8 months ago·Updated 4 months ago· 19
Genfocus Switch Adapter
  • pipeline
  • pipeline
adapter_modedeblurring
deblur_loranone
bokeh_loranone

Genfocus's two LoRAs are trained for opposite jobs - DeblurNet sharpens everything, BokehNet blurs selectively - so they should never be active at the same time. GenfocusSwitchAdapter exists to swap between them on a single loaded pipeline: take a GENFOCUS_PIPELINE in, switch which adapter is active, get the same pipeline back out. It's the node you use when one workflow needs to do a deblur pass and then a bokeh pass without loading FLUX twice.

The mechanism, and why it's aggressive

The switch follows the original Genfocus approach to the letter: unload the current LoRA weights entirely, then load the new one fresh. The reason is interference - Genfocus's paper and demo explicitly avoid having multiple adapters resident at once, because the conditions from one stage can bleed into the other. So this isn't a weight blend; it's a hard swap. If you select none as the adapter mode, it unloads all LoRA weights and leaves you with a bare FLUX pipeline, which is a legitimate state if you want a plain-generation pass.

Inputs

  • pipeline (required) - GENFOCUS_PIPELINE from either Genfocus loader.
  • adapter_mode (deblurring) - deblurring, bokeh, or none. Which LoRA ends up active.
  • deblur_lora / bokeh_lora - which file to load for each mode, from models/genfocus/. The node auto-detects filenames containing "deblur"/"bokeh" as defaults.

One output: pipeline again - same object, different adapter state. Wire the output onward to the execution node.

When you'd actually use it

Honestly, in most graphs you don't need this node at all - Genfocus Generate, Genfocus Deblur, and Genfocus Bokeh already activate exactly one adapter per call, following the same unload-then-load pattern internally. SwitchAdapter is for when you're orchestrating the state manually: a single pipeline that alternates deblur and bokeh across a batch, or a pipeline you want stripped down to none for a stock generation. Think of it as the manual transmission option.

Gotchas

  • If the requested mode's LoRA file is set to none, the node warns and returns the pipeline unchanged - it doesn't error. So a "switch" that silently doesn't switch is a real failure mode; check the console for "No LoRA file specified".
  • After a switch, downstream nodes must use the output pipeline, not the original input - the state change lives on that object.
  • It only manages Genfocus's own adapters. DepthPro and the FLUX weights themselves are untouched; that's Genfocus Unload Models' job if you need to free VRAM.

Install

Same pack, same prerequisites as every native node: ComfyUI Manager ("Refocus - Generative Refocusing") or clone the repo, pip install diffusers transformers accelerate peft, Genfocus LoRAs in models/genfocus/, and a FLUX-dev pipeline from a loader. The node itself has no model dependencies - it just shuffles adapter state.

CategoryGenfocus

Inputs (4)

NameTypeDefaultDescription
pipelineGENFOCUS_PIPELINE
adapter_modeCOMBOdeblurringWhich LoRA adapter to use
deblur_loraoptCOMBOnoneDeblurNet LoRA file
bokeh_loraoptCOMBOnoneBokehNet LoRA file

Outputs (1)

NameTypeDescription
pipelineGENFOCUS_PIPELINE