Load Foveated LoRA (FovDiff)
The patched model that makes foveation sampling possible
- model
- model
- lr_factor
LoadFoveatedLoRA looks like a normal LoRA loader, but it's doing two jobs at once, and the second one is the one that matters. First, the obvious: it loads one of the foveated FLUX.2 Klein LoRAs that the Stanford foveated-diffusion project trained to keep quality intact when peripheral tokens get dropped. Second - and this is why the node exists - it stamps your model with the lr_factor that tells FoveatedKSampler how aggressively to downsample the periphery. In this pack, the sampler reads that setting off the model you hand it, so this node is effectively the on-switch for the whole workflow. Skip it and FoveatedKSampler has nothing to work with.
The author, ruwwww, is no stranger to inference-time optimization - they ship a couple of these speedup packs, and this one rides on the same "quality is a budget, spend it where it counts" philosophy. The LoRA itself lives in the bchao1/foveated-diffusion HuggingFace repo, and the node will happily download it for you the first time you run.
Inputs that matter
- lora_mode -
auto_download_random(default),auto_download_saliency,auto_download_bbox, orfrom_path. The three auto modes fetch different LoRA variants from HuggingFace: random-trajectory, saliency-guided (trained to predict where the viewer actually looks), and bbox-guided.from_pathuses a local.safetensorsinstead - you then have to fill in the lora_path field, which is an absolute path and required in that mode. - lr_factor - 2 or 4. Factor 2 keeps 1 of every 4 peripheral tokens (~40–50% token reduction, the README's ~1.5–2.5×), factor 4 keeps 1 of 16 (~60–70% reduction, ~3–4×). Bigger is not better; it's a quality/speed dial.
- lora_strength - 0 to 2, default 1.0. Standard LoRA strength. One nice detail in the source: set it to 0 and the node still returns the model with
lr_factorapplied - so you can run the foveation sampler on a plain, un-LoRA'd model if you want to A/B what the LoRA is buying.
Outputs are the patched model and the lr_factor as an INT - the second output is mostly there so you can see, and log, what setting the sampler inherited.
Gotchas, and there are a couple
The auto-download path needs huggingface_hub; if your environment is missing it the node raises an error that literally tells you to pip install huggingface_hub. The pack ships no requirements.txt at all, so this is the one dependency you might actually have to add. Also note the foveated LoRAs are Klein-specific - same 4B/9B size rule as every other Klein LoRA (don't mix across sizes), and don't expect this to load onto a non-Flux model, because the sampler wrapper that consumes the patch is Flux2-only anyway.
Wire it like the README's quick start: LoadCheckpoint FLUX.2-klein-4B → LoadFoveatedLoRA → CLIPTextEncode for both conditionings, then on to FoveationMask and FoveatedKSampler. Install via ComfyUI Manager (search "FovDiff") or git clone https://github.com/ruwwww/ComfyUI-Foveated_Diffusion into custom_nodes, restart, and let the first run fetch the LoRA. Worth knowing before you start: foveated diffusion is weeks old in the community - there's essentially one paper-announcement thread and no field reports yet - so take the README's speedup numbers as the author's, not the crowd's, and check the preview nodes before you trust a big lr_factor.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| lora_mode | COMBO | auto_download_random | 4 options: auto_download_random, auto_download_saliency, auto_download_bbox, from_path |
| lr_factor | INT | 22–4 | LR periphery downsampling factor. 2 = 4x fewer peripheral tokens. 4 = 16x fewer peripheral tokens. |
| lora_strength | FLOAT | 1.000–2 | — |
| lora_pathopt | STRING | Required when lora_mode='from_path'. Absolute path to .safetensors. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| lr_factor | INT | — |