def interactive_lora(
    config,
    context,
    menu_flag=False,
):
    """
    @param menu_flag: Indicates whether this function was called from the main
        interactive CLI menu; _True_ if called from the main menu, _False_ otherwise
    """
    if context == None or context.lcm_text_to_image.pipeline == None:
        print("Diffusion pipeline not initialized, please run a generation task first!")
        return

    print("> 1. Change LoRA weights")
    print("> 2. Load new LoRA model")
    option = user_value(
        int,
        "Enter a LoRA option (1): ",
        1,
    )
    if option not in range(1, 3):
        print("Wrong LoRA option!")
        return

    if option == 1:
        update_weights = []
        active_weights = get_active_lora_weights()
        for lora in active_weights:
            weight = user_value(
                float,
                f"Enter a new LoRA weight for {lora[0]} ({lora[1]}): ",
                lora[1],
            )
            update_weights.append(
                (
                    lora[0],
                    weight,
                )
            )
        if len(update_weights) > 0:
            update_lora_weights(
                context.lcm_text_to_image.pipeline,
                config.lcm_diffusion_setting,
                update_weights,
            )
    elif option == 2:
        # Load a new LoRA
        settings = config.lcm_diffusion_setting
        settings.lora.fuse = False
        settings.lora.enabled = False
        settings.lora.path = input("Enter LoRA model path: ")
        settings.lora.weight = user_value(
            float,
            "Enter a LoRA weight (0.5): ",
            0.5,
        )
        if not path.exists(settings.lora.path):
            print("Invalid LoRA model path!")
            return
        settings.lora.enabled = True
        load_lora_weight(context.lcm_text_to_image.pipeline, settings)

    if menu_flag:
        global _edit_lora_settings
        _edit_lora_settings = False
        option = input("Edit LoRA settings after every generation? (y/N): ")
        if option.upper() == "Y":
            _edit_lora_settings = True

    @param menu_flag: Indicates whether this function was called from the main
        interactive CLI menu; _True_ if called from the main menu, _False_ otherwise
    
src/frontend/cli_interactive.py