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

Genfocus Generate (Native)

Full control over multi-condition refocusing

By EricRollei·Created 8 months ago·Updated 4 months ago· 19
Genfocus Generate (Native)
  • pipeline
  • condition_1
  • condition_2
  • condition_3
  • latents
  • image
prompt_presetbokeh
width1024
height1024
steps28
guidance_scale1.0
seed42
custom_prompt
main_adapterauto
kv_cachefalse

GenfocusGenerate is the raw engine of the pack. Where the convenience nodes hide the plumbing, this one gives you the full Genfocus multi-conditional generation: up to three image conditions, per-branch LoRA adapters, prompt presets, starting latents, even a KV cache toggle. If you're doing anything beyond the stock deblur-or-bokeh recipe - or you just want to understand what the convenience nodes are really doing - this is the node to read.

What it runs

The Genfocus paper's demo is, underneath everything, a conditional FLUX generation: a prompt plus one or more image conditions, each carrying its own LoRA adapter, all stitched into the diffusion process through a custom transformer_forward. That's exactly what this node exposes. The prompt_preset dropdown picks the operation - deblur ("a sharp photo with everything in focus") or bokeh ("an excellent photo with a large aperture"), matching the original demo.py word-for-word - or custom, which activates the custom_prompt field.

The subtle part is main_adapter. In the original Genfocus, the main latent branch never carries a LoRA - the LoRAs live on the condition branches. So main_adapter (default auto) doesn't set the main branch's LoRA; it picks which adapter the conditions should use, inferred from the prompt preset. The node then activates exactly one adapter at a time (pipeline.set_adapters([...])), following the original demo's pattern of unloading everything else to prevent adapter interference.

The inputs that matter

  • pipeline - from either Genfocus loader.
  • width / height (1024) - FLUX native resolution, and the step increments enforce multiples of 16.
  • steps (28) - the README suggests 32–50 for more refined output if you have the patience.
  • guidance_scale (1.0) - Genfocus runs near-CFG-1, which is what makes it fast and stable; the README's "lower guidance for a more natural look" advice points at 2.5–3.0 on the utility nodes, not this one.
  • condition_1/2/3 - GENFOCUS_CONDITION objects from Genfocus Condition or Genfocus Defocus Map Condition. This is where the input image, the defocus map, and any structure masks go. Each condition carries its own adapter and position embeddings, which is how you combine, say, a deblurring condition with a bokeh condition in one pass.
  • latents - optional starting latents if you want to chain generations consistently.
  • kv_cache (false) - enables KV caching to speed up inference.

One output: image.

When to reach for it

For the stock workflows, honestly, the convenience nodes (Genfocus Deblur / Genfocus Bokeh) are the better choice - they set up the correct conditions for you and you can't miswire them. Reach for GenfocusGenerate when you want more than two conditions, a custom prompt, seed-to-latent chaining, or the position-offset tricks that multi-condition Genfocus enables. It's the node that makes this pack more than a preset button.

Install and troubleshooting

Part of the Refocus pack: ComfyUI Manager → "Refocus - Generative Refocusing", or clone the repo into custom_nodes/. Requires pip install diffusers transformers accelerate peft and a loaded pipeline - so all the usual FLUX prerequisites (gated HF login or component files, ~24GB VRAM or offload_to_cpu) apply. If a run looks washed out or wrong, check which adapter is active: the node logs Activated adapter: X only to the console, which is your first clue whether deblurring/bokeh weights are actually in play. And remember the pack's core constraint: only FLUX-dev-architecture models, never Schnell.

CategoryGenfocus

Inputs (14)

NameTypeDefaultDescription
pipelineGENFOCUS_PIPELINE
prompt_presetCOMBObokehPreset prompt for operation type
widthINT1024256–2048Output width (FLUX native: 1024)
heightINT1024256–2048Output height (FLUX native: 1024)
stepsINT281–100
guidance_scaleFLOAT1.00–20Classifier-free guidance (1.0 = no CFG)
seedINT420–4294967295
custom_promptoptSTRINGCustom prompt (only used when preset is 'custom')
condition_1optGENFOCUS_CONDITION
condition_2optGENFOCUS_CONDITION
condition_3optGENFOCUS_CONDITION
latentsoptLATENT
main_adapteroptCOMBOautoLoRA for main branch. 'auto' matches prompt_preset
kv_cacheoptBOOLEANfalseEnable KV caching for efficiency

Outputs (1)

NameTypeDescription
imageIMAGE