EFDM
The multi-style, tweakable workhorse of StyleTransferPlus
- src_img
- style_img
- res_img
EFDM ("Exact Feature Distribution Matching", CVPR 2022) is the pack's most configurable node, and for a lot of people it ends up being the favorite. Where the older CAST gives you one dropdown, EFDM gives you five model architectures, a strength slider, multi-style blending, color preservation, and a CPU fallback. It's fast, it scales to genuinely high resolutions, and it's the closest thing this pack has to a Swiss Army knife.
The idea: most style transfer normalizes content features so their mean and standard deviation match the style's (that's AdaIN). EFDM's claim to fame is that it matches the entire feature distribution instead - it sorts the content and style feature values and swaps them, so the output keeps the style's full histogram, not just its average and spread. In practice that means stronger, more faithful texture transfer than AdaIN with less structural mush.
Inputs that matter
src_img/style_img- content and style.model_arch- dropdown ofadain,adamean,adastd,efdm(default),hm(histogram matching). The first three are the classic statistics-matching baselines from the AdaIN family;efdmandhmare the newer, stronger distribution-matching methods. Defaultefdmis a fine starting point.style_strength- 0.0 to 1.0, default 1.0. How hard the style is applied. This is your main dial.style_interp_weights- comma-separated weights for multiple styles (e.g.0.7,0.3for two styles). Weights are normalized automatically; empty string = equal weights. Feed several style images in a batch onstyle_imgand this blends between them.preserve_color- keep the content's colors, transfer only texture. Great when you like a painting's strokes but not its palette.size- height after resizing (content keeps aspect, styles get squished to match). Higher = better, more VRAM. The author says tested atsize=2048on a 12 GB card.do_crop- resize-then-center-crop to square.use_cpu- CPU fallback for OOM situations. Warning: slow, ~21 seconds per the default workflow. It's a lifeline, not a preference.
Output is res_img (IMAGE) → Preview/Save.
Install
Same pack install as always:
cd ComfyUI/custom_nodes
git clone https://github.com/FuouM/ComfyUI-StyleTransferPlus
or via ComfyUI Manager (search ComfyUI-StyleTransferPlus), restart. Two model files:
ComfyUI/custom_nodes/ComfyUI-StyleTransferPlus/models/hm_decoder_iter_160000.pth
ComfyUI/custom_nodes/ComfyUI-StyleTransferPlus/models/vgg_normalised.pth
The decoder comes from the EFDM repo (ArbitraryStyleTransfer/models), and vgg_normalised.pth is the same shared file used by CAST and TSSAT - download it once. Dependencies are the pack's standard torch, torchvision, scikit-image, einops.
Common issues
- OOM at high
size- dropsize, or tickuse_cpuand go make tea.size=2048on 12 GB is the stated ceiling. - Multiple styles look unbalanced - that's what
style_interp_weightsis for; empty string means equal. - Colors bleeding in -
preserve_colorfixes exactly this.
If you want one node in this pack to actually experiment with, EFDM is it. CAST is simpler, AesFA is newer, but EFDM gives you knobs that change the result in ways you'll feel.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| src_img | IMAGE | — | |
| style_img | IMAGE | — | |
| style_interp_weights | STRING | — | |
| model_arch | COMBO | efdm | 5 options: adain, adamean, adastd, efdm, hm |
| style_strength | FLOAT | 1.000–1 | — |
| do_crop | BOOLEAN | false | — |
| preserve_color | BOOLEAN | false | — |
| size | INT | 512 | — |
| use_cpu | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| res_img | IMAGE | — |