ford442 commited on
Commit
728b4ee
Β·
1 Parent(s): 06b376e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -106,17 +106,18 @@ def load_and_prepare_model(model_id):
106
  model_dtypes = {"ford442/RealVisXL_V5.0_BF16": torch.bfloat16,}
107
  dtype = model_dtypes.get(model_id, torch.bfloat16) # Default to float32 if not found
108
  #vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", torch_dtype=torch.bfloat16,safety_checker=None).to('cuda')
 
 
109
  # vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
110
  pipe = StableDiffusionXLPipeline.from_pretrained(
111
  model_id,
112
  torch_dtype=torch.bfloat16,
113
  add_watermarker=False,
114
  use_safetensors=True,
115
- # vae=vae,
116
  ).to('cuda')
117
  # pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
118
  #pipe.to(device=device, dtype=torch.bfloat16)
119
-
120
  #sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", algorithm_type="dpmsolver++")
121
  sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start =0.00085,beta_end =0.012,steps_offset =1,)
122
  #sched = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, beta_schedule="linear", algorithm_type="dpmsolver++")
 
106
  model_dtypes = {"ford442/RealVisXL_V5.0_BF16": torch.bfloat16,}
107
  dtype = model_dtypes.get(model_id, torch.bfloat16) # Default to float32 if not found
108
  #vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", torch_dtype=torch.bfloat16,safety_checker=None).to('cuda')
109
+ vae = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", torch_dtype=torch.float32,safety_checker=None).to(torch.bfloat16)
110
+ # vae = AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE", torch_dtype=torch.float32,safety_checker=None).to(torch.bfloat16)
111
  # vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
112
  pipe = StableDiffusionXLPipeline.from_pretrained(
113
  model_id,
114
  torch_dtype=torch.bfloat16,
115
  add_watermarker=False,
116
  use_safetensors=True,
117
+ vae=vae,
118
  ).to('cuda')
119
  # pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
120
  #pipe.to(device=device, dtype=torch.bfloat16)
 
121
  #sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", algorithm_type="dpmsolver++")
122
  sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start =0.00085,beta_end =0.012,steps_offset =1,)
123
  #sched = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, beta_schedule="linear", algorithm_type="dpmsolver++")