ford442 commited on
Commit
598f31a
·
1 Parent(s): 89403fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -107,7 +107,6 @@ def load_and_prepare_model(model_id):
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
- sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start =0.00085,beta_end =0.012,steps_offset =1,)
111
 
112
  # vae = AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE/MyBack_SDXL_Juggernaut_XL_VAE_V10(version_X).safetensors", torch_dtype=torch.float32,safety_checker=None).to(torch.bfloat16)
113
  # vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
@@ -118,13 +117,15 @@ def load_and_prepare_model(model_id):
118
  use_safetensors=True,
119
  vae=vae,
120
  scheduler=sched
121
- ).to('cuda')
 
 
 
122
  # pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
123
  #pipe.to(device=device, dtype=torch.bfloat16)
124
  #sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", algorithm_type="dpmsolver++")
125
  #sched = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, beta_schedule="linear", algorithm_type="dpmsolver++")
126
  #sched = DDIMScheduler.from_config(pipe.scheduler.config)
127
- #pipe.scheduler=sched
128
  return pipe
129
 
130
  # Preload and compile both models
 
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
 
111
  # vae = AutoencoderKL.from_pretrained("BeastHF/MyBack_SDXL_Juggernaut_XL_VAE/MyBack_SDXL_Juggernaut_XL_VAE_V10(version_X).safetensors", torch_dtype=torch.float32,safety_checker=None).to(torch.bfloat16)
112
  # vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
 
117
  use_safetensors=True,
118
  vae=vae,
119
  scheduler=sched
120
+ )
121
+ sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", beta_start =0.00085,beta_end =0.012,steps_offset =1,)
122
+ pipe.scheduler=sched
123
+ pipe.to('cuda')
124
  # pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
125
  #pipe.to(device=device, dtype=torch.bfloat16)
126
  #sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", algorithm_type="dpmsolver++")
127
  #sched = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, beta_schedule="linear", algorithm_type="dpmsolver++")
128
  #sched = DDIMScheduler.from_config(pipe.scheduler.config)
 
129
  return pipe
130
 
131
  # Preload and compile both models