Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -106,7 +106,7 @@ def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str
|
|
106 |
def load_and_prepare_model(model_id):
|
107 |
model_dtypes = {"ford442/RealVisXL_V5.0_BF16": torch.bfloat16,}
|
108 |
dtype = model_dtypes.get(model_id, torch.bfloat16) # Default to float32 if not found
|
109 |
-
|
110 |
#vae = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae",safety_checker=None)
|
111 |
# vae = AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE/MyBack_SDXL_Juggernaut_XL_VAE_V10(version_X).safetensors",safety_checker=None).to(torch.bfloat16)
|
112 |
# vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
|
@@ -128,15 +128,16 @@ def load_and_prepare_model(model_id):
|
|
128 |
)
|
129 |
#pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
130 |
#pipe.to('cuda')
|
131 |
-
|
132 |
#pipe.vae=pipeX.vae
|
133 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
134 |
#pipe.to(dtype=torch.bfloat16)
|
135 |
#pipe.unet = pipeX.unet
|
136 |
pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
137 |
#pipe.unet.to(torch.bfloat16)
|
138 |
-
pipe.to(torch.bfloat16)
|
139 |
pipe.to(device)
|
|
|
|
|
140 |
#pipe.to(torch.device("cuda:0"))
|
141 |
#pipe.vae.to(torch.bfloat16)
|
142 |
#pipe.to(device, torch.bfloat16)
|
|
|
106 |
def load_and_prepare_model(model_id):
|
107 |
model_dtypes = {"ford442/RealVisXL_V5.0_BF16": torch.bfloat16,}
|
108 |
dtype = model_dtypes.get(model_id, torch.bfloat16) # Default to float32 if not found
|
109 |
+
vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", torch_dtype=torch.bfloat16,safety_checker=None)
|
110 |
#vae = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae",safety_checker=None)
|
111 |
# vae = AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE/MyBack_SDXL_Juggernaut_XL_VAE_V10(version_X).safetensors",safety_checker=None).to(torch.bfloat16)
|
112 |
# vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
|
|
|
128 |
)
|
129 |
#pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
130 |
#pipe.to('cuda')
|
131 |
+
pipe.vae=vae
|
132 |
#pipe.vae=pipeX.vae
|
133 |
# pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
134 |
#pipe.to(dtype=torch.bfloat16)
|
135 |
#pipe.unet = pipeX.unet
|
136 |
pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1)
|
137 |
#pipe.unet.to(torch.bfloat16)
|
|
|
138 |
pipe.to(device)
|
139 |
+
pipe.to(torch.bfloat16)
|
140 |
+
|
141 |
#pipe.to(torch.device("cuda:0"))
|
142 |
#pipe.vae.to(torch.bfloat16)
|
143 |
#pipe.to(device, torch.bfloat16)
|