def get_control_mode(control_mode):
    """Get control mode from controlnet code"""
    from scripts import external_code

    control_mode = [external_code.ControlMode.BALANCED, external_code.ControlMode.PROMPT, external_code.ControlMode.CONTROL][control_mode]
    return control_mode
Get control mode from controlnet code
scripts/sdwebui.py