Skip to content
Back to skills

Stylegan2 Pytorch

ASecurity

"Guides StyleGAN2 PyTorch image GAN training, checkpoint

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
developmentpythonbashapibackend

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 17 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill stylegan2-pytorch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Stylegan2 Pytorch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Stylegan2 Pytorch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-stylegan2-pytorch/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-stylegan2-pytorch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: stylegan2-pytorch
description: "Guides StyleGAN2 PyTorch image GAN training, checkpoint
  generation, interpolation, and programmatic sampling with the
  stylegan2_pytorch package."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# StyleGAN2 PyTorch Repo Skill

Use this repo skill when a task involves the `stylegan2_pytorch` package, the
`stylegan2_pytorch` command, or StyleGAN2-style image GAN training/sampling in
this implementation. The package is CUDA-first: importing the main module
asserts that `torch.cuda.is_available()` is true, so do not plan CPU-only use.

## Fast routing

- Use [training](sub-skills/training/SKILL.md) for command-line training from an
  image folder, checkpoint resume/restart decisions, sample generation,
  interpolation GIFs, low-data augmentation, FID/logging options, transparent
  images, attention/vector-quantization knobs, and multi-GPU settings.
- Use [programmatic-api](sub-skills/programmatic-api/SKILL.md) when the user
  wants Python code with `ModelLoader`, `Trainer`, or `StyleGAN2`, especially
  loading a trained checkpoint and saving generated images from tensors.
- Read [references/troubleshooting.md](references/troubleshooting.md) when an
  install, import, CUDA, optional dependency, CLI parsing, checkpoint, or
  package-version failure blocks either workflow.
- Read [references/repo-provenance.md](references/repo-provenance.md) before
  deciding whether this skill is stale for a checkout or should be refreshed.

## Package facts to keep in mind

- Distribution name and import name: `stylegan2_pytorch`.
- Console command: `stylegan2_pytorch`.
- Public exports from the package root: `Trainer`, `StyleGAN2`, `ModelLoader`,
  and `NanException`.
- The core CLI is implemented with Python Fire around `train_from_folder`, so
  Fire help displays underscore flag names even though the README commonly shows
  hyphenated flag names.
- Training inputs are recursive image folders containing `.jpg`, `.jpeg`, or
  `.png` files.
- Default outputs are `results/<name>/` for generated images and
  `models/<name>/model_<n>.pt` plus `models/<name>/.config.json` for checkpoints
  and model settings.

## Install and environment check

The documented public install path is:

```bash
pip install stylegan2_pytorch
```

For a local clone, an editable install is useful while developing or verifying
against that checkout:

```bash
pip install -e .
```

Use a CUDA-capable PyTorch/torchvision build before relying on the package. The
main module imports `aim`, `einops`, `kornia`, `vector_quantize_pytorch`,
`torch`, `torchvision`, and other setup dependencies at import time.

After installing, run the bundled checker from this skill directory if the user
has an environment ready:

```bash
python scripts/check_install.py
```

It performs only import, CUDA, signature, and CLI-help checks; it does not train
or download data.

## Workflow starting points

1. For a new training run, open [training](sub-skills/training/SKILL.md), then
   use its data-layout and CLI references to choose `--data`, `--name`, image
   size, batch/accumulation, output directories, and augmentation settings.
2. For generation after a run, keep the same `--name`, `--models_dir`, and
   `--results_dir` layout and use the training generation/interpolation routes.
3. For Python sampling, open
   [programmatic-api](sub-skills/programmatic-api/SKILL.md); `ModelLoader`
   expects the default `base_dir/models/<name>/` checkpoint layout.
4. If the request is about another image-generation stack such as Diffusers,
   ComfyUI, Stable Diffusion LoRA training, image classification, detection, or
   segmentation, this skill is probably not the right operating graph.

## Verification status

This skill was constructed with a CUDA backend inspection environment and a
post-integration plan for CLI help, one-step training, and `ModelLoader`
sampling checks. The user requested **not to import** the skill into the managed
repo-skill library, so use the generated directory directly unless a later
request authorizes import.

Files in this skill

  • SKILL.md4 KB
  • references/repo-provenance.md1.8 KB
  • references/repo-routing-metadata.json337 B
  • references/troubleshooting.md4.1 KB
  • scripts/check_install.py5.6 KB
  • sub-skills/programmatic-api/SKILL.md2.9 KB
  • sub-skills/programmatic-api/references/api-reference.md4 KB
  • sub-skills/programmatic-api/references/troubleshooting.md2.9 KB
  • sub-skills/programmatic-api/references/workflows.md3.2 KB
  • sub-skills/programmatic-api/scripts/sample_from_checkpoint.py4.6 KB
  • sub-skills/training/SKILL.md3.7 KB
  • sub-skills/training/references/cli-reference.md5.4 KB
  • sub-skills/training/references/data-layout.md3.1 KB
  • sub-skills/training/references/troubleshooting.md4.5 KB
  • sub-skills/training/references/workflows.md6.2 KB
  • sub-skills/training/scripts/make_tiny_fixture.py3.2 KB
  • sub-skills/training/scripts/train_smoke.py5.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.