Warlord-K commited on
Commit
27d53c2
1 Parent(s): 9eec176

Compile model

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,7 +9,7 @@ import gradio as gr
9
  import numpy as np
10
  import PIL.Image
11
  import torch
12
- from diffusers import AutoencoderKL, DiffusionPipeline
13
 
14
  DESCRIPTION = "# Segmind Stable Diffusion"
15
  if not torch.cuda.is_available():
@@ -18,14 +18,14 @@ if not torch.cuda.is_available():
18
  MAX_SEED = np.iinfo(np.int32).max
19
  CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES") == "1"
20
  MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "1024"))
21
- USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "0") == "1"
22
  ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"
23
  ENABLE_REFINER = os.getenv("ENABLE_REFINER", "0") == "1"
24
 
25
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
26
  if torch.cuda.is_available():
27
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
28
- pipe = DiffusionPipeline.from_pretrained(
29
  "segmind/SSD-1B",
30
  vae=vae,
31
  torch_dtype=torch.float16,
 
9
  import numpy as np
10
  import PIL.Image
11
  import torch
12
+ from diffusers import AutoencoderKL, StableDiffusionXLPipeline
13
 
14
  DESCRIPTION = "# Segmind Stable Diffusion"
15
  if not torch.cuda.is_available():
 
18
  MAX_SEED = np.iinfo(np.int32).max
19
  CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES") == "1"
20
  MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "1024"))
21
+ USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "1") == "1"
22
  ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"
23
  ENABLE_REFINER = os.getenv("ENABLE_REFINER", "0") == "1"
24
 
25
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
26
  if torch.cuda.is_available():
27
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
28
+ pipe = StableDiffusionXLPipeline.from_pretrained(
29
  "segmind/SSD-1B",
30
  vae=vae,
31
  torch_dtype=torch.float16,