ComfyUI Node

AesPA-Net

Pattern-aware style transfer with the one model-download trap

By FuouM·Created 2 years ago·Updated about a year ago· 15
AesPA-Net
  • src_img
  • style_img
  • out_img
do_cropfalse
size512

AesPA-Net ("Aesthetic Pattern-Aware Style Transfer Networks", 2023) sits in the middle of the ComfyUI-StyleTransferPlus pack: faster and cleaner than the optimization-based Neural Neighbor, less twitchy than AesFA. Like everything here it's non-diffusion arbitrary style transfer - content image in, style image in, a small network runs once, stylized image out. No prompt, no sampler, no seed.

Where it earns its name is the "pattern-aware" part. Most feed-forward style transfer matches global statistics - the whole image's color/texture profile. AesPA instead matches aesthetic patterns: it looks at local patches of the style and adapts the normalization to those patterns rather than one global transform. Practically that means it tends to keep more local structure from the content while still picking up strong texture, which makes it a decent default when a style image has a distinct "surface" to it - oil canvas, crosshatching, that sort of thing.

The one gotcha: the VGG file

AesPA needs three model files. Two are easy; the third is a classic trap:

ComfyUI/custom_nodes/ComfyUI-StyleTransferPlus/models/aespa/dec_model.pth
ComfyUI/custom_nodes/ComfyUI-StyleTransferPlus/models/aespa/transformer_model.pth
ComfyUI/custom_nodes/ComfyUI-StyleTransferPlus/models/vgg_normalised_conv5_1.pth

The original authors ship vgg_normalised_conv5_1.t7 - a Torch 7 format that PyTorch dropped native support for, and that the pack author explicitly says "doesn't work reliably on Windows." Don't download the .t7. Grab the .pth version from the deep-transfer repo's vgg19_5 folder instead, and name it vgg_normalised_conv5_1.pth. This trips up more people than anything else in this pack, because the obvious download is the wrong one.

Inputs and outputs

Refreshingly simple:

  • src_img / style_img - content and style.
  • size - square edge length (default 512, capped at 1024).
  • do_crop - resize-then-center-crop to square instead of squishing.

Square-only again, like several nodes in this pack. Output is out_img (IMAGE) → Preview/Save.

Install

Same shared pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/FuouM/ComfyUI-StyleTransferPlus

or search ComfyUI-StyleTransferPlus in ComfyUI Manager, restart, and place the models as shown above. Dependencies are the usual torch, torchvision, scikit-image, einops - nothing you don't already have.

Common issues

  • .t7 load errors - you downloaded the wrong VGG file. Go get the .pth.
  • Out of memory at size above 1024 - can't happen, the schema caps at 1024.
  • Square output - by design; feed square-ish content or use do_crop.

If your goal is "decent stylization, medium speed, least drama," AesPA is a reasonable first stop in this pack. Just read the model-download note before you start, or you'll burn an hour on a .t7 file that was never going to work.

CategoryStyleTransferPlus

Inputs (4)

NameTypeDefaultDescription
src_imgIMAGE
style_imgIMAGE
do_cropBOOLEANfalse
sizeINT5121–1024

Outputs (1)

NameTypeDescription
out_imgIMAGE