anzorq commited on
Commit
b126587
1 Parent(s): 12e7a18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -35,6 +35,7 @@ models = [
35
  last_mode = "txt2img"
36
  current_model = models[1]
37
  current_model_path = current_model.path
 
38
 
39
  if is_colab:
40
  pipe = StableDiffusionPipeline.from_pretrained(current_model.path, torch_dtype=torch.float16)
@@ -47,6 +48,7 @@ else: # download all models
47
  unet = UNet2DConditionModel.from_pretrained(model.path, subfolder="unet", torch_dtype=torch.float16)
48
  model.pipe_t2i = StableDiffusionPipeline.from_pretrained(model.path, unet=unet, vae=vae, torch_dtype=torch.float16)
49
  model.pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(model.path, unet=unet, vae=vae, torch_dtype=torch.float16)
 
50
 
51
  device = "GPU 🔥" if torch.cuda.is_available() else "CPU 🥶"
52
 
 
35
  last_mode = "txt2img"
36
  current_model = models[1]
37
  current_model_path = current_model.path
38
+ pipe = None
39
 
40
  if is_colab:
41
  pipe = StableDiffusionPipeline.from_pretrained(current_model.path, torch_dtype=torch.float16)
 
48
  unet = UNet2DConditionModel.from_pretrained(model.path, subfolder="unet", torch_dtype=torch.float16)
49
  model.pipe_t2i = StableDiffusionPipeline.from_pretrained(model.path, unet=unet, vae=vae, torch_dtype=torch.float16)
50
  model.pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(model.path, unet=unet, vae=vae, torch_dtype=torch.float16)
51
+ pipe = models[1].pipe_t2i
52
 
53
  device = "GPU 🔥" if torch.cuda.is_available() else "CPU 🥶"
54