diffusion_models.cli ==================== .. py:module:: diffusion_models.cli .. autoapi-nested-parse:: The ``diffusion-models`` command line interface. Hydra does the heavy lifting for training and inference, so everything after the sub-command is forwarded to it untouched:: diffusion-models train +config=small_attention_ema training.batch_size=64 diffusion-models train --help # hydra's own help, listing the config groups diffusion-models infer checkpoint= +config=small_attention_ema Module Contents --------------- .. py:function:: main() Tools for training and running diffusion models. .. py:function:: train(config_directories, overrides) Train a diffusion model. OVERRIDES are hydra overrides and flags, e.g. `+config=small_attention_ema`, `training.batch_size=64`, `resume_from=` or `--multirun`. Pass `--help` to list the available config groups. .. py:function:: infer(config_directories, overrides) Generate images with a trained checkpoint. OVERRIDES are hydra overrides: `checkpoint=` is required and the model config should match the training run, e.g. `+config=small_attention_ema`. Other options: `number_of_images=25`, `save_gif=true`, `steps=50`, `use_ema=false`, `device=cpu`. Pass `--help` to list the config groups. .. py:function:: fid(checkpoint, samples, batch_size, steps, device, ema, kid, seed) Compute FID (and KID) of a training CHECKPOINT. Needs the `evaluation` and `training` dependency groups. Only compare scores that use the same number of samples.