File size: 612 Bytes
b094968
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from modules import script_callbacks
import modules.scripts as scripts
import json

VERSION = 'v1.4.10'

def clean_outdated(EXT_NAME:str):
    with open(scripts.basedir() + '/' + 'ui-config.json', 'r') as json_file:
        configs = json.loads(json_file.read())

    cleaned_configs = {key: value for key, value in configs.items() if EXT_NAME not in key}

    with open(scripts.basedir() + '/' + 'ui-config.json', 'w') as json_file:
        json.dump(cleaned_configs, json_file)

def refresh_sliders():
    clean_outdated('cc.py')
    clean_outdated('cc_hdr.py')

script_callbacks.on_before_ui(refresh_sliders)