Mode.BILINEAR),
        transforms.CenterCrop(args.resolution),
        transforms.ToTensor(),
    ]
) Within the main() function, you’ll find the code for loading the tokenizer, text encoder, scheduler and models. This is also where the ControlNet model is loaded either from existing weights or randomly initialized from a UNet:   Copied if args.controlnet_model_name_or_path:
    logger.info("Loading existing controlnet weights")
    controlnet