ford442 commited on
Commit
54f2cac
·
1 Parent(s): 758ffa0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -115,15 +115,15 @@ def load_and_prepare_model(model_id):
115
  dtype = model_dtypes.get(model_id, torch.bfloat16) # Default to float32 if not found
116
  # vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", torch_dtype=torch.bfloat16,safety_checker=None)
117
  vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None)
118
- sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
119
  pipe = StableDiffusionXLPipeline.from_pretrained(
120
  model_id,
121
  # torch_dtype=torch.bfloat16,
122
  add_watermarker=False,
123
  use_safetensors=True,
124
  vae=vae,
125
- scheduler=sched
126
- ).to('cuda')
 
127
  #pipe.to(device=device, dtype=torch.bfloat16)
128
 
129
  #sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", algorithm_type="dpmsolver++")
 
115
  dtype = model_dtypes.get(model_id, torch.bfloat16) # Default to float32 if not found
116
  # vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", torch_dtype=torch.bfloat16,safety_checker=None)
117
  vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None)
 
118
  pipe = StableDiffusionXLPipeline.from_pretrained(
119
  model_id,
120
  # torch_dtype=torch.bfloat16,
121
  add_watermarker=False,
122
  use_safetensors=True,
123
  vae=vae,
124
+ )
125
+ pipe.scheduler=EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
126
+ pipe.to('cuda')
127
  #pipe.to(device=device, dtype=torch.bfloat16)
128
 
129
  #sched = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config, beta_schedule="scaled_linear", algorithm_type="dpmsolver++")