How the modular configuration system works
mainThe codebase follows a modular, config-driven philosophy. Instead of extensive subclassing, submodules are built and combined by calling instantiate_from_config() on objects defined in YAML configuration files.
Key components are separated into distinct configuration blocks:
conditioner_config: Defines theGeneralConditioner. It usesemb_models(a list ofAbstractEmbModelobjects) to handle various conditioning inputs (vectors, sequences, spatial). Each embedder specifiesis_trainable,ucg_rate(for classifier-free guidance dropout), and aninput_key(e.g.,txtorcls).network_config: Defines the neural network backbone (formerlyunet_config).loss_config: Configures the loss function andsigma_sampler_configfor standard diffusion training.sampler_config: Defines the numerical solver, number of steps, discretization type, and guidance wrappers (like classifier-free guidance). The sampler is independent of the model.