ford442 commited on
Commit
32d9313
·
1 Parent(s): 194bc84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -108,7 +108,7 @@ def load_and_prepare_model(model_id):
108
  model_dtypes = {"ford442/RealVisXL_V5.0_BF16": torch.bfloat16,}
109
  dtype = model_dtypes.get(model_id, torch.bfloat16) # Default to float32 if not found
110
  #vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", torch_dtype=torch.bfloat16,safety_checker=None)
111
- vae = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae",safety_checker=None)
112
  # 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)
113
  # vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
114
  #sched = EulerAncestralDiscreteScheduler.from_config('ford442/Juggernaut-XI-v11-fp32', subfolder='scheduler',beta_schedule="scaled_linear",use_karras_sigmas=True)
@@ -145,7 +145,7 @@ 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.unet.to(torch.bfloat16)
147
  pipe.to(device)
148
- pipe.to(torch.bfloat16)
149
 
150
  #pipe.to(torch.device("cuda:0"))
151
  #pipe.vae.to(torch.bfloat16)
@@ -235,7 +235,7 @@ def generate_30(
235
  f.write(f"SPACE SETUP: \n")
236
  f.write(f"Use Model Dtype: no \n")
237
  f.write(f"Model Scheduler: Euler_a custom before cuda \n")
238
- f.write(f"Model VAE: default \n")
239
  f.write(f"Model UNET: default \n")
240
  upload_to_ftp(filename)
241
  for i in range(0, num_images, BATCH_SIZE):
@@ -301,7 +301,7 @@ def generate_60(
301
  f.write(f"SPACE SETUP: \n")
302
  f.write(f"Use Model Dtype: no \n")
303
  f.write(f"Model Scheduler: Euler_a custom before cuda \n")
304
- f.write(f"Model VAE: default \n")
305
  f.write(f"Model UNET: default \n")
306
  upload_to_ftp(filename)
307
  for i in range(0, num_images, BATCH_SIZE):
@@ -367,7 +367,7 @@ def generate_90(
367
  f.write(f"SPACE SETUP: \n")
368
  f.write(f"Use Model Dtype: no \n")
369
  f.write(f"Model Scheduler: Euler_a custom before cuda \n")
370
- f.write(f"Model VAE: default \n")
371
  f.write(f"Model UNET: default \n")
372
  upload_to_ftp(filename)
373
  for i in range(0, num_images, BATCH_SIZE):
 
108
  model_dtypes = {"ford442/RealVisXL_V5.0_BF16": torch.bfloat16,}
109
  dtype = model_dtypes.get(model_id, torch.bfloat16) # Default to float32 if not found
110
  #vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", torch_dtype=torch.bfloat16,safety_checker=None)
111
+ vae = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae",safety_checker=None).to(torch.bfloat16)
112
  # 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)
113
  # vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
114
  #sched = EulerAncestralDiscreteScheduler.from_config('ford442/Juggernaut-XI-v11-fp32', subfolder='scheduler',beta_schedule="scaled_linear",use_karras_sigmas=True)
 
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.unet.to(torch.bfloat16)
147
  pipe.to(device)
148
+ #pipe.to(torch.bfloat16)
149
 
150
  #pipe.to(torch.device("cuda:0"))
151
  #pipe.vae.to(torch.bfloat16)
 
235
  f.write(f"SPACE SETUP: \n")
236
  f.write(f"Use Model Dtype: no \n")
237
  f.write(f"Model Scheduler: Euler_a custom before cuda \n")
238
+ f.write(f"Model VAE: sdxl_vae to bfloat before cuda \n")
239
  f.write(f"Model UNET: default \n")
240
  upload_to_ftp(filename)
241
  for i in range(0, num_images, BATCH_SIZE):
 
301
  f.write(f"SPACE SETUP: \n")
302
  f.write(f"Use Model Dtype: no \n")
303
  f.write(f"Model Scheduler: Euler_a custom before cuda \n")
304
+ f.write(f"Model VAE: sdxl_vae to bfloat before cuda \n")
305
  f.write(f"Model UNET: default \n")
306
  upload_to_ftp(filename)
307
  for i in range(0, num_images, BATCH_SIZE):
 
367
  f.write(f"SPACE SETUP: \n")
368
  f.write(f"Use Model Dtype: no \n")
369
  f.write(f"Model Scheduler: Euler_a custom before cuda \n")
370
+ f.write(f"Model VAE: sdxl_vae to bfloat before cuda \n")
371
  f.write(f"Model UNET: default \n")
372
  upload_to_ftp(filename)
373
  for i in range(0, num_images, BATCH_SIZE):