from IPython.display import display, HTML, clear_output from ipywidgets import widgets, Layout import os from nenen88 import download, say, tempe bura = "/home/studio-lab-user/forge/asd/cn-1_5.css" bura2 = "/home/studio-lab-user/asd/asd/cn-1_5.css" # Check if the file exists at the first location if os.path.exists(bura): file_path = bura else: file_path = bura2 with open(file_path, "r") as oppai: susu = oppai.read() display(HTML(f"")) url_list = { "PonyRealism_v21Lightning8SVAE (Pony)": [ "https://huggingface.co/Carlos2312/models/resolve/main/ponyRealism_v21Lightning8SVAE.safetensors ponyRealism_v21Lightning8SVAE.safetensors"], "FastPonyMerge_version75 (Pony)": [ "https://huggingface.co/Carlos2312/models/resolve/main/fastPonyMerge_version75.safetensors fastPonyMerge_version75.safetensors"], "PonyRealism_v20VAE (Pony)": [ "https://huggingface.co/Carlos2312/models/resolve/main/ponyRealism_v20VAE.safetensors ponyRealism_v20VAE.safetensors"], "PonyRealism_v21MainVAE (Pony)": [ "https://huggingface.co/Carlos2312/models/resolve/main/ponyRealism_v21MainVAE.safetensors ponyRealism_v21MainVAE.safetensors"], "RealDream_turboLCM7SD15 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/realDream_turboLCM7SD15.safetensors realDream_turboLCM7SD15.safetensors"], "Anithing_v20 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/anithing_v20.safetensors anithing_v20.safetensors"], "RealisticVisionFULLV60B1_v51HyperVAE (1.5 Hyper)": [ "https://huggingface.co/Carlos2312/models/resolve/main/realisticVisionFULLV60B1_v51HyperVAE.safetensors realisticVisionFULLV60B1_v51HyperVAE.safetensors"], "RealisticVisionV60B1_v51HyperVAE (1.5 Hyper)": [ "https://huggingface.co/Carlos2312/models/resolve/main/realisticVisionV60B1_v51HyperVAE.safetensors realisticVisionV60B1_v51HyperVAE.safetensors"], "PornmasterPro_v7 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/pornmasterPro_v7.safetensors pornmasterPro_v7.safetensors"], "Epicphotogasm_ultimateFidelity (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/epicphotogasm_ultimateFidelity.safetensors epicphotogasm_ultimateFidelity.safetensors"], "WildcardxREALNSFWSFW_Hyper (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/wildcardxREALNSFWSFW_Hyper.safetensors wildcardxREALNSFWSFW_Hyper.safetensors"], "Realisian_v60 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/realisian_v60.safetensors realisian_v60.safetensors"], "Moomoofusion_v10 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/moomoofusion_v10.safetensors moomoofusion_v10.safetensors"], "RealDream_14Hyper (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/realDream_14Hyper.safetensors realDream_14Hyper.safetensors"], "WildcardxREALNSFWSFW_nsfwSFW (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/wildcardxREALNSFWSFW_nsfwSFW.safetensors wildcardxREALNSFWSFW_nsfwSFW.safetensors"], "CyberrealisticLCM41 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/cyberrealisticLCM_cyberrealistic41.safetensors cyberrealisticLCM_cyberrealistic41.safetensors"], "Excursion_v10 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/excursion_v10.safetensors excursion_v10.safetensors"], "DamnPonyxlRealistic_damnV10 (Pony)": [ "https://huggingface.co/Carlos2312/models/resolve/main/damnPonyxlRealistic_damnV10.safetensors damnPonyxlRealistic_damnV10.safetensors"], "TheTrualityEngine_trualityENGINEPRO (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/theTrualityEngine_trualityENGINEPRO.safetensors theTrualityEngine_trualityENGINEPRO.safetensors"], "RealDream_14 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/realDream_14.safetensors realDream_14.safetensors"], "MergedAmateursMixed_v10-inpainting (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/mergedAmateursMixed_v10-inpainting.safetensors mergedAmateursMixed_v10-inpainting.safetensors"], "babesBYSTABLEYOGI_v4InstagramEdition (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/babesBYSTABLEYOGI_v4InstagramEdition.safetensors babesBYSTABLEYOGI_v4InstagramEdition.safetensors"], "MajicmixRealistic_v7-inpainting (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/majicmixRealistic_v7-inpainting.safetensors majicmixRealistic_v7-inpainting.safetensors"], "RealisticVisionV60B1_v51VAE-inpainting (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/realisticVisionV60B1_v51VAE-inpainting.safetensors realisticVisionV60B1_v51VAE-inpainting.safetensors"], "Cyberrealistic_v42-inpainting (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/cyberrealistic_v42-inpainting.safetensors cyberrealistic_v42-inpainting.safetensors"], "CyberrealisticLCM42 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/cyberrealisticLCM_cyberrealistic42.safetensors cyberrealisticLCM_cyberrealistic42.safetensors"], "Cyberrealistic_v42 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/cyberrealistic_v42.safetensors cyberrealistic_v42.safetensors"], "Epicphotogasm_lastUnicorn (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/epicphotogasm_lastUnicorn.safetensors epicphotogasm_lastUnicorn.safetensors"], "Epicrealismxl_flashgordon (XL)": [ "https://huggingface.co/Carlos2312/models/resolve/main/epicrealismxl_flashgordon.safetensors epicrealismxl_flashgordon.safetensors"], "JuggernautXL_v9Rdphoto2Lightning (XL)": [ "https://huggingface.co/Carlos2312/models/resolve/main/juggernautXL_v9Rdphoto2Lightning.safetensors juggernautXL_v9Rdphoto2Lightning.safetensors"], "Juggernaut_reborn (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/juggernaut_reborn.safetensors juggernaut_reborn.safetensors"], "lazymixRealAmateur_v40 FP16 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/lazymixRealAmateur_v40.safetensors lazymixRealAmateur_v40.safetensors"], "lazymixRealAmateur_v40 CKPT (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/lazymixRealAmateur_v40.ckpt lazymixRealAmateur_v40.ckpt"], "Marduk191sPseudoModern_v10_XL (XL)": [ "https://huggingface.co/Carlos2312/models/resolve/main/marduk191sPseudoModern_v10.safetensors marduk191sPseudoModern_v10.safetensors"], "Meinapastel_v6Pastel (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/meinapastel_v6Pastel.safetensors meinapastel_v6Pastel.safetensors"], "PicxReal_10 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/picxReal_10.safetensors picxReal_10.safetensors"], "PicxReal_10Lcm (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/picxReal_10Lcm.safetensors picxReal_10Lcm.safetensors"], "RealDream_turboLCM6 (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/realDream_turboLCM6.safetensors realDream_turboLCM6.safetensors"], "RealismBYSTABLEYOGI_v4LCM (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/realismBYSTABLEYOGI_v4LCM.safetensors realismBYSTABLEYOGI_v4LCM.safetensors"], "SourceOfTheGoddess_003LCM (1.5)": [ "https://huggingface.co/Carlos2312/models/resolve/main/sourceOfTheGoddess_003LCM.safetensors sourceOfTheGoddess_003LCM.safetensors"]} # Split the list into thirds list_third = len(url_list) // 3 third_list_1 = dict(list(url_list.items())[:list_third]) third_list_2 = dict(list(url_list.items())[list_third:2*list_third]) third_list_3 = dict(list(url_list.items())[2*list_third:]) cb1 = widgets.VBox( [widgets.Checkbox(value=False, description=name, style={'description_width': '0px'}) for name in third_list_1]) cb1.add_class("checkbox-group1") cb2 = widgets.VBox( [widgets.Checkbox(value=False, description=name, style={'description_width': '0px'}) for name in third_list_2]) cb2.add_class("checkbox-group2") cb3 = widgets.VBox( [widgets.Checkbox(value=False, description=name, style={'description_width': '0px'}) for name in third_list_3]) cb3.add_class("checkbox-group3") db = widgets.Button(description="Download") db.add_class("download-button") dbo = widgets.Output() # Arrange the checkboxes in a grid cbc = widgets.GridBox( [cb1, cb2, cb3], layout=widgets.Layout( width='100%', grid_template_columns="33% 33% 33%", align_items='flex-start' ) ) gariz3 = """
forge
""" garis3 = widgets.Output() def sa_cb(b): for checkbox in cb1.children + cb2.children + cb3.children: checkbox.value = True def usa_cb(b): for checkbox in cb1.children + cb2.children + cb3.children: checkbox.value = False sab = widgets.Button(description="Select All") sab.add_class("select-all-button") sab.on_click(sa_cb) usab = widgets.Button(description="Unselect All") usab.add_class("unselect-all-button") usab.on_click(usa_cb) bs = widgets.Button(description="") bs.add_class("border-style") bl = widgets.HBox([sab, usab, db, bs]) boks2 = widgets.VBox([bl, cbc], layout=Layout( display='flex', flex_flow='column', width='800px', # Ensure the width is enough for three columns height='455px', align_items='center', padding='10px' )) boks2.add_class("boks2") def d_b_click(b): surl = [] for checkbox, key in zip(cb1.children + cb2.children + cb3.children, list(url_list.keys())): if checkbox.value: surl.extend(url_list[key]) widgets.Widget.close(boks2) dbo.clear_output() with garis3: display(HTML(gariz3)) # Define the two directory paths dir_path_1 = "/home/studio-lab-user/forge/models/Stable-diffusion/tmp_ckpt" dir_path_2 = "/home/studio-lab-user/asd/models/Stable-diffusion/tmp_ckpt" # Check if the directory exists at the first location if os.path.exists(dir_path_1): directory_path = dir_path_1 else: directory_path = dir_path_2 # Change the current directory to the selected directory with dbo: say("【{red} Downloading{cyan} Models{magenta} Models{yellow} 】{red}") os.chdir(directory_path) for url in surl: download(url) with garis3: garis3.clear_output() say("【{red} Done{d} 】{red}") tempe() display(boks2, dbo, garis3) db.on_click(d_b_click)