oraConfig(
    r=args.rank,
    lora_alpha=args.rank,
    init_lora_weights="gaussian",
    target_modules=["to_k", "to_q", "to_v", "to_out.0"],
)

unet.add_adapter(unet_lora_config)
lora_layers = filter(lambda p: p.requires_grad, unet.parameters())  The optimizer is initialized with the lora_layers because these are the only weights that’ll be optimized:   Copied optimizer = optimizer_cls(
    lora_layers,
    lr=args.learning_rate,
    betas=