cocktailpeanut commited on
Commit
ff83c1d
1 Parent(s): b4146cd
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -37,15 +37,6 @@ device = devicetorch.get(torch)
37
  # "runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, variant="fp16"
38
  # ).to("cuda")
39
 
40
- pipe_sdxl = StableDiffusionXLPipeline.from_pretrained(
41
- "stabilityai/stable-diffusion-xl-base-1.0",
42
- torch_dtype=torch.float16,
43
- variant="fp16",
44
- ).to(device)
45
- pipe_sd15 = StableDiffusionPipeline.from_pretrained(
46
- "runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, variant="fp16"
47
- ).to(device)
48
-
49
  #@spaces.GPU(enable_queue=True)
50
  def generate_image(
51
  prompt,
@@ -57,6 +48,16 @@ def generate_image(
57
  global loaded
58
  checkpoint = checkpoints[ckpt][0].format(mode)
59
  guidance_scale = checkpoints[ckpt][2]
 
 
 
 
 
 
 
 
 
 
60
  pipe = pipe_sdxl if mode == "sdxl" else pipe_sd15
61
 
62
  if loaded != (ckpt + mode):
 
37
  # "runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, variant="fp16"
38
  # ).to("cuda")
39
 
 
 
 
 
 
 
 
 
 
40
  #@spaces.GPU(enable_queue=True)
41
  def generate_image(
42
  prompt,
 
48
  global loaded
49
  checkpoint = checkpoints[ckpt][0].format(mode)
50
  guidance_scale = checkpoints[ckpt][2]
51
+
52
+ pipe_sdxl = StableDiffusionXLPipeline.from_pretrained(
53
+ "stabilityai/stable-diffusion-xl-base-1.0",
54
+ torch_dtype=torch.float16,
55
+ variant="fp16",
56
+ ).to(device)
57
+ pipe_sd15 = StableDiffusionPipeline.from_pretrained(
58
+ "runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, variant="fp16"
59
+ ).to(device)
60
+
61
  pipe = pipe_sdxl if mode == "sdxl" else pipe_sd15
62
 
63
  if loaded != (ckpt + mode):