ford442 commited on
Commit
9ff9f84
Β·
1 Parent(s): 21f4fe7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -106,13 +106,13 @@ 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("stabilityai/sdxl-vae", torch_dtype=torch.float32,safety_checker=None)
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')
113
  pipe = StableDiffusionXLPipeline.from_pretrained(
114
  model_id,
115
- torch_dtype=torch.bfloat16,
116
  add_watermarker=False,
117
  use_safetensors=True,
118
  vae=vae,
@@ -120,9 +120,9 @@ def load_and_prepare_model(model_id):
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)
 
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)
110
 
111
+ 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)
112
  # vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", safety_checker=None).to('cuda')
113
  pipe = StableDiffusionXLPipeline.from_pretrained(
114
  model_id,
115
+ # torch_dtype=torch.bfloat16,
116
  add_watermarker=False,
117
  use_safetensors=True,
118
  vae=vae,
 
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)