ford442 commited on
Commit
7f00a62
·
verified ·
1 Parent(s): 0dd9f73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -80,7 +80,7 @@ HF_TOKEN = os.getenv("HF_TOKEN")
80
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
81
 
82
  def load_and_prepare_model():
83
- vaeXL = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", safety_checker=None, use_safetensors=False).to(device=device, dtype=torch.bfloat16)
84
  sched = EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1,use_karras_sigmas=True)
85
  pipe = StableDiffusionXLPipeline.from_pretrained(
86
  'ford442/RealVisXL_V5.0_BF16',
@@ -91,7 +91,9 @@ def load_and_prepare_model():
91
  pipe.scheduler = sched
92
  pipe.vae.do_resize=False
93
  pipe.vae.vae_scale_factor=8
94
- pipe.to(device=device, dtype=torch.bfloat16)
 
 
95
  pipe.vae.set_default_attn_processor()
96
  print(f'init noise scale: {pipe.scheduler.init_noise_sigma}')
97
  pipe.watermark=None
@@ -143,11 +145,8 @@ def uploadNote(prompt,num_inference_steps,guidance_scale,timestamp):
143
  f.write(f"SPACE SETUP: \n")
144
  f.write(f"Use Model Dtype: no \n")
145
  f.write(f"Model Scheduler: Euler_a all_custom before cuda \n")
146
- f.write(f"Model VAE: sdxl-vae-bf16 before cuda then attn_proc / scale factor 8 \n")
147
- f.write(f"Model UNET: sexy_beauty model \n")
148
- f.write(f"Model HiDiffusion OFF \n")
149
- f.write(f"Model do_resize ON \n")
150
- f.write(f"added torch to prereq and changed accellerate \n")
151
  upload_to_ftp(filename)
152
 
153
  @spaces.GPU(duration=30)
 
80
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
81
 
82
  def load_and_prepare_model():
83
+ vaeXL = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", safety_checker=None, use_safetensors=False).to(device).to(torch.bfloat16) #.to(device=device, dtype=torch.bfloat16)
84
  sched = EulerAncestralDiscreteScheduler.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='scheduler',beta_schedule="scaled_linear", beta_start=0.00085, beta_end=0.012, steps_offset=1,use_karras_sigmas=True)
85
  pipe = StableDiffusionXLPipeline.from_pretrained(
86
  'ford442/RealVisXL_V5.0_BF16',
 
91
  pipe.scheduler = sched
92
  pipe.vae.do_resize=False
93
  pipe.vae.vae_scale_factor=8
94
+ #pipe.to(device=device, dtype=torch.bfloat16)
95
+ pipe.to(device)
96
+ pipe.to(torch.bfloat16)
97
  pipe.vae.set_default_attn_processor()
98
  print(f'init noise scale: {pipe.scheduler.init_noise_sigma}')
99
  pipe.watermark=None
 
145
  f.write(f"SPACE SETUP: \n")
146
  f.write(f"Use Model Dtype: no \n")
147
  f.write(f"Model Scheduler: Euler_a all_custom before cuda \n")
148
+ f.write(f"Model VAE: sdxl-vae \n")
149
+ f.write(f"To cuda then to bfloat \n")
 
 
 
150
  upload_to_ftp(filename)
151
 
152
  @spaces.GPU(duration=30)