KingNish commited on
Commit
c9e95c1
1 Parent(s): 6027158

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,9 +14,10 @@ from diffusers import StableDiffusion3Pipeline, SD3Transformer2DModel, FlowMatch
14
 
15
  device = "cuda" if torch.cuda.is_available() else "cpu"
16
  dtype = torch.float16
 
17
 
18
  repo = "stabilityai/stable-diffusion-3-medium-diffusers"
19
- pipe = StableDiffusion3Pipeline.from_pretrained(repo, torch_dtype=torch.float16).to(device)
20
 
21
  help_text = """
22
  To optimize image results:
@@ -44,7 +45,6 @@ def set_timesteps_patched(self, num_inference_steps: int, device = None):
44
  # Image Editor
45
  edit_file = hf_hub_download(repo_id="stabilityai/cosxl", filename="cosxl_edit.safetensors")
46
  EDMEulerScheduler.set_timesteps = set_timesteps_patched
47
- vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
48
  pipe_edit = StableDiffusionXLInstructPix2PixPipeline.from_single_file(
49
  edit_file, num_in_channels=8, is_cosxl_edit=True, vae=vae, torch_dtype=torch.float16,
50
  )
 
14
 
15
  device = "cuda" if torch.cuda.is_available() else "cpu"
16
  dtype = torch.float16
17
+ vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
18
 
19
  repo = "stabilityai/stable-diffusion-3-medium-diffusers"
20
+ pipe = StableDiffusion3Pipeline.from_pretrained(repo, torch_dtype=torch.float16, vae=vae).to(device)
21
 
22
  help_text = """
23
  To optimize image results:
 
45
  # Image Editor
46
  edit_file = hf_hub_download(repo_id="stabilityai/cosxl", filename="cosxl_edit.safetensors")
47
  EDMEulerScheduler.set_timesteps = set_timesteps_patched
 
48
  pipe_edit = StableDiffusionXLInstructPix2PixPipeline.from_single_file(
49
  edit_file, num_in_channels=8, is_cosxl_edit=True, vae=vae, torch_dtype=torch.float16,
50
  )