Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -117,16 +117,17 @@ def load_and_prepare_model(model_id):
|
|
117 |
add_watermarker=False,
|
118 |
use_safetensors=True,
|
119 |
# 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),
|
120 |
-
vae=AutoencoderKL.from_pretrained("stabilityai/sdxl-vae",repo_type='model',safety_checker=None).to(torch.bfloat16),
|
121 |
#scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset =1)
|
122 |
)
|
123 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
124 |
#pipe.to('cuda')
|
125 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
126 |
|
127 |
-
pipe.unet = pipeX.unet.to(torch.bfloat16)
|
128 |
#pipe.to(dtype=torch.bfloat16)
|
129 |
pipe.to(device)
|
|
|
|
|
130 |
#pipe.to(torch.bfloat16)
|
131 |
#pipe.to(device, torch.bfloat16)
|
132 |
del pipeX
|
|
|
117 |
add_watermarker=False,
|
118 |
use_safetensors=True,
|
119 |
# 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),
|
120 |
+
vae=AutoencoderKL.from_pretrained("stabilityai/sdxl-vae",torch_dtype=torch.float32,repo_type='model',safety_checker=None).to(torch.bfloat16),
|
121 |
#scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset =1)
|
122 |
)
|
123 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
124 |
#pipe.to('cuda')
|
125 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
126 |
|
|
|
127 |
#pipe.to(dtype=torch.bfloat16)
|
128 |
pipe.to(device)
|
129 |
+
pipe.unet = pipeX.unet.to(torch.bfloat16)
|
130 |
+
|
131 |
#pipe.to(torch.bfloat16)
|
132 |
#pipe.to(device, torch.bfloat16)
|
133 |
del pipeX
|