Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,6 +24,7 @@ import paramiko
|
|
| 24 |
import gc
|
| 25 |
import time
|
| 26 |
import datetime
|
|
|
|
| 27 |
#os.system("chmod +x ./cusparselt.sh")
|
| 28 |
#os.system("./cusparselt.sh")
|
| 29 |
#os.system("chmod +x ./cudnn.sh")
|
|
@@ -96,6 +97,7 @@ DEFAULT_STYLE_NAME = "Style Zero"
|
|
| 96 |
STYLE_NAMES = list(styles.keys())
|
| 97 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 98 |
|
|
|
|
| 99 |
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
| 100 |
if style_name in styles:
|
| 101 |
p, n = styles.get(style_name, styles[DEFAULT_STYLE_NAME])
|
|
@@ -135,9 +137,9 @@ def load_and_prepare_model(model_id):
|
|
| 135 |
# vae=AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE/MyBack_SDXL_Juggernaut_XL_VAE_V10(version_X).safetensors",repo_type='model',safety_checker=None),
|
| 136 |
# vae=AutoencoderKL.from_pretrained("stabilityai/sdxl-vae",repo_type='model',safety_checker=None, torch_dtype=torch.float32),
|
| 137 |
# vae=AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16",repo_type='model',safety_checker=None),
|
| 138 |
-
vae=vae,
|
| 139 |
-
unet=pipeX.unet,
|
| 140 |
-
scheduler = sched,
|
| 141 |
# scheduler = EulerAncestralDiscreteScheduler.from_config(pipeX.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
| 142 |
#scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset =1)
|
| 143 |
)
|
|
@@ -145,8 +147,9 @@ def load_and_prepare_model(model_id):
|
|
| 145 |
#pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
| 146 |
#pipe.to('cuda')
|
| 147 |
|
| 148 |
-
|
| 149 |
-
|
|
|
|
| 150 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 151 |
#pipe.to(dtype=torch.bfloat16)
|
| 152 |
#pipe.unet = pipeX.unet
|
|
|
|
| 24 |
import gc
|
| 25 |
import time
|
| 26 |
import datetime
|
| 27 |
+
|
| 28 |
#os.system("chmod +x ./cusparselt.sh")
|
| 29 |
#os.system("./cusparselt.sh")
|
| 30 |
#os.system("chmod +x ./cudnn.sh")
|
|
|
|
| 97 |
STYLE_NAMES = list(styles.keys())
|
| 98 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 99 |
|
| 100 |
+
|
| 101 |
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
| 102 |
if style_name in styles:
|
| 103 |
p, n = styles.get(style_name, styles[DEFAULT_STYLE_NAME])
|
|
|
|
| 137 |
# vae=AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE/MyBack_SDXL_Juggernaut_XL_VAE_V10(version_X).safetensors",repo_type='model',safety_checker=None),
|
| 138 |
# vae=AutoencoderKL.from_pretrained("stabilityai/sdxl-vae",repo_type='model',safety_checker=None, torch_dtype=torch.float32),
|
| 139 |
# vae=AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16",repo_type='model',safety_checker=None),
|
| 140 |
+
#vae=vae,
|
| 141 |
+
#unet=pipeX.unet,
|
| 142 |
+
#scheduler = sched,
|
| 143 |
# scheduler = EulerAncestralDiscreteScheduler.from_config(pipeX.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
| 144 |
#scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset =1)
|
| 145 |
)
|
|
|
|
| 147 |
#pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
| 148 |
#pipe.to('cuda')
|
| 149 |
|
| 150 |
+
pipe.scheduler = sched
|
| 151 |
+
pipe.vae=vae
|
| 152 |
+
pipe.unet=pipeX.unet
|
| 153 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 154 |
#pipe.to(dtype=torch.bfloat16)
|
| 155 |
#pipe.unet = pipeX.unet
|