Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -127,7 +127,6 @@ def scheduler_swap_callback(pipeline, step_index, timestep, callback_kwargs):
|
|
127 |
return {"latents": callback_kwargs["latents"]}
|
128 |
|
129 |
def load_and_prepare_model():
|
130 |
-
sched = EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1) #,use_karras_sigmas=True)
|
131 |
vaeXL = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", safety_checker=None, use_safetensors=False).to(torch.bfloat16) #.to(device=device, dtype=torch.bfloat16)
|
132 |
#vaeRV = AutoencoderKL.from_pretrained("SG161222/RealVisXL_V5.0", subfolder='vae', safety_checker=None, use_safetensors=False).to(device).to(torch.bfloat16) #.to(device=device, dtype=torch.bfloat16)
|
133 |
#sched = EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear")
|
@@ -140,14 +139,15 @@ def load_and_prepare_model():
|
|
140 |
token = HF_TOKEN,
|
141 |
# scheduler = sched,
|
142 |
)
|
|
|
143 |
pipe.vae = vaeXL #.to(torch.bfloat16)
|
144 |
pipe.scheduler = sched
|
145 |
#pipe.vae.do_resize=False
|
146 |
#pipe.vae.vae_scale_factor=8
|
147 |
-
|
148 |
-
pipe.to(device)
|
149 |
-
pipe.to(torch.bfloat16)
|
150 |
pipe.vae.set_default_attn_processor()
|
|
|
|
|
151 |
print(f'init noise scale: {pipe.scheduler.init_noise_sigma}')
|
152 |
pipe.watermark=None
|
153 |
pipe.safety_checker=None
|
|
|
127 |
return {"latents": callback_kwargs["latents"]}
|
128 |
|
129 |
def load_and_prepare_model():
|
|
|
130 |
vaeXL = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", safety_checker=None, use_safetensors=False).to(torch.bfloat16) #.to(device=device, dtype=torch.bfloat16)
|
131 |
#vaeRV = AutoencoderKL.from_pretrained("SG161222/RealVisXL_V5.0", subfolder='vae', safety_checker=None, use_safetensors=False).to(device).to(torch.bfloat16) #.to(device=device, dtype=torch.bfloat16)
|
132 |
#sched = EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear")
|
|
|
139 |
token = HF_TOKEN,
|
140 |
# scheduler = sched,
|
141 |
)
|
142 |
+
sched = EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1) #,use_karras_sigmas=True)
|
143 |
pipe.vae = vaeXL #.to(torch.bfloat16)
|
144 |
pipe.scheduler = sched
|
145 |
#pipe.vae.do_resize=False
|
146 |
#pipe.vae.vae_scale_factor=8
|
147 |
+
pipe.to(device=device, dtype=torch.bfloat16)
|
|
|
|
|
148 |
pipe.vae.set_default_attn_processor()
|
149 |
+
#pipe.to(device)
|
150 |
+
#pipe.to(torch.bfloat16)
|
151 |
print(f'init noise scale: {pipe.scheduler.init_noise_sigma}')
|
152 |
pipe.watermark=None
|
153 |
pipe.safety_checker=None
|