AbstractPhil commited on
Commit
ed1a9f7
·
verified ·
1 Parent(s): b20f699

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1353,9 +1353,10 @@ def load_sdxl_base(device: str = "cuda"):
1353
  torch_dtype=torch.float16
1354
  ).to(device)
1355
 
 
 
1356
  vae = AutoencoderKL.from_pretrained(
1357
- "stabilityai/stable-diffusion-xl-base-1.0",
1358
- subfolder="vae",
1359
  torch_dtype=torch.float16
1360
  ).to(device)
1361
 
@@ -1772,7 +1773,7 @@ def create_demo():
1772
 
1773
  lyra_checkpoint = gr.Textbox(
1774
  label="Lyra VAE Checkpoint (optional)",
1775
- value="weights/lyra_illustrious_step_41000.safetensors",
1776
  placeholder="e.g., lyra_e100_s50000.safetensors",
1777
  info="Leave empty for latest. Loaded from weights/ folder in Lyra repo."
1778
  )
 
1353
  torch_dtype=torch.float16
1354
  ).to(device)
1355
 
1356
+ # Use fp16-fix VAE to avoid NaN issues with SDXL's original VAE in fp16
1357
+ print(" Using madebyollin/sdxl-vae-fp16-fix for stable fp16 decoding...")
1358
  vae = AutoencoderKL.from_pretrained(
1359
+ "madebyollin/sdxl-vae-fp16-fix",
 
1360
  torch_dtype=torch.float16
1361
  ).to(device)
1362
 
 
1773
 
1774
  lyra_checkpoint = gr.Textbox(
1775
  label="Lyra VAE Checkpoint (optional)",
1776
+ value="",
1777
  placeholder="e.g., lyra_e100_s50000.safetensors",
1778
  info="Leave empty for latest. Loaded from weights/ folder in Lyra repo."
1779
  )