Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,8 +3,9 @@ import torch
|
|
| 3 |
from PIL import Image
|
| 4 |
from torchvision import transforms
|
| 5 |
|
| 6 |
-
from diffusers import
|
| 7 |
|
|
|
|
| 8 |
def main(
|
| 9 |
input_im,
|
| 10 |
scale=3.0,
|
|
@@ -46,16 +47,6 @@ def main(
|
|
| 46 |
|
| 47 |
description = \
|
| 48 |
"""
|
| 49 |
-
__Now using Image Variations v2!__
|
| 50 |
-
|
| 51 |
-
Generate variations on an input image using a fine-tuned version of Stable Diffision.
|
| 52 |
-
Trained by [Justin Pinkney](https://www.justinpinkney.com) ([@Buntworthy](https://twitter.com/Buntworthy)) at [Lambda](https://lambdalabs.com/)
|
| 53 |
-
|
| 54 |
-
This version has been ported to 🤗 Diffusers library, see more details on how to use this version in the [Lambda Diffusers repo](https://github.com/LambdaLabsML/lambda-diffusers).
|
| 55 |
-
For the original training code see [this repo](https://github.com/justinpinkney/stable-diffusion).
|
| 56 |
-
|
| 57 |
-

|
| 58 |
-
|
| 59 |
"""
|
| 60 |
|
| 61 |
article = \
|
|
@@ -73,8 +64,8 @@ More details are on the [model card](https://huggingface.co/lambdalabs/sd-image-
|
|
| 73 |
"""
|
| 74 |
|
| 75 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 76 |
-
pipe =
|
| 77 |
-
"
|
| 78 |
)
|
| 79 |
pipe = pipe.to(device)
|
| 80 |
|
|
|
|
| 3 |
from PIL import Image
|
| 4 |
from torchvision import transforms
|
| 5 |
|
| 6 |
+
from diffusers import DiffusionPipeline
|
| 7 |
|
| 8 |
+
pipeline = DiffusionPipeline.from_pretrained("fusing/karlo-image-variations-diffusers")
|
| 9 |
def main(
|
| 10 |
input_im,
|
| 11 |
scale=3.0,
|
|
|
|
| 47 |
|
| 48 |
description = \
|
| 49 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
"""
|
| 51 |
|
| 52 |
article = \
|
|
|
|
| 64 |
"""
|
| 65 |
|
| 66 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 67 |
+
pipe = KarloImageVariationPipeline.from_pretrained(
|
| 68 |
+
"fusing/karlo-image-variations-diffusers",
|
| 69 |
)
|
| 70 |
pipe = pipe.to(device)
|
| 71 |
|