Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -39,8 +39,6 @@ pipe = None
|
|
39 |
|
40 |
if is_colab:
|
41 |
pipe = StableDiffusionPipeline.from_pretrained(current_model.path, torch_dtype=torch.float16)
|
42 |
-
if torch.cuda.is_available():
|
43 |
-
pipe = pipe.to("cuda")
|
44 |
|
45 |
else: # download all models
|
46 |
vae = AutoencoderKL.from_pretrained(current_model.path, subfolder="vae", torch_dtype=torch.float16)
|
@@ -49,6 +47,9 @@ else: # download all models
|
|
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 |
|
|
|
39 |
|
40 |
if is_colab:
|
41 |
pipe = StableDiffusionPipeline.from_pretrained(current_model.path, torch_dtype=torch.float16)
|
|
|
|
|
42 |
|
43 |
else: # download all models
|
44 |
vae = AutoencoderKL.from_pretrained(current_model.path, subfolder="vae", torch_dtype=torch.float16)
|
|
|
47 |
model.pipe_t2i = StableDiffusionPipeline.from_pretrained(model.path, unet=unet, vae=vae, torch_dtype=torch.float16)
|
48 |
model.pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(model.path, unet=unet, vae=vae, torch_dtype=torch.float16)
|
49 |
pipe = models[1].pipe_t2i
|
50 |
+
|
51 |
+
if torch.cuda.is_available():
|
52 |
+
pipe = pipe.to("cuda")
|
53 |
|
54 |
device = "GPU 🔥" if torch.cuda.is_available() else "CPU 🥶"
|
55 |
|