Nodes/ComfyUI Fooocus Nodes/Fooocus PreKSampler
ComfyUI Node

Fooocus PreKSampler

The secret sauce, unpacked into a node

By Seedsa·Created 3 years ago·Updated 2 years ago· 102
Fooocus PreKSampler
  • pipe
  • image_to_latent
  • latent
  • fooocus_inpaint
  • fooocus_styles
  • pipe
  • model
  • clip
  • vae
  • CONDITIONING+
  • CONDITIONING-
steps30
cfg4.0
sampler_namedpmpp_2m_sde_gpu
schedulerkarras
seed0
denoise1.00
settingsSimple
sharpness2.00
adaptive_cfg7.00
adm_scaler_positive1.5
adm_scaler_negative0.8
adm_scaler_end0.3
controlnet_softness0.25
freeu_enabledfalse

People spent a year arguing about why Fooocus made the same SDXL models look better than A1111 or plain ComfyUI. This node is the answer, laid out as a property panel. The Fooocus PreKSampler is where the pack's "it just works" reputation actually happens - everything else is plumbing around it.

What it's doing

The Fooocus Loader gives you a pipe full of raw parts: model, clip, vae, conditioning. The PreKSampler takes that pipe and applies the tuned sampling setup Fooocus hid behind its UI, then hands the result to the pack's Fooocus KSampler for the actual denoising pass. The defaults you see here aren't random - they're the specific tricks from the Fooocus README: negative ADM guidance that restores CFG contrast at SDXL's top resolution level, a tuned sharpness term that kills plastic skin, adaptive CFG, and the dpmpp_2m_sde_gpu + karras pairing the project settled on.

What a beginner actually sets

Most of the panel is "leave it". The ones that matter:

  • steps - 30 default. This is your quality/ speed dial.
  • cfg - 4 default. Fooocus ran low CFG on purpose; SDXL responds well to 3–6.
  • sampler_name - defaults to dpmpp_2m_sde_gpu, which you should not feel obliged to change.
  • scheduler - karras default. Fine.
  • seed - the reproducibility knob.
  • denoise - 1.0 for text-to-image. Drop it when you're doing img2img (feed image_to_latent) or paired with the Inpaint node.

Then the things people tweak once they're curious: sharpness (2, the skin-killer), adaptive_cfg (7), freeu_enabled (off - it's the U-Net free-U trick if you want sharper high-frequency detail at a cost). The adm_scaler_positive / adm_scaler_negative / adm_scaler_end cluster is advanced; the community's standard advice is to leave ADM scaling alone until you've got a specific complaint.

settings - Simple or Advanced. Simple hides the scaler cluster; pick Advanced when you want to see every knob.

What comes out

Besides a pipe, it also outputs model, clip, vae, and positive/negative CONDITIONING. That's the escape hatch: wire those into standard ComfyUI nodes if you want to step outside the pack's pipe flow mid-graph. The optional fooocus_inpaint and fooocus_styles inputs are how the Inpaint and Styles nodes plug in - this is the only node that consumes them.

Installing and notes

Part of the pack: ComfyUI Manager → "Fooocus Nodes", or clone the repo. The pack is SDXL-only, frozen in spirit - it reproduces Fooocus, and Fooocus never moved past SDXL. If you're on Flux or newer, this whole pipeline is the wrong tool; this node is for people who want that specific SDXL look. And remember: it prepares the conditions - without the Fooocus KSampler after it, nothing gets sampled.

CategoryFooocus

Inputs (19)

NameTypeDefaultDescription
pipePIPE_LINE
stepsINT301–10000
cfgFLOAT4.00–100
sampler_nameCOMBOdpmpp_2m_sde_gpu34 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +28
schedulerCOMBOkarras9 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform, +3
seedINT00–9223372036854776000
denoiseFLOAT1.000–1
settingsCOMBOSimple2 options: Simple, Advanced
sharpnessFLOAT2.000–100
adaptive_cfgFLOAT7.000–100
adm_scaler_positiveFLOAT1.50–3
adm_scaler_negativeFLOAT0.80–3
adm_scaler_endFLOAT0.30–1
controlnet_softnessFLOAT0.250–1
freeu_enabledBOOLEANfalse
image_to_latentoptIMAGE
latentoptLATENT
fooocus_inpaintoptFOOOCUS_INPAINT
fooocus_stylesoptFOOOCUS_STYLES

Outputs (6)

NameTypeDescription
pipePIPE_LINE
modelMODEL
clipCLIP
vaeVAE
CONDITIONING+CONDITIONING
CONDITIONING-CONDITIONING