Load StyleGAN Model
The StyleGAN model loader (and the model hunt that follows)
- STYLEGAN
Every StyleGAN workflow in this pack starts here, and it's the node where people stall first - not because loading is hard, but because it's the first moment you discover that StyleGAN models don't live on Civitai. Load StyleGAN Model reads an NVIDIA-format .pkl checkpoint out of ComfyUI/models/stylegan/ and hands you a STYLEGAN object ready to generate. One dropdown, one output, zero drama.
What it's loading
StyleGAN2 and StyleGAN3 (both supported here) save their weights as Python pickles from the NVlabs training code - a dict containing the trained generator's exponential-moving-average weights under the key G_ema. That's the whole model: no VAE, no text encoder, no U-Net halves. This node does pickle.load on your file, pulls out G_ema, and shoves it onto the GPU. Because it uses the modern NVlabs pickle format directly, it doesn't need ComfyUI's legacy network loader at all.
The one input, stylegan_file, is a dropdown populated from every .pkl in models/stylegan/. No defaults to fight - if the dropdown is empty, the folder is empty.
Where the models come from
NVIDIA's NGC catalog hosts the official weights, and the README links straight to them:
- StyleGAN2: https://catalog.ngc.nvidia.com/orgs/nvidia/teams/research/models/stylegan2/files
- StyleGAN3: https://catalog.ngc.nvidia.com/orgs/nvidia/teams/research/models/stylegan3/files
You want names like stylegan2-ffhq-512.pkl (faces, the classic), stylegan2-afhq-512.pkl (animals: cat, dog, wild), stylegan2-church-256.pkl or the stylegan3-r-*-1024x1024.pkl rotation-equivariant variants. Sizes run roughly 50 MB to a few hundred MB - tiny by modern diffusion standards, which is one of the nicest things about GANs. Drop the file in:
mkdir -p ComfyUI/models/stylegan
# ...then download the .pkl of your choice into that folder
Restart ComfyUI and it shows up in the dropdown.
Wiring and gotchas
The STYLEGAN output feeds three nodes: Generate StyleGAN Latent (to make a latent from scratch), StyleGAN Sampler (to render one), and StyleGAN Inversion (to project a real image into latent space). Most workflows chain all three.
Two things to keep in mind. First, the model is frozen at its native resolution - FFHQ 512 gives 512×512 out, the StyleGAN3 variants go to 1024. There's no resolution slider, because there isn't one in the model. Second, the first real render triggers a runtime CUDA compile (the bias_act_plugin / upfirdn2d_plugin / filtered_lrelu_plugin builds from the pack's torch_utils/ops folder), which needs the CUDA toolkit, ninja, and a working C++ toolchain. If that build fails - the classic conda GLIBCXX_3.4.32 not found error, for instance - it fails here in spirit even if the crash surfaces in the sampler. The load itself is the cheap part; the compile is the tax. Get one workflow rendering and every subsequent model loads identically.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| stylegan_file | COMBO | 0 options: |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STYLEGAN | STYLEGAN | — |