executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
programmatic-apiGuides Python ModelLoader, Trainer, and StyleGAN2 API usage for loading stylegan2_pytorch checkpoints and generating image tensors.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the user wants Python code instead of the
stylegan2_pytorch CLI, especially for loading a trained checkpoint with
ModelLoader, converting latent noise to styles, generating image tensors, and
saving samples.
../../scripts/check_install.py. The
package requires CUDA at import time.ModelLoader, Trainer, and checkpoint files relate.base_dir is wrong, tensor shapes/devices are wrong,
or a package-version mismatch prevents loading.ModelLoader(base_dir=..., name=...)
with the directory where the CLI was invoked, assuming the default
models/<name>/ layout exists.load_from=<checkpoint_number> to
ModelLoader.512, call noise_to_styles, then call styles_to_images.torchvision.utils.save_image; outputs are
clamped to [0, 1] by styles_to_images.--models_dir,
either restore the default base_dir/models/<name>/ layout for ModelLoader
or use Trainer directly with matching models_dir.scripts/sample_from_checkpoint.py adapts
the README ModelLoader snippet into a reusable checker that loads a checkpoint
from the default layout and writes a sample grid. Run it only after a checkpoint
exists:
python sub-skills/programmatic-api/scripts/sample_from_checkpoint.py \
--base-dir /path/to/run-base \
--name my-project \
--output-dir /tmp/sg2-samples
ModelLoader.noise_to_styles and
styles_to_images move data to CUDA and the package import already requires
CUDA.