Nodes/Refocus - Generative Refocusing/Genfocus Model Loader (Native)
ComfyUI Node

Genfocus Model Loader (Native)

Loading FLUX.1-dev with the Deblur/Bokeh LoRAs

By EricRollei·Created 8 months ago·Updated 4 months ago· 19
Genfocus Model Loader (Native)
    • pipeline
    flux_modelhf:black-forest-labs/FLUX.1-dev
    precisionbf16
    deblur_loranone
    bokeh_loranone
    offload_to_cpufalse

    Every "Native" Genfocus workflow starts here. GenfocusModelLoader loads a complete diffusers FluxPipeline - the full FLUX.1-dev stack plus the DeblurNet and BokehNet LoRA adapters - and hands you a GENFOCUS_PIPELINE that all the other Genfocus nodes consume. It's the pack's flagship node and the one that answers the question the Genfocus paper's Reddit thread ended on: "Comfy when?"

    There's a reason this node exists and does what it does, and it's a genuinely interesting story. Genfocus's LoRAs were trained on the diffusers FLUX architecture, which uses separate Q, K, V projection layers. ComfyUI's native FLUX implementation fuses QKV into single linear layers for efficiency. The pack author tried patching the LoRAs onto ComfyUI's fused layers and got characteristic spotted-corruption artifacts - so a native sampler approach was abandoned, and the pipeline instead runs diffusers under the hood, where the LoRAs land on exactly the architecture they were trained for. That's why this loader is heavy, and why it can't be avoided if you want the real Genfocus quality.

    What you set

    • flux_model - a dropdown of local diffusers models (prefixed local:) plus hf:black-forest-labs/FLUX.1-dev. Local looks in models/diffusers/<name>/ for a folder with model_index.json. The hf: option requires huggingface-cli login and accepting FLUX.1-dev's gated license.
    • precision (bf16) - bf16 recommended for FLUX. fp16 if your card can't do bf16.
    • deblur_lora / bokeh_lora - from models/genfocus/. The node auto-detects files with "deblur"/"bokeh" in the name.
    • offload_to_cpu (false) - enables diffusers CPU offloading. Saves VRAM, costs speed.

    One output: pipeline. That's it - everything downstream hangs off it.

    The honest system requirements

    This is not a light node. FLUX.1-dev at bf16 wants roughly 24GB VRAM. If you don't have it, your options are offload_to_cpu (slower but works), fp16, or the Genfocus Model Loader (Components) sibling node, which assembles the same pipeline from single-file checkpoints you may already own instead of requiring the ~23GB diffusers folder. Either way the base model is FLUX.1-dev, which is non-commercial - the license matters if you plan to ship anything.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/EricRollei/comfyui-refocus Refocus
    pip install diffusers transformers accelerate peft
    

    The LoRAs (~35MB, Apache 2.0) go in models/genfocus/ from nycu-cplab/Genfocus-Model on HuggingFace. FLUX.1-dev goes in models/diffusers/FLUX.1-dev/ - there's a scripts/download_models.py helper that handles both, including the HF login check. ComfyUI Manager also installs the pack ("Refocus - Generative Refocusing"); just know Manager won't pull the models for you.

    Gotchas

    • Missing diffusers throws a clean error telling you to pip install diffusers transformers accelerate peft. If the nodes are just missing from your node list, that's the same cause - the native nodes import inside a try/except and silently hide when deps are absent.
    • The LoRAs are FLUX.1-dev-specific. They'll load on dev-architecture fine-tunes, but quality is untested. Do not use FLUX.1-schnell - its timestep distillation differs and results will be wrong.
    • The loader caches the pipeline keyed on its config, so re-running a workflow with the same settings reuses it instead of reloading 23GB. If you change models and hit stale state, Genfocus Unload Models clears the cache.
    CategoryGenfocus

    Inputs (5)

    NameTypeDefaultDescription
    flux_modelCOMBOhf:black-forest-labs/FLUX.1-devFLUX model: 'local:' = models/diffusers/, 'hf:' = HuggingFace (requires login)
    precisionCOMBObf16Model precision (bf16 recommended for FLUX)
    deblur_loraoptCOMBOnoneDeblurNet LoRA (from models/genfocus/)
    bokeh_loraoptCOMBOnoneBokehNet LoRA (from models/genfocus/)
    offload_to_cpuoptBOOLEANfalseOffload model to CPU when not in use (saves VRAM but slower)

    Outputs (1)

    NameTypeDescription
    pipelineGENFOCUS_PIPELINE