Upload modelos.py
Browse files- modelos.py +109 -0
modelos.py
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from IPython.display import display, HTML, clear_output
|
| 2 |
+
from ipywidgets import widgets, Layout
|
| 3 |
+
import os
|
| 4 |
+
from nenen88 import download, say, tempe
|
| 5 |
+
|
| 6 |
+
bura = "/home/studio-lab-user/forge/asd/cn-1_5.css"
|
| 7 |
+
with open(bura, "r") as oppai:
|
| 8 |
+
susu = oppai.read()
|
| 9 |
+
display(HTML(f"<style>{susu}</style>"))
|
| 10 |
+
|
| 11 |
+
url_list = {
|
| 12 |
+
"CyberrealisticLCM": [
|
| 13 |
+
"https://huggingface.co/Carlos2312/models/resolve/main/cyberrealisticLCM_cyberrealistic33.safetensors cyberrealisticLCM_cyberrealistic33.safetensors"],
|
| 14 |
+
"Marduk191sPseudoModern_v10_XL": [
|
| 15 |
+
"https://huggingface.co/Carlos2312/models/resolve/main/marduk191sPseudoModern_v10.safetensors marduk191sPseudoModern_v10.safetensors"],
|
| 16 |
+
"PicxReal_10": [
|
| 17 |
+
"https://huggingface.co/Carlos2312/models/resolve/main/picxReal_10.safetensors picxReal_10.safetensors"],
|
| 18 |
+
"PicxReal_10Lcm": [
|
| 19 |
+
"https://huggingface.co/Carlos2312/models/resolve/main/picxReal_10Lcm.safetensors picxReal_10Lcm.safetensors"],
|
| 20 |
+
"RealDream_turboLCM4": [
|
| 21 |
+
"https://huggingface.co/Carlos2312/models/resolve/main/realDream_turboLCM4.safetensors realDream_turboLCM4.safetensors"],
|
| 22 |
+
"RealismBYSTABLEYOGI_v4LCM": [
|
| 23 |
+
"https://huggingface.co/Carlos2312/models/resolve/main/realismBYSTABLEYOGI_v4LCM.safetensors realismBYSTABLEYOGI_v4LCM.safetensors"],
|
| 24 |
+
"JuggernautXL_v9Rdphoto2Lightning": [
|
| 25 |
+
"https://huggingface.co/Carlos2312/models/resolve/main/juggernautXL_v9Rdphoto2Lightning.safetensors juggernautXL_v9Rdphoto2Lightning.safetensors.safetensors"],
|
| 26 |
+
"SourceOfTheGoddess_003LCM": [
|
| 27 |
+
"https://huggingface.co/Carlos2312/models/resolve/main/sourceOfTheGoddess_003LCM.safetensors sourceOfTheGoddess_003LCM.safetensors"],
|
| 28 |
+
"Meinapastel_v6Pastel": [
|
| 29 |
+
"https://huggingface.co/Carlos2312/models/resolve/main/meinapastel_v6Pastel.safetensors meinapastel_v6Pastel.safetensors"]
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
list_half = len(url_list) // 2
|
| 33 |
+
half_list_1 = dict(list(url_list.items())[:list_half])
|
| 34 |
+
half_list_2 = dict(list(url_list.items())[list_half:])
|
| 35 |
+
|
| 36 |
+
cb1 = widgets.VBox(
|
| 37 |
+
[widgets.Checkbox(value=False, description=name, style={'description_width': '0px'})
|
| 38 |
+
for name in half_list_1])
|
| 39 |
+
cb1.add_class("checkbox-group1")
|
| 40 |
+
|
| 41 |
+
cb2 = widgets.VBox(
|
| 42 |
+
[widgets.Checkbox(value=False, description=name, style={'description_width': '0px'})
|
| 43 |
+
for name in half_list_2])
|
| 44 |
+
cb2.add_class("checkbox-group2")
|
| 45 |
+
|
| 46 |
+
db = widgets.Button(description="Download")
|
| 47 |
+
db.add_class("download-button")
|
| 48 |
+
dbo = widgets.Output()
|
| 49 |
+
cbc = widgets.HBox([cb1, cb2], layout=widgets.Layout(align_items='flex-start'))
|
| 50 |
+
|
| 51 |
+
gariz3 = """<div class="gradient-cn2">forge</div>"""
|
| 52 |
+
garis3 = widgets.Output()
|
| 53 |
+
|
| 54 |
+
def sa_cb(b):
|
| 55 |
+
for checkbox in cb1.children + cb2.children:
|
| 56 |
+
checkbox.value = True
|
| 57 |
+
|
| 58 |
+
def usa_cb(b):
|
| 59 |
+
for checkbox in cb1.children + cb2.children:
|
| 60 |
+
checkbox.value = False
|
| 61 |
+
|
| 62 |
+
sab = widgets.Button(description="Select All")
|
| 63 |
+
sab.add_class("select-all-button")
|
| 64 |
+
sab.on_click(sa_cb)
|
| 65 |
+
|
| 66 |
+
usab = widgets.Button(description="Unselect All")
|
| 67 |
+
usab.add_class("unselect-all-button")
|
| 68 |
+
usab.on_click(usa_cb)
|
| 69 |
+
|
| 70 |
+
bs = widgets.Button(description="")
|
| 71 |
+
bs.add_class("border-style")
|
| 72 |
+
|
| 73 |
+
bl = widgets.HBox([sab, usab, db, bs])
|
| 74 |
+
boks2 = widgets.VBox([bl, cbc], layout=Layout(
|
| 75 |
+
display='flex',
|
| 76 |
+
flex_flow='column',
|
| 77 |
+
width='630px',
|
| 78 |
+
height='455px',
|
| 79 |
+
align_items='center',
|
| 80 |
+
padding='10px'))
|
| 81 |
+
boks2.add_class("boks2")
|
| 82 |
+
|
| 83 |
+
def d_b_click(b):
|
| 84 |
+
surl = []
|
| 85 |
+
for checkbox, key in zip(cb1.children + cb2.children, list(url_list.keys())):
|
| 86 |
+
if checkbox.value:
|
| 87 |
+
surl.extend(url_list[key])
|
| 88 |
+
|
| 89 |
+
widgets.Widget.close(boks2)
|
| 90 |
+
dbo.clear_output()
|
| 91 |
+
|
| 92 |
+
with garis3:
|
| 93 |
+
display(HTML(gariz3))
|
| 94 |
+
|
| 95 |
+
with dbo:
|
| 96 |
+
say("【{red} Downloading{cyan} Controlnet{magenta} Models{yellow} 】{red}")
|
| 97 |
+
os.chdir("/home/studio-lab-user/forge/models/ControlNet")
|
| 98 |
+
|
| 99 |
+
for url in surl:
|
| 100 |
+
download(url)
|
| 101 |
+
|
| 102 |
+
with garis3:
|
| 103 |
+
garis3.clear_output()
|
| 104 |
+
|
| 105 |
+
say("【{red} Done{d} 】{red}")
|
| 106 |
+
|
| 107 |
+
tempe()
|
| 108 |
+
display(boks2, dbo, garis3)
|
| 109 |
+
db.on_click(d_b_click)
|