

def start_end(name,func):
    print(f'------- test {name} start -------')
    func.on_run_button_click('test')
    print(f'------- test {name} finished -------')

if __name__=='__main__':
    from ui import StableDiffusionUI_text_inversion
    from ui.config import config
    from ui.StableDiffusionUI_txt2img import StableDiffusionUI_txt2img
    from ui.StableDiffusionUI_img2img import StableDiffusionUI_img2img
    from ui.SuperResolutionUI import SuperResolutionUI
    

    gui_txt2img = StableDiffusionUI_txt2img(
        **config['txt2img']
    )
    
    gui_img2img = StableDiffusionUI_img2img(
        **config['img2img']
    )
    gui_train_text_inversion = StableDiffusionUI_text_inversion(
        **config['train_text_inversion']
    )

    start_end('txt2img',gui_txt2img)

    start_end('img2img',gui_img2img)

    start_end('txt2img train',gui_train_text_inversion)